Waking from Deep Sleep

Hello. This is for the Spark Core and deep sleep. I realize there have been a number of previous threads on Deep sleep, but each one doesn’t seem to end up solving the same issue I’m having - and most seem to talk about upgrading the core, But they are old, and I received my chip only a month and a half ago or so. Basically, to put it into familiar terms, I have written a simple program that combines a couple of the sample programs: Get some weather data + Read from A0, then publish both to Librato. After performing these tasks the Spark goes into deep sleep mode for 30 minutes. Upon waking up the cycle repeats.

I’m having inconsistency issues with the webhooks, but I’ll leave that to another thread (I still need to research all the posts on that problem), but they fire 90% of the time.

So this might all work well for 2 days or 2 hours, but after some point in time I notice that data points are no longer being posted to Librato. I look at the Spark Core and see that the LED is blinking green. With one exception pushing the Reset button has fixed the problem, and it continues on its way. The last time it happened I had to power-cycle the chip.

Any thoughts?

Thanks.

-Dan

Hmmm… Sounds like it disconnected from the Wifi?

@bko would say that the DHCP lease expired on the router usually within 24hours.

Also, we can add more code to reset the WiFi connection if that scenario occurs :wink:

1 Like

Hi @dpicker

We have seen some cases where the TI CC3000 gets messed up (and DNS fails) but reflashing the TI part with “deep update” restores it.

It might worth doing the “deep update” to the TI part again and try it again.

Hi @bko and @kennethlimcp. Thank you for your responses.

I can try the deep update just in case.

I think it’s likely that it temporarily lost WiFi, for some reason. Assuming that happened while it was coming out of sleep, I would think it would keep trying and eventually re-acquire, as the reset button accomplishes that. Assuming the DHCP lease expired I’m again not sure why coming out of deep sleep wouldn’t resolve that, since from the documentation it would appear it essentially resets.

You may also be able to try some of the recommendations in the thread linked below. You’ll have to boot your Core in MANUAL or SEMI_AUTOMATIC mode so that you can run your user code that tries to manage the wifi connection. If all else fails, you can trigger a reboot!

Thank you. Will definitely try the various suggestions.

Just an update. I performed a deep update (with not a small amount of difficulty), and now I’ve been running a cycle of 30 seconds awake, 30 minute deep sleep for the past 3 days or so and it hasn’t gotten stuck in green blinking mode upon wakeup - so far, so good. Looking at the data produced it does appear that the occasional sleep cycle has been missed, or has been skewed in timing (I don’t have close time-of-day control on the cycles in the code), so it could be that it has gotten stuck for periods of time and then finally latched back onto the network. But at least it has recovered.

3 Likes