sblantipodi/firefly_luciferin

[Feature request]: Automatic reconnect to MQTT

Closed this issue · 4 comments

Is your feature request related to a problem? Please describe

If there is a delay in network connection at system startup Firefly reports that it is unable to connect to MQTT, which is fair enough. There is, however, no apparent retry mechanism in place and no manual reconnect option so the only solution is to close Firefly and start it again after the network interface is connected.

Describe the solution you'd like

Display connection warning as a system notification instead of dialog to make it less intrusive and add MQTT reconnect mechanism, preferably with exponential backoff.
Maybe add a "Reconnect" button to the UI and/or system tray menu.

Describe alternatives you've considered

Add a "Reconnect" button to the existing warning dialog and/or system tray menu to allow manual reconnect instead of restarting the entire application.

Hi @sorcererlc,
thanks for your interest in the Luciferin project.

I agree that this is a needed feature. I never thought on it before because most of us have an MQTT server running H24 on a Raspberry or similar but I understand the need.

Don't know when, but it will be fixed "soon enough".

Hi @sblantipodi
Thanks! No rush, I know a quite bit about priorities in a software project :)

I also have an MQTT server running non-stop. My issue is with the computer running Firefly. Sometimes it takes up to a minute for the network interface to connect after the Windows taskbar and system tray are initialized... it just shows as "No internet connection". Very odd considering it's a wired interface. Could be an issue with the driver or Windows itself but that's off topic.

Thanks again for considering my request :)

image

Hi @sorcererlc, your suggestion was easy and fast enough.
Next release of Luciferin will have a smarter way to manage the lack of network connection.

MQTT connection will be automatically retried every 10 seconds.
Informative messages or errors that doesn't need user interaction has been moved to the OS notification system instead of having a window dialog, less user interaction, less intrusive :)

Hi @sblantipodi ,

Awesome! Thanks :)