data not show on thingspeak | ESP8266 Wi-Fi Module | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
data not show on thingspeak
No permission to create posts
June 18, 2016
4:57 am
Avatar
fahimhaider
New Member
Members
Forum Posts: 1
Member Since:
June 17, 2016
sp_UserOfflineSmall Offline

Dear ALL

I am sending temperature data to thingspeak but it did't show in my channel. Below is my code. Please give me the suggestion.

t=require("ds18b20_1")
pin = 1
t.setup(pin)
addrs = t.addrs()
if (addrs ~= nil) then
  print("Total DS18B20 sensors: "..table.getn(addrs))
   end

-------------------------------------------------------------------------------
wifi.setmode(wifi.STATIONAP)
wifi.sta.config("INNEXIV", "innexiv$1")
tmr.alarm(0,5000,1, function()    -- 5sec for get the ip address for router
   add = wifi.sta.getip()
   if(add == nil) then
      print("Connecting to AP...
")
   else
      ip, nm, gw=wifi.sta.getip()
      print("IP Info:
IP Address: ",ip)
      print("Netmask: ",nm)
      print("Gateway Addr: ",gw,'
')
      tmr.stop(0)
   end
end)
-------------------------------------------------
function sendData()
  value=ds18b20_1.read()
-- print("temp",value)
print("Sending data to thingspeak.com")
conn=net.createConnection(net.TCP,false)
conn:on("receive", function(conn, payload) print(payload) end)
-- api.thingspeak.com 184.106.153.149
conn:connect(80,'184.106.153.149')
conn:send("GET /update?key=XDKWXU7SQ39WXXPY&field1="..value.." HTTP/1.1
")
conn:send("Host: api.thingspeak.com
")
conn:send("Accept: */*
")
conn:send("User-Agent: Mozilla/4.0 (compatible; esp8266 Lua; Windows NT 5.1)
")
conn:send("
")
conn:on("sent",function(conn)
                      print("Closing connection")
                      conn:close()
                  end)
conn:on("disconnection", function(conn)
          print("Got disconnection...")
  end)
end
-- send data every X ms to thing speak
tmr.alarm(2, 60000, 1, function() sendData() end )

--------------------------------------------------------

June 20, 2016
9:21 am
Avatar
Hans
Natick, MA

Admin
Forum Posts: 396
Member Since:
January 18, 2011
sp_UserOnlineSmall Online

The charts only show numeric data such as 77.9 or 80 - you can use the IoT Debugger tool to see what the data looks like. Sometimes this helps you troubleshoot formatting issues. https://github.com/nothans/iot-debugger

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online: Hans, agrisensezm
34 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

Archieter, JamesExedo, IrbosHich, brodi, kasko, franklin castro

Administrators: Hans: 387, lee: 457