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
460 stars 157 forks source link

In case of reconnection to MQTT broker subscriptions are lost #333

Closed JohannesHennecke closed 5 months ago

JohannesHennecke commented 8 months ago

Describe the bug When connection to the MQTT broker is lost for a short time, mqtt-io reconnects to the broker and is able to publish again. But the subscriptions to topics which were made when mqtt-io first connected to the broker, are lost. That means, that after the reconnection mqtt-io does not react anymore when requests are made using those topics.

Expected behavior The subscriptions should be repeated directly after the reconnection.

Error messages and traceback

Paste any error messages and Python traceback if applicable.

Config

Hardware Raspberry Pi 4

System:

Additional context I have implemented a solution for this problem and would like to commit it.