ESP8266 as WiFi gateway that posts to Thingspeak
-
Thanks to Hek/Yveaux/nikil511 I’ve got an ESP8266 wifi gateway that posts sensors readings directly to thingspeak without need for a computer :)
At the moment my code is setup for sending temperature and wind speed readings to two separate thing speak channels. It could be easily modified for single or even more channels or diffrent data
I have only changed the original Esp8266Gateway.ino code but have included the GatewayUtil.h in it for completeness. Also note it requires all the same mysensor library’s etc.
The code can be found here
https://github.com/Lendog/Mysensors-ESP8266-Wifi-gateway-post-to-thingspeakOne thing to note: is thingspeak requires 15 second wait before readings. This is handled on the sensor side and not on the esp8266. I think readings just don't get posted if it’s less than 15 seconds, this is not critical in my application so i haven’t worried about investigated alternative solutions.
Would be awesome if part of the code gets integrated into the original, as posting to thingspeak maybe beneficial to other users.
also my wificheck is handled slightly differently. I've heard the esp locks up if no valid connection and http post occurs. Haven’t tried it, I just figured it’s good to check first before posting.
Anyway hope someone else may find this useful.
-
Thanks to Hek/Yveaux/nikil511 I’ve got an ESP8266 wifi gateway that posts sensors readings directly to thingspeak without need for a computer :)
At the moment my code is setup for sending temperature and wind speed readings to two separate thing speak channels. It could be easily modified for single or even more channels or diffrent data
I have only changed the original Esp8266Gateway.ino code but have included the GatewayUtil.h in it for completeness. Also note it requires all the same mysensor library’s etc.
The code can be found here
https://github.com/Lendog/Mysensors-ESP8266-Wifi-gateway-post-to-thingspeakOne thing to note: is thingspeak requires 15 second wait before readings. This is handled on the sensor side and not on the esp8266. I think readings just don't get posted if it’s less than 15 seconds, this is not critical in my application so i haven’t worried about investigated alternative solutions.
Would be awesome if part of the code gets integrated into the original, as posting to thingspeak maybe beneficial to other users.
also my wificheck is handled slightly differently. I've heard the esp locks up if no valid connection and http post occurs. Haven’t tried it, I just figured it’s good to check first before posting.
Anyway hope someone else may find this useful.
-
I've created a new branch at
I feel a bit slack not properly testing it yet and putting it online, but it compiles fine just haven't loaded it on or tested with sensors. Might need to look into updating a sensor or 2 to run on the new libary