Hi there. I’d like to use the System.sleep() function with Network Standby to get the lowest power state from the board without having to re-register with the network at every wake-up. So with core firmware 0.5.1 I’m making the following call:
System.sleep(D3, RISING, 30, SLEEP_NETWORK_STANDBY);
I have a few questions:
System.sleep()at the end of
loop()and then expect everything to be tickety-boo when
loop()is called again. However, what I’m finding is that when
loop()is called after waking up from sleep the code in
loop()stalls for some time and, also, the device re-handshakes with the server (the log says “device came on-line”) when it first publishes after waking up. If, however, I insert a 5 second delay at the start of
loop()this problem goes away. I think the reason is that my
Serial.printxx()debugging calls are stalling because USB has not sorted itself out and, for some reason, the core firmware is deciding that it needs to re-handshake. Is this expected behaviour? Aside from conditionally-compiling out all my calls to
Serial.printxx(), is there another way to avoid having to insert the 5 second delay?
I don’t want the system to wake up on any pin rising or falling: is there a
NCpin I can specify in the call to
System.sleep()to indicate this?