BlinkUp LED behavior after deep sleep

I’ve got a rather inconsequential question, but one I’m curious about, and not sure I’ve seen a succinct answer to in the docs or on the forum. When a device wakes from a (timed) deep sleep state, should the BlinkUp LED go through the same sequence as at power on / cold boot (my thought), or remain off ?

I have a program that runs just fine, coming out of deep sleep every 15 minutes for a few seconds taking some sensor readings then accessing WiFi and sending info to an agent, but I see no activity on the BlinkUp LED … it remains off the entire time. (The LED works fine, showing typical network access sequence with power cycles).

A few related details …

  • Imp-004 … OS 42.9

  • pretty simple code -

imp.onidle(function(){
    imp.deepsleepfor(900);
});
  • Not using imp.enableblinkup() anywhere in the code

I did however find this this link, which appears to indicate that the BlinkUp system should be active after deep sleep, but I’m not seeing this. I would just like confirmation of expected behavior, or if I might be overlooking something.

Again, not a particularly significant question, just something I would like to understand better. Thanks in advance for any comments or insight.

Larry

Hi Larry,

I think you’ve found an undocumented edge case. :slightly_smiling_face:

For imp004m and impOS 42.9, after a timer wake up from deep sleep, BlinkUp will be automatically enabled only if the initial, synchronous squirrel code starts a connection.

BlinkUp won’t be enabled for your offline example, and it also won’t be enabled if the connection is started asynchronously e.g.:

imp.wakeup(0, function(){server.log("too late");});

Most of our tests and example code either connect straight away or remain offline and go back to sleep. For the latter use case it’s better not to enable BlinkUp in order to conserve battery power.

If your wake up code starts offline but later decides to make a connection, you have to call imp.enableblinkup(true) to get a visual indication.

Phil

Hi Phil -

Thanks for getting back with me, and for the detailed explanation … good to know, and that the behavior is expected. I figured that was likely the case as my program runs fine, but it’s good to have confirmation. (I recently switched this circuit from -002 → -004 devices, and I think I recall the -002 based units doing the blinkup sequence … the -004 was a just a bit different behavior so I wanted to make sure I wasn’t missing something).

I did play around a bit and added an earlier connection, as well as an imp.enableblinkup(true) statement, and yep, it’s now going through the LED sequence when coming out of deep sleep. But that said, I’ll just remove this now and revert to original code to conserve power, as you mention, as the device is battery powered.

Thanks again,
Larry

This topic was automatically closed after 60 days. New replies are no longer allowed.