User avatar
bensimmo
Posts: 3190
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Why not a low power Raspberry?

Sat Mar 17, 2018 11:17 am

From someone who sees kids make camera bird boxes etc.
They don't care about power or how fast it boots (the Pi3 is faster than mobile devices from an off, even faster if if SD card is set to 100 from 50, something I always have set.)
But hey ho.
Zero is slow but MotionEyeOS doesn't take too long to boot, but then it's going to be an always on device otherwise it'll see nothing and you just stick a big battery next to it.
You adapt and teach what power is needed and to spec for that and how to try and work it out.
Yes look into turning parts of the Pi off you may not need.

The IR LEDs for a bird box or animal watcher take more current out the the battery or PSU than the Pi does.
So much for a nice wildlife watcher it makes a Pi Zero get extremely hot as all the current passes through it via a camera cable on certain setups.

Android/iOS has a high investment behind them Google/Apple and then with Google all the open source people typing and moaning away to change things.
Compared to a few prople in a room selling £5to£35 computers and not £1000 mobile phones.

It would be really nice is there was a Education Lesson or two on power saving techniques or work out your battery, but someone has to write it.


As for the microbit (somebody mentioned it) it has a lot of resources now, controlling robots, being a game controller, step counter, datalogger for sensors, add all the usual sensors and things you can attach to them, GPS 1-wire blah blah blah.
It's come a long way for what is a simple device.
Though it does work best with a Tablet/Phone or *Pi*/PC to work with it.


Anyway, time to get off the bog and grab a coffee ;-)


Oh and VC4 is Nokia and early Samsung phones as well as the first FireTV (one sat next to my TV)

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

Re: Why not a low power Raspberry?

Sat Mar 17, 2018 1:00 pm

fanoush wrote:
Fri Mar 16, 2018 10:35 pm
The point was that power management is useful and basic computer feature in this century and it is worth teaching kids this basic concept they see everywhere around them.
The Pi does have power management. Just not to the extent that other products have it.

In battery powered products good power management is essential. But the Pi was never designed nor intended for battery powered use. That a Pi can be used in some battery powered roles is more good fortune than by design or intent.

It is fair enough if you think a Pi should have better power management, and I don't think you are trolling on that. But one also has to accept that the goals of the RPT and RPF are different to what you, me or anyone might like them to be, and it's not in their remit to deliver something which suits all needs.

Good power management may be at the top of your "needed, wanted, would like" list but that isn't the case for everyone.

The Pi meets an incredible number of needs - hence the huge quantity sold - but it will unlikely ever meet all needs. Maybe a future Pi 4 or later version will have better power management, but for now it is what it is. I am quite sure the RPT have heard the call for better power management. I am also sure they would have delivered that if it were easy to do so with what they currently have.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why not a low power Raspberry?

Sat Mar 17, 2018 1:54 pm

fanoush wrote:
Fri Mar 16, 2018 10:35 pm
jamesh wrote:
Fri Mar 16, 2018 4:34 pm
As I said above, the problem is that the SoC really isn't suited to low power requirements. So how do people propose getting round that?
Over years the Raspberry foundation and Broadcom people involved were constantly pulling amazing rabbits out of hats (BCM2836, then BCM2837, Pi Zero - several board revisions ended by adding camera, then the 0W, now the 3B+) but none of those great achievements were related to power management. Also in software lot of amazing stuff was done - the stuff around camera, DSI display or porting stuff to ARM side done by Eric Anholt. Also I suppose Broadcom has chips based on VC4 used in mobile phones so probably some such chip could be used as base for some Pi model. And still after 6 years the power management state is same as on the beginning. So either power management stuff is much harder than anything mentioned above and/or it cannot be done for target price point or it was not seriously considered to be important enough. So "the problem is that the SoC really isn't suited to low power requirements" is not the real problem. It is just a result.

Anyway I am not forcing my opinions on anyone and I am not trolling. When reading other replies I see people get quite easily offended by different opinions and tend to defend strongly something they like and quickly counter-attack while missing the point completely so I guess it is pointless to continue. And I can assure everyone I really did not miss all the success of Raspberry Pi, that's not the point at all :-)

The point was that power management is useful and basic computer feature in this century and it is worth teaching kids this basic concept they see everywhere around them.

Today it is almost a norm to give tablet or smartphone to even younger kids than those being targeted by Raspberry Foundation. And even the real boring computer that only grown ups use today mostly means laptop. So the most natural computer to kids of today have battery and power management as a basic feature. So teaching them that you need to fully boot computer up and then shut it down to solve a problem (like making a photo with camera) when they quite often have a computer in a pocket which is ready to do it in a second (i.e a phone) is a bit outdated today. So this is not about Arduino or ESP32 at all. It is about teaching modern concepts of how computers work today.
Power management is just low level software. Teaching it is irrelevant and claiming its required for teaching, is a strawman.

The Pi can teach you EVERYTHING you need to know about programing. Then if you get a job where you need to know about power management, your programing experience in other subjects will help learn that pretty quickly.

BTW, there are very few power management specific jobs. Lots of embedded engineering jobs though, which might have power management as a tiny subset.


What you are really asking for is better power management on the Pi, so YOU can do more projects. Don't bring education into it, its irrelevant.

And yes, better power management would enable more projects, would be great to have. But the amount of time and pain it would take to do it is huge. The benefits simply do not outweigh the disadvantage.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

User avatar
rpdom
Posts: 12801
Joined: Sun May 06, 2012 5:17 am
Location: Ankh-Morpork

Re: Why not a low power Raspberry?

Sat Mar 17, 2018 7:51 pm

fanoush wrote:
Fri Mar 16, 2018 10:35 pm
[It is about teaching modern concepts of how computers work today.
My day job is Linux Sysadmin. I run dedicated servers. I can (and in some cases have done) duplicate (on a smaller scale) almost everything that I do for "real" on a Raspberry Pi. The same software is available. How is that not "modern concepts of how computers work today"?

I'm even looking at creating a working scale model of our entire company structure using just Pis (obviously without any live customer data).

fanoush
Posts: 364
Joined: Mon Feb 27, 2012 2:37 pm

Re: Why not a low power Raspberry?

Sun Mar 18, 2018 9:48 pm

jamesh wrote:
Sat Mar 17, 2018 1:54 pm
Power management is just low level software. Teaching it is irrelevant and claiming its required for teaching, is a strawman.
Not sure we are talking about same thing. I did not mean low level software at all. And I did not claim it is required. Power efficiency is just one aspect of writing good application code running on battery powered device. As for importance I find it similar to e.g. learning multithreading to use more CPU cores effectively or memory management - using memory efficiently. All of them are not the first ones to learn and you can go quite far without even touching them. But at some point one should learn about them.
jamesh wrote:
Sat Mar 17, 2018 1:54 pm
Then if you get a job where you need to know about power management, your programing experience in other subjects will help learn that pretty quickly. BTW, there are very few power management specific jobs. Lots of embedded engineering jobs though, which might have power management as a tiny subset.
This must be some misunderstanding. Who do you think wrote all those millions mobile apps in Apple and Google store? And if you use smart phone today and use some apps you may agree that battery drain caused by bad apps is annoying in same way as memory bloat or apps being slow. Well, so much for learning those concepts pretty quickly from experience in other subjects :-) Also it is quite likely kids learning programming today will get job writing code that will run on some type of mobile device tomorrow. So I really don't understand how can you dismiss it so quickly and call all that irrelevant and tiny subset where is almost nothing to teach or learn.

Anyway, I understand this is not top priority for the Pi. On the other hand it should not be completely ignored (as it mostly is now) so I think it is worth reminding this at least every six years :-)
jamesh wrote:
Sat Mar 17, 2018 1:54 pm
What you are really asking for is better power management on the Pi, so YOU can do more projects. Don't bring education into it, its irrelevant.
Well, frankly, no. I am asking for it so kids or anyone else could do more projects and I find it highly educational for them to do so.

Personally I don't need it. Over years I accumulated plenty of hackable hardware with good power management. While I started with C64 as a kid and later Amiga, I then discovered Palm Vx and was hooked even more. Because better than having your own hackable _home_ computer is having also hackable computer you always have in your pocket :-) Then I went through Palm M500, T2, T3 then run Familiar Linux on iPaq and then moved to Maemo devices (770,N800, N810,N900), also I got Zipit Z2 and Open Pandora. As for more bulky devices I got V3 e-reader running OpenInkpot (Linux), OLPC XO laptop, Nook Simple Touch e-reader, Nook Color, HD, HD+ (running Cyanogen, LineageOS or AOSP Android) and couple of Android phones with custom ROMs. So except first PalmOS devices all of them run Linux (or Android) and are very hackable and have good power management and still have almost all of them. And in lot of those communities I found people with same goal - having hackable and programmable computer in your pocket. I've met people regularly coding (sometimes quite complex) apps directly on the device in a bus or train or anywhere else. Sometimes even because they didn't have normal computer.

With such experience it can be understood that I see what is already possible with Linux power management for many years. Nevertheless I find Raspberry Pi pretty amazing too. And we can end this conversation at that :-)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 9:58 am

So, do application writers really have to write power management in to their apps?

Does it entail reading the registers on power down from an attached device, storing them somewhere, and restoring them on startup whilst ensuring that everything still works? Not a trivial task for most HW.

Does it involve detecting when a silicon block is not being used, and powering it down safely?

That sort of thing is real mans power management.

It's not done at the app level - that's to do with saving application state and is much simpler, and easily done on the Pi even now.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

fanoush
Posts: 364
Joined: Mon Feb 27, 2012 2:37 pm

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 2:18 pm

Well I guess there are two things mixed. My suggestion was to equip raspberry with power management. This must be done by engineers as you describe. And then once there is such feature available, programmers can write apps that are power efficient or are at least using it to its advantage. I did not suggest to teach kids how to implement power management in a linux driver and twiddle hardware bits. I reread what I wrote and maybe this one specific sentence was confusing
The point was that power management is useful and basic computer feature in this century and it is worth teaching kids this basic concept they see everywhere around them.
By that I meant that it is useful to teach kids programming so they are aware of this concept (that system can sleep, can save power and is mostly never really off and can run from limited battery). I guess it was clear from everything else I have written.

Curently Pi works like desktop PC (or server). You boot it up, it draws significant power and cannot sleep so when on battery it won't last long (few hours maybe) and then you need to shutdown or it simply dies because you even don't know battery state. The phone in your pocket works in different way. And PC sales are not that great anymore and phones are sold in billions https://www.marketwatch.com/story/one-c ... 2016-04-20.
jamesh wrote:
Mon Mar 19, 2018 9:58 am
So, do application writers really have to write power management in to their apps?
In an app you don't poke register bits but you are trying to be power efficient so you do similar stuff on high level like you do on low level, by e.g. sleeping as much as possible and not doing busy loops, structure app to e.g. background services and foreground, acquire/release resources only when needed, group activities so you don't wake device often, listen to various events like network up/down, screen off, low battery or charging so you can start/stop doing stuff at right time .... So I guess the answer to your question is yes, they have to. In Android if you e.g. poll GPS location in your app continuously or hold other locks even when user switches to different app or turns off the screen, battery dies very quickly.
Last edited by fanoush on Mon Mar 19, 2018 2:34 pm, edited 1 time in total.

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

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 2:32 pm

fanoush wrote:
Mon Mar 19, 2018 2:18 pm
jamesh wrote:
Mon Mar 19, 2018 9:58 am
So, do application writers really have to write power management in to their apps?
In an app you don't poke register bits but you are trying to be power efficient so you do similar stuff on high level like you do on low level, by e.g. sleeping as much as possible and not doing busy loops, structure app to e.g. background services and foreground, acquire/release resources only when needed, group activities so you don't wake device often, listen to various events like network up/down, screen off, low battery or charging so you can start/stop doing stuff at right time .... So I guess the answer to your question is yes, they have to. In Android if you e.g. poll GPS location in your app continuously or hold other locks even when user switches to different app of turns off the screen, battery dies very quickly.
All of which amounts to....teach good coding practices, which has virtually nothing to do specifically with power management.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 3:53 pm

W. H. Heydt wrote:
Mon Mar 19, 2018 2:32 pm
fanoush wrote:
Mon Mar 19, 2018 2:18 pm
jamesh wrote:
Mon Mar 19, 2018 9:58 am
So, do application writers really have to write power management in to their apps?
In an app you don't poke register bits but you are trying to be power efficient so you do similar stuff on high level like you do on low level, by e.g. sleeping as much as possible and not doing busy loops, structure app to e.g. background services and foreground, acquire/release resources only when needed, group activities so you don't wake device often, listen to various events like network up/down, screen off, low battery or charging so you can start/stop doing stuff at right time .... So I guess the answer to your question is yes, they have to. In Android if you e.g. poll GPS location in your app continuously or hold other locks even when user switches to different app of turns off the screen, battery dies very quickly.
All of which amounts to....teach good coding practices, which has virtually nothing to do specifically with power management.
Quite. I've been doing all that for years - nothing to do with power management (not had much to do with it), all to do with writing decent code.

And it still entirely possible to teach that on a Pi as it stands.


As for the underlying actual power management, that is a can of worms which is why we have never implemented it. Huge amount of work and will almost certainly slow everything down.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

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

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 4:36 pm

jamesh wrote:
Mon Mar 19, 2018 3:53 pm
W. H. Heydt wrote:
Mon Mar 19, 2018 2:32 pm
fanoush wrote:
Mon Mar 19, 2018 2:18 pm

In an app you don't poke register bits but you are trying to be power efficient so you do similar stuff on high level like you do on low level, by e.g. sleeping as much as possible and not doing busy loops, structure app to e.g. background services and foreground, acquire/release resources only when needed, group activities so you don't wake device often, listen to various events like network up/down, screen off, low battery or charging so you can start/stop doing stuff at right time .... So I guess the answer to your question is yes, they have to. In Android if you e.g. poll GPS location in your app continuously or hold other locks even when user switches to different app of turns off the screen, battery dies very quickly.
All of which amounts to....teach good coding practices, which has virtually nothing to do specifically with power management.
Quite. I've been doing all that for years - nothing to do with power management (not had much to do with it), all to do with writing decent code.

And it still entirely possible to teach that on a Pi as it stands.


As for the underlying actual power management, that is a can of worms which is why we have never implemented it. Huge amount of work and will almost certainly slow everything down.
This whole thread kind of reminds me of when IBM first started providing mainframes with virtual memory systems (originally "DAT boxes"). Many programmers immediately reacted with "Oh, goody! No longer any need to keep programs small. No need to code for overlays. We can use all the memory we want with no limit!" I used to respond by pointing out that if one coded that way, performance of said programs would go through the floor and that there was a very important principle to keep in mind: Locality of reference. Lots of people had to learn the hard way by watching mainframes be driven to their knees by thrashing instead of thinking about the consequences of bad code. If anything, the advent of virtual memory meant that one should pay *more* attention to performance issues, not less.

Edit to add... It is a sobering thought that people who work with microcomputers (and SBCs now) seem to be profoundly ignorant of the lessons learned the hard way on mainframes that came before them. There seems to be a great deal of determination to repeat the mistakes of the past, rather than learning from them.

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

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 4:45 pm

W. H. Heydt wrote:
Mon Mar 19, 2018 2:32 pm
All of which amounts to....teach good coding practices, which has virtually nothing to do specifically with power management.
I would agree with that. Beyond, don't idle in tight loops for no good reason, use interrupts rather than polling, use event driven coding when possible, don't set timer wake-ups more frequently than are needed, don't keep peripherals or resources active when you don't need them active, sleep or suspend when you can, the actual power management will be something handled by the OS or whatever is managing code execution.

What the Pi does demonstrate is that, no matter how well app coding suits power management, if the hardware doesn't support low power modes; you won't have them, cannot use them.

I don't find that "embarrassing", either how it is or having to explain it for a Pi, as was suggested earlier. It is how it is and there are good reasons for why it is that way. There is no shame that a product doesn't work well in some roles it wasn't designed for, nothing to be embarrassed about.

One can still teach power management, good coding practice for power management, even if what you have doesn't support that. You might not be able to demonstrate it with a Pi but it can still be taught. You can of course demonstrate why not having low power modes is bad for some applications.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 4:52 pm

Its worth noting that the GPU itself had an AWFUL lot of engineering time thrown at it to improve its power management, because it's original place was in mobile devices. Its incorporated in to the HW and the SW. So its PM is automatic and pretty good.

IIRC (and this may not be entirely accurate) It's just when combined with the ARM cores that things get REALLY tricky. Sending the ARM to sleep when the VC4 isn't expecting it can cause problems, and ensuring the VC4 is ready at any time for a power down is what causes slowdowns. Basically it's keeping two completely separate processors knowledgeable about what the other is doing at all times, and the communications required to do that.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

paulslocum
Posts: 70
Joined: Sun Apr 09, 2017 10:54 pm

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 5:26 pm

I've developed professionally for years on both mobile and embedded platforms, and from a general software development perspective, dealing with "power management" is pretty much identical. The biggest difference is that on the Pi you're more worried about overheating and on the phone your'e more worried about battery drain, but ultimately it's the same causes and the same techniques to avoid the problems. The idea that the Pi is not a good education tool for power management because it doesn't have a low power mode is nonsense.

The reason many mobile apps are resource hogs is that people learn to develop on laptops which have relatively unlimited resources. In that regard the Pi is perfect for learning about power management and efficiency.

fanoush
Posts: 364
Joined: Mon Feb 27, 2012 2:37 pm

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 9:16 pm

paulslocum wrote:
Mon Mar 19, 2018 5:26 pm
I've developed professionally for years on both mobile and embedded platforms
....
The idea that the Pi is not a good education tool for power management because it doesn't have a low power mode is nonsense.
Well, technically as a professional software developer you are right. But where is the fun for kids in learning it, if they don't have immediate feedback and can see and feel the result properly? How do you make it exiting and worthwhile? What type of real project you suggest for them to try to learn it? Motivation and attention span is quite different between kid and paid professional developer.

Heater
Posts: 9821
Joined: Tue Jul 17, 2012 3:02 pm

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 10:03 pm

fanoush,
But where is the fun for kids in learning it, if they don't have immediate feedback and can see and feel the result properly? How do you make it exiting and worthwhile?
I appreciate your idea there but...

If your intention is to introduce a bunch of kids, like millions of then the world over, to computers and programming for the first time, which is the intention of the Pi project, then the subtleties of power management are not high on the agenda.

The Pi, it's operating systems and it's documentation do not address the ultra low power issue. Which seems quite reasonable to me.

fanoush
Posts: 364
Joined: Mon Feb 27, 2012 2:37 pm

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 10:14 pm

Heater wrote:
Mon Mar 19, 2018 10:03 pm
If your intention is to introduce a bunch of kids, like millions of then the world over, to computers and programming for the first time, which is the intention of the Pi project, then the subtleties of power management are not high on the agenda.
if your battery operated project lasts e.g. 7 days instead of 3 hours you surely notice. But when you make some Pi operated prank and battery dies before it can do something it is not so much fun. But that's just a subtlety I guess :-)

Heater
Posts: 9821
Joined: Tue Jul 17, 2012 3:02 pm

Re: Why not a low power Raspberry?

Mon Mar 19, 2018 10:51 pm

Yes, that is a subtlety.

When I was learning programming for the first time, getting an expression evaluating something was an eye opener, making a loop out of that to do greater things was mind bending. What did I know or care how many watts my program was consuming? What did it matter at that moment?

Sure, after that I might wonder about power consumption for battery powered projects and the like. That is advanced stuff.

The Pi is what it is. I think we are done with this debate.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 20446
Joined: Sat Jul 30, 2011 7:41 pm

Re: Why not a low power Raspberry?

Tue Mar 20, 2018 9:56 am

fanoush wrote:
Mon Mar 19, 2018 10:14 pm
Heater wrote:
Mon Mar 19, 2018 10:03 pm
If your intention is to introduce a bunch of kids, like millions of then the world over, to computers and programming for the first time, which is the intention of the Pi project, then the subtleties of power management are not high on the agenda.
if your battery operated project lasts e.g. 7 days instead of 3 hours you surely notice. But when you make some Pi operated prank and battery dies before it can do something it is not so much fun. But that's just a subtlety I guess :-)
Depends on the thing you are making - power management makes no difference if the device never sleeps anyway. And having a device that goes to sleep requires something to wake it up, more HW that isn't actually on the Pi board. Things like mobile devices are complicated power management chips that allow them to wake up. So doing it properly is a combination of HW and SW. Neither of which we have on the PI.

And neither of which affect the educational aspect at all.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.

paulslocum
Posts: 70
Joined: Sun Apr 09, 2017 10:54 pm

Re: Why not a low power Raspberry?

Tue Mar 20, 2018 1:13 pm

To me as a application developer, "power management" is primarily just about doing things like caching the results of CPU-intensive tasks. But on the Pi there are explicit ways to manage power, like putting the HDMI monitor to sleep or turning off wifi when not in use. Plenty of ways to incorporate "power management" into a Rasbperry Pi educational programming curriculum.

Return to “General discussion”

Who is online

Users browsing this forum: Bing [Bot], scotty101 and 74 guests