I’ve tried several of the examples in the tutorials as well as as “solutions” from various threads on this subject. The only way I can get the Electron to sleep (and wake up as expected) is if I specify “time”, but I want to specify a wakeup pin and NOT “time”. When specifying a WKP, the Electron does appear to shutdown, but then immediately starts up again. I have a momentary contact switch on D3. In order to make sure that I’m not getting some residual “bounce” from the switch, I put out a message and then pause for 3 seconds and then a second message before issuing the System.sleep() command. The code is:
Serial.print("Preparing to go to sleep1.....\n"); delay(3000); // Switch debounce (longer than it needs to be for testing) Serial.println("Sleeping....."); System.sleep(D3,CHANGE,SLEEP_MODE_DEEP);
Although it appears to shutdown and restart, most of the time I have to press the “reset” switch to get it to connect (pulsing Cyan) as it seems to get stuck at the medium flashing blue (it eventually does connect - some of the time) However, once I do the hard reset it connects right away.
I’ve tried specifying "RISING, “FALLING” as well as “CHANGE” with the same result.