I'm trying to build a sensor that should update an MQTT broker only if something changes. So every few seconds it's supposed to wake up just enough to check a few inputs, compare them with the last time it woke up, and only if there has been a change should it connect to the broker and write the updates. I don't expect many updates per day, but if I sleep more than 10 seconds, I might miss them.
I'm using WiFi.forceSleepBegin()
and WiFi.forceSleepWake()
, mainly based on these articles. But there is this tempting option of ESP.deepSleep(n, WAKE_RF_DISABLED)
The API that I found only mentions this:
If you implement deep sleep with WAKE_RF_DISABLED and require WiFi functionality on wake up, you will need to implement an additional WAKE_RF_DEFAULT before WiFi functionality is available.
Do I read this correct if I understand that I would need to make another deepSleep
just to wake up again with WiFi back active? Or is there an easier way to boot up the WiFi after such a sleep?
Thank you