Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add client.loop_forever() for auto-reconnect #19

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

atkaper
Copy link
Contributor

@atkaper atkaper commented Apr 1, 2023

Fix for #21

Even though hc2mqtt was running, and showed active log lines, I stopped receiving the messages sometimes in the MQTT server and subscribed processes.

Adding client.loop_forever() will auto-reconnect to the mqtt server in case of network loss / hickups. Seems to help for my setup.

Docs: https://pypi.org/project/paho-mqtt/#network-loop

And thanks for the great hack/tool! Super!

I was using the cloud API to monitor washing-machine progress, but that's quite a flaky setup, loosing access/tokens every now and again if their cloud is offline for a bit. This direct connection is much better! ;-)

Even though hc2mqtt was running, and showed active log lines, I stopped receiving the messages sometimes in the MQTT server and subscribed processes.
Adding client.loop_forever() will auto-reconnect to the mqtt server in case of network loss / hickups. Seems to help for my setup.
Docs: https://pypi.org/project/paho-mqtt/#network-loop
@osresearch osresearch merged commit 26384a0 into osresearch:main Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants