This is firmware for simple wireless iButton reader controlled over MQTT. It uses the Homie MQTT convention and is based on Homie implementation for ESP8266 by Marvin Roger, benefiting from all the features this library provides, like: captive web portal for initial configuration, OTA updates over MQTT, WiFi reconfiguration over MQTT etc.
- Wemos D1 Mini
- iButton reader
- 180Ω resistor
- 4.7KΩ resistor
- factory reset button
- iButton reader data go to D1
- D1 goes through R4.7K to 3.3 V
- iButton LED goes through R180 to D2
- D3 goes through the factory reset button to ground
Import this code into platformio, then run build target "PlatformIO: Upload SPIFFS Image".
Then you could compile and upload the sketch to your board as usual.
Once you upload the sketch, you have to configure the node as described in Homie Getting Started Tutorial (this is where you device gets device id assigned)
-
The device will report the iButton address to MQTT topic
homie/<deviceid>/ibutton/address
-
similarly you could control the reader LED by publishing to following topics
homie/<deviceid>/led/brightness/set <0..1023>
homie/<deviceid>/led/status/set <ON|OFF>