Temperature logging

After much perseverance at getting the AT command set for the ESP8266 to simultaneously act as socket listener and web client I eventually decided to read the guide – and that’s when the dark cloud appeared. You have to RESET the unit after changing mode – so there is NO chance of doing this simultaneously.

After I’d decided NOT to cut my wrists, I sat down yesterday and wrote the code for my Arduino+ESP-01 (well, my 1284 Arduino – same thing but 2 UARTS and more memory) and wrote a little routine so that every hour on the hour, the unit would switch modes, get the time from a web server, send off the temperature and then reset and go back to socket listener mode.

The result… since teatime last night and this morning it’s done just that on the hour without a hitch.. and the rest of the time (maybe 15 seconds of non-availability every hour) it’s working just fine talking to my Android App.

temperature reading

Right now the code’s a little crude – I need to modify my input checker (watches for replies with timeouts while waiting and after receiving – and offers optional capture of incoming info between  starting and ending strings so that I can add retry options and reboot the board on failure. Right now the routine is blocking – I need to think of a non-blocking version so I can get on and do other things while it’s waiting for replies… I’ll put the code in here and let others comment soon.

So in essence, it works – I can soon adapt this into one of my home controllers with temperature control and at last be free from the evils of Ethernet cable.

New: Well, nothing really, no updates to Lua, no updates to the AT code or the SDK that I’m aware of  – after a flurry of activity things seem a little dead right now.  Off to see a friend at the weekend who has the first of some boards we had made in China to mess with ESP-01 boards – more when we get started with the soldering iron.

5 thoughts on “Temperature logging

    • No, free of charge. This channel is only update by one esp8266 and one d18b20.
      Actually, the main power is made by a 220v adaptateur and a 3.3v regulator. I hope to change it with a battery if I have good results with the node.sleep() fonction.

  1. I dont suppose you could post your code? I’m doing the same thing but with an arduino. I’d love to remove it and just use the ESP. I’m trying to incorporate it into my Arduino based thermostat as a second “zone” and would love to minimize as much as possible.

    • Trust me you don’t want mt code right now – it doesn’t work – we spent all day yesterday trying to figure out why a call to a website would work when performed live and not when performed from a file – and we’re still no further forward. I even emailed Zeroday and I’ve not heard back yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s