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-thingspeak

    One 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.



  • @Lendog Hello, is the sketch compatible with Mysensosr 2.0 ?
    thanks



  • It should work. If it doesn't let me know and I may have a look at it.

    But I've been happy with it, once i got it sorted I haven't looked at the code since. Haven't needed to 🙂



  • Hi. It doesnt work with mysensors 2.0 compling it. Any chance to covert it to be able to compile with 2.0 version?



  • Thanks. Might try to updated it in the next few days if I get a chance. Think the original library I used was 1.5.1 if that's any help



  • I've created a new branch at

    https://github.com/Lendog/Mysensors-ESP8266-Wifi-gateway-post-to-thingspeak/tree/My-sensors-library-2.0

    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


Log in to reply
 

Suggested Topics

  • 1
  • 3
  • 2
  • 2
  • 5
  • 1

65
Online

11.4k
Users

11.1k
Topics

112.6k
Posts