Wanted: emonTH 2 sketch that handles many external ds1820Bs - I'll pay for it!

Hi @JustPlaying

This evening I thought I’d write you a program to solve the temperature monitoring problem you have!

The code is here. GitHub - stuartpittaway/ESP8266-DS18B20-EMONCMS: ESP8266 based temperature monitor for emonCMS

It uses the ESP-8266-12E (NODE MCU 1.0) with the Arduino firmware on it - these chips are about $3USD each!

Once you write my program to the chip and power it up from USB, it will create a new WIFI access point named “ESP8266_TEMP_MON”. Connect to this WIFI from your phone or PC and browse to http://192.168.4.1

Now simply select the WIFI access point you want this device to connect to in the future and its password.

You will also need to configure the emonCMS server to connect with (it won’t work with HTTPS) and enter your read+write API key.

Click submit to save the values and then when prompted, press RESET on the ESP chip.

After reboot it will then automatically connect to your WIFI as a client, scan for up to 20 temperature sensors and then transmit the readings every 30 seconds to emonCMS.

When it uploads, it posts the values into the node specified in the configuration page and labels each reading with the sensors serial number, like this…

You can edit the labels to add on a name if you want to.

The code is a bit rough and ready, but give it a go and see what you think!

7 Likes

Stuart, I was interested to see if this would fit on an ESP8285 which is what is the Sonoff devices are based on.

The compile fails and I’m assuming it is because the user_interface.h file isn’t present. Any chance you could upload that to Github?

Cheers

Simon

Stuart - you’re a star!

If I sent you some money now - would you be willing to send me a hardware system already set up with your code? I’m in the UK - and would cover your postage.

It’s just that I’m a noob at this… and would hate to faff about for weeks never quite getting to the point of trying your software properly…

Thanks again for your creativity!

I’d been thinking about this for a while, but it was all new to me so I had not got around to it.

Could I suggest adding an option to put in a static IP as well?

Node can be text as well as a number now (used to be only numbers).

Just take those lines out - should compile without them - this is copied from the ESP libraries - its not my code.

Its from here…

I’ve a SONOFF relay unit at home, may also give it a try.

Happy to accept a pull request :slight_smile:

Thanks Stuart - will have another go.

simon

I’ve updated the code again tonight, just a general tidy up.

I’m now using the Arduino JSON library to generate the packet to send to emonCMS - this also means that should a temp sensor fail we just skip over it on the readings and the others continue.

Coming back to an origional question here, Is there a sketch for multiple (maybe 4) ds18b20s for the latest EmonTh with RFM69. Not worried about sensor ordering.
Thanks