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

Avatar

Please consider registering
Guest

Search

— Forum Scope —






— Match —





— Forum Options —





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

Register Lost password?
sp_Feed sp_TopicIcon
data not show on thingspeak
Avatar
fahimhaider
New Member
Forum Posts: 1
sp_UserOfflineSmall Offline
1
June 18, 2016 - 4:57 am
sp_Permalink sp_Print

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 )

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

Avatar
Hans
Natick, MA

Forum Posts: 390
sp_UserOfflineSmall Offline
2
June 20, 2016 - 9:21 am
sp_Permalink sp_Print

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:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 252

Vinod: 164

cstapels: 96

piajola: 75

vespapierre: 63

Adarsh_Murthy: 59

Newest Members:

dannymm1

KamorkasOr

GRV2903

Jusikaclaiz

Raymondpoers

ScottDus

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

 

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Administrators: Hans, lee