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: 2633
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: 897
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: 5027
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: 14968
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: 2826
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

aylashiv
Posts: 4
Joined: Thu Feb 27, 2020 5:39 am

Re: Raspberry Pi 4 - Sleep Mode

Fri Mar 27, 2020 6:58 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.
Hi, can you suggest me alternative to Raspberry pi, for the reason of Power Hungry, which you were using in your use case.

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

Re: Raspberry Pi 4 - Sleep Mode

Fri Mar 27, 2020 4:44 pm

aylashiv wrote:
Fri Mar 27, 2020 6:58 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.
Hi, can you suggest me alternative to Raspberry pi, for the reason of Power Hungry, which you were using in your use case.
There are workarounds that--basically--involve using an MCU (Arduino is one such) that shut down the power to the Pi and then go to sleep itself with various possible wake up conditions. Bit of a kludge, but that's the way it goes.

kkolehma
Posts: 1
Joined: Sun Jun 03, 2018 2:27 pm

Re: Raspberry Pi 4 - Sleep Mode

Fri Apr 03, 2020 10:54 am

I am also interested of this topic on an account of planning IoT gateway for my sailboat which obviously is not grid connected and power management is important for that reason.

Ages back I did some work with DVFS and power management on OMAP2420 SoC and on that the power management was relatively robust. Of course it was also Symbian OS which was purpose designed for battery powered devices. Can it really be so that there are no sleep states in BCM2711B0 processor? Google fails me to find any technical documentation on the processor. Does anyone know if it same processor is being used in any mobile device?

2.3W Idle power consumption is a bit high. It would use about 3% of projected 400W solar panel output on a sunny July day... With even half decent sleep functionality if should be possible to cut that consumption significantly.

trejan
Posts: 3593
Joined: Tue Jul 02, 2019 2:28 pm

Re: Raspberry Pi 4 - Sleep Mode

Fri Apr 03, 2020 12:16 pm

kkolehma wrote:
Fri Apr 03, 2020 10:54 am
Can it really be so that there are no sleep states in BCM2711B0 processor? Google fails me to find any technical documentation on the processor. Does anyone know if it same processor is being used in any mobile device?
BCM2711 is only used in the Pi. The closely related BCM7211 is meant for media players. Neither are designed for low power mobile usage.

There is no public documentation beyond the preliminary datasheet which is mainly referring to the peripherals. A full datasheet going into all of the intricate details you're looking for isn't going to be released so don't hold your breath for that one.

emma1997
Posts: 1598
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Raspberry Pi 4 - Sleep Mode

Fri Apr 03, 2020 7:13 pm

kkolehma wrote:
Fri Apr 03, 2020 10:54 am
2.3W Idle power consumption is a bit high. It would use about 3% of projected 400W solar panel output on a sunny July day... With even half decent sleep functionality if should be possible to cut that consumption significantly.
There is a major difference between Idle, Sleep, and Halt. As mentioned in 1st reply in this thread actual consumption of Pi4 when shutdown is about .015watts (.003x5). Quite reasonable for most solar or battery applications. I found in many respects Pi4 can be significantly lower power than previous models for this.

Not reasonable to expect microwatt draw while running OS like Linux. Arduino can't do it and neither can Pi. It is possible to 'sleep' at even nanowatt level but needs a couple penny logic gates with MOSFET or, to get real fancy, an MCU controlling enable pin of DC-DC converter. I've tried both methods:

https://www.raspberrypi.org/forums/view ... 8#p1550408

Image

With a similar setup several Pi have been in continuous operation at remote locations now since 2016 using relatively small panels. Pi4 has reduced the requirement even more with expected unattended run times years instead of weeks.

glum
Posts: 37
Joined: Wed May 16, 2018 11:27 am

Re: Raspberry Pi 4 - Sleep Mode

Tue Jul 07, 2020 10:21 pm

jdb wrote:
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.
Has something changed in a year, or do I just misunderstand this answer?

1. `sudo poweroff` => 3 mA power consumption ?

2. `sudo poweroff` => shuts down the PMIC ?

From what I can see on my system, neither of these statements appear to be accurate. What am I missing?

---
$ grep Revision /proc/cpuinfo
Revision : b03111
$ uname -a
Linux raspberrypi4b 4.19.118-v7l+ #1311 SMP Mon Apr 27 14:26:42 BST 2020 armv7l GNU/Linux

musicman0929
Posts: 1
Joined: Tue Sep 22, 2020 9:49 pm

Re: Raspberry Pi 4 - Sleep Mode

Tue Sep 22, 2020 10:15 pm

This reply is over 1 year after the initial post; however, I think it may apply. If not, please forgive this newbie and gently set me straight.

In the 1st reply to this post ( viewtopic.php?t=243421#p1484347 ), jdb indicated that "sudo poweroff", ". . . reduces power consumption to about 3mA". I realize that revisions to Pi 4B may have been implemented since this time, and the 3mA state may have changed a little, but I am finding poweroff current to be 10X higher at ~ 31mA.

In the Jul. 15 2019 post viewtopic.php?f=63&t=244165&p=1500943#p1500943, a value of ~ 30mA is also found and shown.

Q: Is it possible to get 3mA "poweroff" standby current with newer (early 2020) Pi 4B? If yes, please gently point me to the process?

BTW, I am aware of "sudo shutdown -h now" and I still get ~ 31mA current . . . as might be expected.

many thanks

hippy
Posts: 10554
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Raspberry Pi 4 - Sleep Mode

Wed Sep 23, 2020 9:02 am

I have never got to grips with the variety of 'shutdown' functions but there's an option to shutdown the 4B's PMIC entirely or leave it running so the Pi can be rebooted with a push button on GPIO. The first draws less power because it doesn't need to provide power to detect the push.

That's what I'd investigate. I think the option which affects this is in the Boot Eeprom Configuration.

sup
Posts: 24
Joined: Thu Oct 29, 2020 12:23 pm

Re: Raspberry Pi 4 - Sleep Mode

Thu Oct 29, 2020 12:28 pm

emma1997 wrote:
Fri Apr 03, 2020 7:13 pm
kkolehma wrote:
Fri Apr 03, 2020 10:54 am
2.3W Idle power consumption is a bit high. It would use about 3% of projected 400W solar panel output on a sunny July day... With even half decent sleep functionality if should be possible to cut that consumption significantly.
There is a major difference between Idle, Sleep, and Halt. As mentioned in 1st reply in this thread actual consumption of Pi4 when shutdown is about .015watts (.003x5). Quite reasonable for most solar or battery applications. I found in many respects Pi4 can be significantly lower power than previous models for this.

Not reasonable to expect microwatt draw while running OS like Linux. Arduino can't do it and neither can Pi. It is possible to 'sleep' at even nanowatt level but needs a couple penny logic gates with MOSFET or, to get real fancy, an MCU controlling enable pin of DC-DC converter. I've tried both methods:

viewtopic.php?f=63&t=252999&p=1550408#p1550408

Image

With a similar setup several Pi have been in continuous operation at remote locations now since 2016 using relatively small panels. Pi4 has reduced the requirement even more with expected unattended run times years instead of weeks.
Isn't there some standartized way of doing this (and buyng the necessary extension for Pi)? The only thing I found is this: https://spellfoundry.com/product/sleepy-pi/

which is as expensive as the Pi and not wholly compatible with Po 4 (due to USB C). I would only need a way to turn the Pi off and on remotely (ideally via wifi, if that can be low power enough).

emma1997
Posts: 1598
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Raspberry Pi 4 - Sleep Mode

Thu Oct 29, 2020 10:20 pm

There's no real standard because there as many ways to do it as snowflakes. You can buy 'hats' but expect to pay 10x or 100x more than DIY. To turn a Pi on/off safely from remote location an Arduino or ESP can be use which will cost about $5 depending on model and source.

Being Cheapest Person In The World I like to use just the Arduino chips (m8) like in my photo with total cost pennies instead of dollars. These can be hooked up directly to a Pi GPIO that is being powered over USB or double duty tacked onto a DC converter as shown. Otherwise if you only want plug-n-play cost can get up to hundred dollars. Depends on how good a shopper and whether or not you are willing to climb the learning curve and get your hands dirty.

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

Re: Raspberry Pi 4 - Sleep Mode

Fri Oct 30, 2020 3:58 am

For those wanting a wake from low power, note that the CM4IO board has an RTC wired to the global_en pin that tim236 mentioned last year. Just combine the CM4IO with your favorite CM4 and it should--if I'm reading various threads correctly--do what people are asking for.

sup
Posts: 24
Joined: Thu Oct 29, 2020 12:23 pm

Re: Raspberry Pi 4 - Sleep Mode

Sat Oct 31, 2020 9:55 am

I do not mind getting dirty, I do not get one thing though. How do you communicate with the arduino from a remote location? So far I managed to google mainly solutions vased on IR. But that is aplicable only inside. Do you use some kind of radio? And what device do you use to emit the signal?

emma1997
Posts: 1598
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Raspberry Pi 4 - Sleep Mode

Mon Nov 02, 2020 10:54 pm

As you notice the one in my photo is IR with about 100' range in a dark room.

For longer range (up to few miles) I unplug the IR sensor and plug in a HC12 radio transceiver. $3-$4 on Ebay and almost no programming because they have simple serial interface instead of nasty I2C/SPI. Another advantage over the very popular NRF2401 modules is about 40x the range. Yet only a bit more cost.

Range? 433mhz vs 2.4ghz... no contest.

For world wide coverage an ESP module with built-in wifi to replace that whole Arduino circuit. $2-$3 and for simply power up and down, coding not to bad using the Arduino IDE, lua, or micropython. Drawback... gotta have a router or hotspot nearby.

I have also used the ring from a cell or landline to control power. Needs a mic and better not make any other noise around there.

All the above can be used to fully power down, not just halt, by connecting to the DC converter enable pin. Virtually zero power drain from battery yet fully compliant with safe shut-down.

BTW soldering don't really get your hands THAT dirty. Not unless you get too 'intimate' with the spool or use fingers instead of old rag to keep tip clean. lol

User avatar
kamakela
Posts: 2
Joined: Sat Feb 20, 2021 8:05 pm

Re: Raspberry Pi 4 - Sleep Mode

Sat Feb 20, 2021 8:16 pm

glum wrote:
Tue Jul 07, 2020 10:21 pm
1. `sudo poweroff` => 3 mA power consumption ?
2. `sudo poweroff` => shuts down the PMIC ?
From what I can see on my system, neither of these statements appear to be accurate. What am I missing?

I see the same.

Based on the information about relatively low power consumption when "poweroffed", I bought yesterday a Pi 4B. However, it seems to consume roughly one watt of power after "sudo poweroff".

I do not yet have a good way to measure USB-C current but will do it as soon as I can.

But already based on the approximate consumption, what is now the real truth? Why have some of us got down to low levels? For me even 30 milliamps would be low enough, it would be 150 mW which is (just) tolerable. But 1000 mW is not.

What's wrong?

wh7qq
Posts: 1572
Joined: Thu Oct 09, 2014 2:50 am

Re: Raspberry Pi 4 - Sleep Mode

Sun Feb 21, 2021 7:53 pm

There is a relatively cheap alternative that covers all the requirements, plus: http://www.uugear.com/product/witty-pi- ... pberry-pi/ I have used the earlier versions and they work as advertised.

glum
Posts: 37
Joined: Wed May 16, 2018 11:27 am

Re: Raspberry Pi 4 - Sleep Mode

Tue Feb 23, 2021 6:41 am

wh7qq wrote:
Sun Feb 21, 2021 7:53 pm
There is a relatively cheap alternative that covers all the requirements, plus: http://www.uugear.com/product/witty-pi- ... pberry-pi/ I have used the earlier versions and they work as advertised.
What requirements are you referring to? What I'm referring to is the claim of 3 mA - which is, apparently - simply inaccurate. If we can't get facts - or at least a correction from those with the "Raspberry Pi Forum Mpderator/Engineer", the credibility of this forum is significantly diminished.

And no 3rd party solutions are needed AFAIK - the facts are all we need.

Return to “General discussion”