reify
Posts: 1
Joined: Mon Jun 24, 2019 2:36 pm

Raspberry Pi 4 - Sleep Mode

Mon Jun 24, 2019 2:41 pm

Congratulations on the wonderful announcement!
I have to admit, my first question is rather specific and is related to power management. Does the Raspberry Pi 4 have a sleep mode or some other means of entering into a low power usage state? I cannot seem to find much information as the news is so fresh.

This obviously is very critical for any battery-focused use case.

Thanks so much and congratulations again!
Last edited by reify on Mon Jun 24, 2019 8:32 pm, edited 1 time in total.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Raspberry Pi 4 - Sleep Mode

Mon Jun 24, 2019 2:51 pm

"sudo poweroff" will shut down the PMIC at the conclusion of the shutdown sequence. This reduces power consumption to about 3mA but requires pulling GLOBAL_EN low (or cycling input power) to wake the PMIC up.

There's user-modifiable EEPROM setting to change this behaviour (halt instead of poweroff, allows GPIO pin wake) but these are currently deliberately undocumented until we have a reliable, scripted way to change these.
Rockets are loud.
https://astro-pi.org

voronwae
Posts: 2
Joined: Tue Jun 25, 2019 4:51 am

Re: Raspberry Pi 4 - Sleep Mode

Tue Jun 25, 2019 5:01 am

I had the same question. Just to be clear, are you saying that there is still no sleep mode for the Pi 4?

Lack of a true sleep mode is what's prevented me from using a Pi for several applications over the last couple of years - it pretty much prevents battery-powered apps. Is there some endemic feature that would be broken by adding a true deep sleep mode, one that doesn't require shutdown or halt? Is the Pi just always going to be that way?

Many thanks. I appreciate how much work you guys must have put into this whole endeavor.

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 152
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi 4 - Sleep Mode

Tue Jun 25, 2019 10:10 am

voronwae wrote:
Tue Jun 25, 2019 5:01 am
I had the same question. Just to be clear, are you saying that there is still no sleep mode for the Pi 4?

Lack of a true sleep mode is what's prevented me from using a Pi for several applications over the last couple of years - it pretty much prevents battery-powered apps. Is there some endemic feature that would be broken by adding a true deep sleep mode, one that doesn't require shutdown or halt? Is the Pi just always going to be that way?

Many thanks. I appreciate how much work you guys must have put into this whole endeavor.
For battery powered applications on a Pi4 it is possible to 'halt' to go into the very low power state. To wake up pull global_en e.g. a HAT with an RTC or some other event. To make things even better use buildroot (*) or similar to make the kernel boot as fast as possible and avoid running any background services.

This approach is considerably simpler than suspend to RAM or paging everything to SD so I think it's a reasonably approach so long as the wake up frequency isn't too high.

(*) Buildroot recipes are pretty similar to Pi3 so these should appear soon although not directly supported by Raspberry Pi.

voronwae
Posts: 2
Joined: Tue Jun 25, 2019 4:51 am

Re: Raspberry Pi 4 - Sleep Mode

Wed Jun 26, 2019 1:10 am

timg236 wrote:
voronwae wrote:
Tue Jun 25, 2019 5:01 am
I had the same question. Just to be clear, are you saying that there is still no sleep mode for the Pi 4?

Lack of a true sleep mode is what's prevented me from using a Pi for several applications over the last couple of years - it pretty much prevents battery-powered apps. Is there some endemic feature that would be broken by adding a true deep sleep mode, one that doesn't require shutdown or halt? Is the Pi just always going to be that way?

Many thanks. I appreciate how much work you guys must have put into this whole endeavor.
For battery powered applications on a Pi4 it is possible to 'halt' to go into the very low power state. To wake up pull global_en e.g. a HAT with an RTC or some other event. To make things even better use buildroot (*) or similar to make the kernel boot as fast as possible and avoid running any background services.

This approach is considerably simpler than suspend to RAM or paging everything to SD so I think it's a reasonably approach so long as the wake up frequency isn't too high.

(*) Buildroot recipes are pretty similar to Pi3 so these should appear soon although not directly supported by Raspberry Pi.
Thanks for your reply.

The lack of a true sleep mode makes it fairly impossible to run a script that wakes up, does something, and goes back to sleep, say, every few minutes. That's a very common application, and rebooting on wake-up is basically the same as having a separate process running on another processor power the Pi on every few minutes. If you have a separate processor powering on the Pi every few minutes, you might as well skip the Pi...

A few years ago I chose the Edison over the Pi for this reason, despite the fact that the Pi was cheaper, better supported and had a much better version of Linux. The one huge advantage that the Edison had over the Pi was that the Edison could wake up and do something and the Pi couldn't. That meant that the Edison could run for a week on a small lithium battery, whereas the Pi needed something more like a large gel cell. And that meant that the Edison was portable, whereas the Pi was not.

Unfortunately, Intel's CEO stepped down, a new one stepped in, and the Edison was suddenly gone. The Pi 4 is small, and capable, but it still doesn't know how to go to sleep? Please forgive my ignorance, but is there a specific architectural feature that prevents all generations of Pi from having a sleep mode?

Or is the decision to leave out the RTC just a cost or real estate trade that always goes the same way with each new generation? It seems like RTCs can be extremely small, but maybe a battery or capacitor is the deciding factor.

User avatar
Douglas6
Posts: 4738
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Raspberry Pi 4 - Sleep Mode

Wed Jun 26, 2019 1:28 am

You seem to conflate the purposes of the Pi with your own purposes. By all means, look at alternatives. The Pi is not intended to replace the Edison. It's your responsibility to find a replacement.

W. H. Heydt
Posts: 10745
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Raspberry Pi 4 - Sleep Mode

Wed Jun 26, 2019 1:51 am

voronwae wrote:
Wed Jun 26, 2019 1:10 am
The Pi 4 is small, and capable, but it still doesn't know how to go to sleep? Please forgive my ignorance, but is there a specific architectural feature that prevents all generations of Pi from having a sleep mode?

Or is the decision to leave out the RTC just a cost or real estate trade that always goes the same way with each new generation? It seems like RTCs can be extremely small, but maybe a battery or capacitor is the deciding factor.
There are several reasons, so far as I know. One is PCB "real estate". Where could an RTC and a battery be put on the board without interfering with other parts or traces? It is also a matter of cost. A *lot* things have been left off of Pis in order to hit the desired price point. For instance, something more generally useful than an RTC would be a power switch. The Pis don't have one. Then there is this consideration: How many people actually need an RTC on a Pi? Especially an RTC that can be programmed to wake it up?

If you really need that functionality, you have three basic choices. The first is to use some other board that has what you want. Find some form of add-on hardware that has what you want (RTC modules are common and cheap, the "wake up" function maybe not so much). Design your own add-on (perhaps to the HAT specification) that supports what you want to do.

mikerr
Posts: 2774
Joined: Thu Jan 12, 2012 12:46 pm
Location: UK
Contact: Website

Re: Raspberry Pi 4 - Sleep Mode

Wed Jun 26, 2019 9:52 am

Other Pi models continue to draw a high ~100mA in shutdown/halt.

There is a minor mod to the 3B+ to get 11mA in shutdown state
https://www.raspberrypi.org/forums/view ... 9#p1286828
but that doesn't work on the 4B

The 4B by default shuts down to a decent 20mA draw

When the 4B is in this halt (at 20mA) it can be rebooted by bringing GLOBAL_EN low
- I successfully did this with a 1k resistor to gnd - but I doubt anything else is awake to do that via GPIO
Android app - Raspi Card Imager - download and image SD cards - No PC required !

Normen
Posts: 1
Joined: Tue Aug 27, 2019 7:44 pm

Re: Raspberry Pi 4 - Sleep Mode

Tue Aug 27, 2019 7:50 pm

I noticed something funny
I use the current libreelec-image
When i shutdown the 4b over ssh it still takes about 500mA - when not connected via hdmi
When i plug it into a tv and shut it down it goes to nearly 0mA

Is there a way to get rid of this?
Kind regards
Normen

Return to “General discussion”