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

Fix for unreliable wake-up port detection + DHCP and retry options #6

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

freddieleeman
Copy link
Contributor

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.

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
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.

1 participant