sumnerboy12 / mqtt-gpio-monitor

Python script for sending/receiving commands to/from GPIO pins via MQTT messages
46 stars 23 forks source link

Get Status of out pins #5

Closed bgewehr closed 8 years ago

bgewehr commented 9 years ago

When a pin is in Out mode it does not show the status to mqtt when changed from another source, let's say local script action or reboot.

Do you have a solution for this like polling the out pins and generating out messages on the bus?

bgewehr commented 9 years ago

sudo gpio read 17 for example is able to read if it is 0 or 1 so polling could be a chance, right? On the other hand the script would have to remember all states and poll to proof if a difference to the remembered has occurred. Hm...

sumnerboy12 commented 8 years ago

This would require a second polling loop to monitor the state of the output pins. I am not sure how simple this would be to implement. The general idea of this script was to allow a very simple way to monitor some input pins, and control some output pins. Where the output pins are controlled only by the script. I am a little wary of over-complicating things as currently the script works very well for me ;).