April Not waking up from Deep Sleep even if Pin1 is forced high?

Setting hardware.pin1.configure(DIGITAL_IN_WAKEUP); in my code does not appear to bring the IMP back to life even if Pin1 is tied high. Forcing to low, then high also makes no difference. The device never seems to wake back up.

I’ve tried this with two IMPs, and also tested PIN1 while the IMP was awake and it responded as expected.

What am I missing?

wadeweppler assume you are going into deep sleep? can you share your code? I have been using this approach for a movement sensor and it works on all of my Aprils.

It’s specifically a rising edge on pin 1, so keeping it tied high won’t do the wake-up, but pulsing it low then high again should have woken it on the rising edge.


Thanks all. I mistook the “Power State: online->offline” log message as deep sleep. Forcing the device to deep sleep mode, and then triggering pin 1 works perfectly!

However, the “Power State: online->offline” brings up another question. The IMP is losing connectivity to the planner, and it never comes back until after a reset/reboot of the IMP. Not a problem now that I understand deep sleep, but is there any recommended way of dealing with the online->offline issue?

If you’re seeing the power state message, that means that the imp has not responded to a server ping, or has missed a check-in time (eg it said it’d sleep for 10 minutes and didn’t come back when it said it would) and has been marked offline by the server.

This is usually either an infinite loop (imp network stack not getting to process events), the imp has been powered off, or a bug… there’s a known issue in the current release which means that if no squirrel runs for an extended period (hours) things get silted up and it stops processing network events. You can just run an imp.wakeup() every now and then and it’ll be fine.