Page 1 of 1

Homie and 1-wire

PostPosted: Wed Nov 02, 2016 12:11 pm
by kylegordon
Morning all,

Just thought I'd drop in the little Arduino code on ESP8266 hardware project that I have. For a while now I was running a string of 1-wire temperature sensors off of a Raspberry Pi, which were then pushed onto an MQTT bus. With a desire to retire the Pi, I moved on to an ESP8266, with some custom code (at ... 20_arduino ). Unfortunately that code had some problems that caused persistent hangs and reboots of the ESP8266.

So the solution is the Homie framework from, and some simple code inserted. The end result is and it's been working great now.

Homie seems really nice, in that the device enters an initial configuration mode that can be detected through the a web app at (for v.15), and then once attached the wifi and device configuration becomes persistent. There's also an Over The Air update feature that I haven't used yet.

My DS18B20 sensor code lives inside loopHandler(), and Homie does the rest. I've not had any drop outs, hangs, or reboots yet. At the moment I had to manually scan my 1-wire bus to get all the ROM IDs and hardcode them in, but one day I hope to be able to scan it automatically at bootup.