Inky Frame - Deep Sleep explanation

Is the Deep Sleep behaviour of the Inky Frame explained anywhere? There is a note in the Getting Started that plugging in a battery won’t wake it and you have to press a button to get it to run…

Clearly that isn’t reset as its asleep - which button then? Or do I need to code that in? If so, how?

Currently I have the BBC News example loaded and its fine on USB power (except my power bank goes to sleep - lolz), but it won’t wake up on battery at all…

The product page says:

Inky Frame can turn off the power that drives the Pico W and the display completely. It can be woken back up by the RTC , the front buttons or the external trigger on the extension header.

So I assume it is any front button. If I understand how the deep sleep works it’s a hardware/circuit thing, so there wouldn’t be any software necessary. You issue the deep-sleep command, and when you want to wake the board, you press one of the front buttons.

The BBC news example seems to be set up to prevent deep-sleep, are you sure that is what is causing yours to get stuck?

#set up and enable vsys hold so we don’t go to sleep
hold_vsys_en_pin = Pin(HOLD_VSYS_EN_PIN, Pin.OUT)

It can be woken up is the key phrase, I want to know how to enable that…

Also it is in deep sleep, look down at 2nd to last line and it sets it Pin.IN to allow Deep Sleep then executes time.sleep() but only takes a time not a pin. Hence my original question.

The RTC, front buttons and external trigger are indeed hardware wake ups, you don’t have to do anything to enable them (though you do need to tell the board to stay awake long enough to execute your code if running on battery - that’s what the ‘enable vsys hold’ business is about).

I haven’t had much time to play with wireless on Inky Frame yet, but try commenting out the last time.sleep in the news example if you’re running on battery? I think that’s there to stop the feed constantly refreshing if connected via USB but I suspect it might be interfering with either going to sleep or waking up…

1 Like

Oh that’s cracked it. Now it sleeps for 5 mins (well 255 seconds) and auto refreshes or I can push the buttons to wake it up early. Now I just need to add my Calendar and a few other screens and I’m all set.

Many thanks.

1 Like

For an inky frame, is there a way to determine

  1. if it’s being battery powered?
  2. what the battery level is?
  3. if battery is close to being too low to function?

I think you should just be able to read the system voltage like you would be able to on a normal Pico - we could do with an example showing that. I’ll try and whip one up when I get a moment!

1 Like

@kjw Try this! Inky Frame battery example · GitHub

I’m not sure if there’s a way of checking if it’s plugged into USB power or not (other than checking if vsys is reading out of battery range), I’ll let you know if I figure it out

Now updated to read vbat to identify if it’s got USB power
(this didn’t seem to work so well for me when run through Thonny, wondering if my computer’s USB voltage is on the low side)