This function returns a number representing the reason that a device has woken from deep sleep. Example code:
var wakeupCause = ESP32.getWakeupCause();
if (wakeupCause == 0) {
// Assume a reboot i.e.completely new start
OnInit();
} else {
// Wakeup from deep sleep.
// Could check values 2-6 for explicit wakeup source
OnWakeup();
}
This function returns a number representing the reason that a device has woken from deep sleep. Example code: