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

Extract MQTT message processing #484

Merged
merged 2 commits into from
Feb 24, 2022
Merged

Extract MQTT message processing #484

merged 2 commits into from
Feb 24, 2022

Conversation

matjack1
Copy link
Collaborator

This refactor is to address the problem that MQTT message processing was causing the ESP8266 to reboot, because of the timeout of the watchdog that make sure to go back to the system tasks, like taking care of wifi connection.

Also the MQTT library mentions this: https://github.com/marvinroger/async-mqtt-client/blob/develop/docs/1.-Getting-started.md#fully-featured-sketch

The point is to remove blocking code from the MQTT callback and moving it to the main loop. This alone solves all my stability issues. Meanwhile I've also upgraded to the latest client version, which solved another issue where I wasn't getting all the MQTT messages that I was seeing in the serial monitor.

This PR fixes for me #388, and also I cannot reproduce anymore the errors in #324 and probably also #312 is related to this.

Every time MQTT message processing was going over a time limit the board was resetting.

Copy link
Collaborator

@omersiar omersiar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done. Clean

@omersiar omersiar merged commit 2262419 into dev Feb 24, 2022
@matjack1
Copy link
Collaborator Author

Thanks :)

@matjack1 matjack1 deleted the fix-mqtt branch February 24, 2022 12:04
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.

2 participants