Homie and 1-wire

Show or discuss your existing Home automation project here, so a detailed explanation!.....
Post Reply
kylegordon
Starting Member
Starting Member
Posts: 11
Joined: Tue Jan 07, 2014 10:02 am

Homie and 1-wire

Post 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 https://github.com/kylegordon/mqtt_esp8 ... 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 https://github.com/marvinroger/homie-esp8266/releases, and some simple code inserted. The end result is https://github.com/kylegordon/homie-ds18b20-1wire 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 https://marvinroger.github.io/homie-esp8266/ (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.
Post Reply

Return to “Home Automation Projects”