Python script for read and publish via MQTT the keytag of iButton DS1990A, DS1985-F5+, DS1971+F5 with OneWire BUS of the Raspberry Pi
When using long wires (200mt max), and 3.3V power, a pullup resistor in the 1K to 2.7K range may be required. Check the diagram
First of all, update Raspbian. At boot, the OneWire BUS is disabled by default. To enable it, use “Raspberry Pi Configuration”. This is found under : Menu > Preferences > Raspberry Pi Configuration, and reboot.
This script require eclipse/mosquitto
, and eclipse/paho.mqtt.python
.
To install the required components, follow the instructions in the links below:
This script can run only with sudo
sudo python ibuttontomqtt.py