flyte / mqtt-io

Expose GPIO modules (Raspberry Pi, Beaglebone, PCF8754, PiFace2 etc.) and digital sensors (LM75 etc.) to an MQTT server for remote control and monitoring.
MIT License
461 stars 157 forks source link

Running mqtt-io as a service on Raspberry Pi #321

Closed alexfrench closed 1 year ago

alexfrench commented 1 year ago

I got everything working from the command line and decided it was time to autostart as a service.

The service starts, logs a few lines as below and then simply stops. According to the log, none of the messages that show as published actually reach Home Assistant. There's nothing in the log to indicate an error - it simply stops running.

Jul 14 19:54:13 raspberrypigarage python[615]: 2023-07-14 19:54:13 mqtt_io.server [DEBUG ] Running MQTT task with priority 3: <coroutine object MqttIo._mqtt_publish at 0x75aa56a> Jul 14 19:54:13 raspberrypigarage python[615]: 2023-07-14 19:54:13 mqtt_io.server [DEBUG ] Publishing MQTT message on topic 'homeassistant/output/garage_light': 'OFF'

This is how I ended up fixing it.

https://github.com/flyte/mqtt-io/issues/250