Fix for unreliable wake-up port detection + DHCP and retry options#6
Open
freddieleeman wants to merge 3 commits intoPaesslerAG:masterfrom
Open
Fix for unreliable wake-up port detection + DHCP and retry options#6freddieleeman wants to merge 3 commits intoPaesslerAG:masterfrom
freddieleeman wants to merge 3 commits intoPaesslerAG:masterfrom
Conversation
Added DHCP / static IP options Added timer-based retry functions on WiFi / MQTT failures Fixed the style formatting
Added DHCP enable/disable option, retry functions and fix for when the board does not provide the correct port that triggered the wake-up. When this happens the script checks if either port is still HIGH. I've been using this code for a few months now and had no issues since.
typo in variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After some tedious debugging I've discovered that the detection of the wake-up port is unreliable. When this happens (wakeupStatus == 0) the script checks if either of the ports is (still) HIGH.
I've also added retry functions that are useful when WiFi or MQTT broker are unreliable or temporarily down. The script saves the state, sets a (configurable) time-based deep-sleep and tries to send the message again.
DHCP can now be configured (true/false) for people that do not want to reserve a static IP address.
I've been using this code for a few months now and have not had any issues since.