Sleep mode problems on Electron

I’m building a project on both Photon and Electron devices that picks up on vibration and send a particle cloud notification when it detects movement. The sensor is activated through an interrupt on pin D3 and when activated, it calls a function to send a particle cloud notification.

This all currently works fine, but I’m trying to get more battery life out of the device. After an interrupt event, I start a 60 second timer, if there’s no more movement, I put the device to sleep and wake up on the interrupt from the sensor.I have an issue specifically on the Electron that can be reproduced every time. If I run System.sleep(D3, RISING); and as the device is going to sleep, it gets knocked, it simply hangs. It doesn’t ever wake up again. I’m running almost the same code (only the radio code is slightly different) on both the Electron and Photon devices and my photon has been running stably for weeks, but the electron tends to crash daily. If I wait a few seconds after the Electron has gone to sleep, it will wake up and function normally.

Are there any known problems around the electron going to sleep and the interrupt triggering a wake up?

Thanks, in advance.

That might be interesting for @KyleG to get an engineer looped in :wink:


Just to add a little more info on testing I’ve done since I posted this. I noticed there was an issue on 0.6.1 firmware I was using with the radio not shutting off potentially causing issues, so I upgraded to 0.7 RC3, but the issue still persists. Both my electron test devices exhibit the same behaviour.