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

MQTT keeps disabling itself #215

Closed
xoseperez opened this issue Sep 13, 2017 · 8 comments
Closed

MQTT keeps disabling itself #215

xoseperez opened this issue Sep 13, 2017 · 8 comments

Comments

@xoseperez
Copy link
Owner

Originally reported by: Trevor (Bitbucket: nightone, GitHub: Unknown)


Not sure why this is happening, but after the upgrade to 1.9.3, MQTT keeps disabling itself. there are no other errors on any of my other ESPs that connect to MQTT its only after the upgrade to 1.9.3. I login to the web UI and slide to enable and it connects again fine. then it stays connected for about a day and randomly disconnects.

I am running on a ITEAD SONOFF POW.

@xoseperez
Copy link
Owner Author

This is due to the MQTT_MAX_TRIES functionality. If the device disconnects several times in a row it assumes there is a problem with the broker and disables MQTT...

Not sure this was a good idea. Probably it would be better to space reconnect tries in time. The underneath reason is to avoid having the MQTT connect routine looping endlessly, probably affecting other routines.

For the moment you can set MQTT_MAX_TRIES to 0 in general.h and flash the firmware again to disable this functionality.

@xoseperez
Copy link
Owner Author

Original comment by halfluck (Bitbucket: halfluck, GitHub: halfluck):


Phew! it wasn't just me going nuts I was noticing this too Just flashed 4 x Sonoff Basic, 4 x S20 & 2 x NodeMCU
I've made the code change to general.h and will OTA flash, I'm assuming I will have to factory reset each device
for the code change to apply?

Thanks Rob.

@xoseperez
Copy link
Owner Author

Original comment by Trevor (Bitbucket: nightone, GitHub: Unknown):


Thanks for the fast update....have set MQTT to 0 and flashed...will let you know if that fixes the problem.... Looking at why it fails.... my network layout may contribute towards the retries as this POW is outside (in IPS waterproof container and covered) and connects to my main MQTT server though a secondary Access Point (AP) will check that the AP is not contributing to error.
Thanks again for great software.... you have made working with my IOT devices a dream.

@xoseperez
Copy link
Owner Author

Original comment by Reclusive Geek (Bitbucket: reclusivegeek, GitHub: reclusivegeek):


I came across this issue last night when I rebooted my broker. All the devices disconnected and disabled MQTT so had to manually reconnect all the devices.

I think it would be good if as standard there was a better time out period as users are going to need to restart brokers and those that use public cloud are going to get internet drops.

Thanks for this great IOT software and the hard work you put into maintaining it .

@xoseperez
Copy link
Owner Author

Original comment by jorgeassuncao (Bitbucket: jorgeassuncao, GitHub: jorgeassuncao):


Same here. One Sonoff and one H801 keep getting MQTT turned off. Will try MQTT_MAX_TRIES to 0.

@xoseperez
Copy link
Owner Author

Original comment by Trevor (Bitbucket: nightone, GitHub: Unknown):


Update: Have been running the past 3 days with MQTT_MAX_TRIES to 0 and MQTT no longer turns off.

@xoseperez
Copy link
Owner Author

Removing milestone: 1.9.3 (automated comment)

@xoseperez
Copy link
Owner Author

Fixed with 1.9.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant