PaesslerAG / maker-monday

Maker Monday related stuff
BSD 3-Clause "New" or "Revised" License
19 stars 6 forks source link

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

Open freddieleeman opened 3 years ago

freddieleeman commented 3 years ago

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.