Shutdown time for RPi-3?

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
I have an embedded application for the RPi-3.  Unfortunately it's likely that
uses will remove power without properly shutting the RPi down.  Therefore I've
got a 'power-going-down' bit of hardware which sets a GPIO bit causing a proper
shutdown.  The question, of course, is how long does a shutdown take?  I'm  
trying to ensure that the flash program/OS memory does not get corrupted.  I've
got a lower bound on this time by running a program that toggles another GPIO bit,
and seeing when that stops vs. the time when I toggle the shutdown bit; but  
presumably other things could take more time.

Running the current Raspbian.

   TIA!
   -F

Re: Shutdown time for RPi-3?
On Fri, 14 Apr 2017 16:30:48 -0000 (UTC)

Quoted text here. Click to load it

    It depends - mostly on how fast the SD card is, how many dirty
buffers need to be flushed and how long processes take to die. Best bet is
to measure it under your worst case loads with the card you intend to use
and add a healthy safety factor.

--  
Steve O'Hara-Smith                          |   Directable Mirror Arrays
C:>WIN                                      | A better way to focus the sun
We've slightly trimmed the long signature. Click to see the full one.
Re: Shutdown time for RPi-3?
On 14/04/2017 20:25, Ahem A Rivet's Shot wrote:
Quoted text here. Click to load it

Also see if you can use Raspbian Lite and if that makes a significant  
difference (you probably don't use X anyway?).


Re: Shutdown time for RPi-3?
On Fri, 14 Apr 2017 19:25:11 +0100, Ahem A Rivet's Shot wrote:

Quoted text here. Click to load it

Ok, reframing :
  What's the easiest way to detect when shutdown is complete?

Thanks!
  -F

Re: Shutdown time for RPi-3?
On 14/04/2017 22:09, Frank Miles wrote:
Quoted text here. Click to load it

A GPIO pin state? Is it 14 or 15 that's reliably hi/lo depending on run  
state?

Re: Shutdown time for RPi-3?
On 4/14/2017 5:09 PM, A. Dumas wrote:
Quoted text here. Click to load it

If it's set by software, it's not reliable.  Since this is part of a  
power down circuit, why not measure the power consumption.  I'm pretty  
sure the numbers I've seen will make a clear distinction between running  
in a low power state and OFF.  Power measurement is not so hard.

--  

Rick C

Re: Shutdown time for RPi-3?
On Fri, 14 Apr 2017 17:19:33 -0400, rickman wrote:

Quoted text here. Click to load it

Hmmn, interesting idea.  I have a hall-effect current probe that would  
probably do the job.  Just have to hack the power connector.

Thanks ... seems like that should work!
  -F

Re: Shutdown time for RPi-3?
Quoted text here. Click to load it

Some boards use the serial Tx line. This is set low when shutdown is complete.


Other strategies are to minimise SD card writes during normal use, but we
don't know what the application is.. However stuff I do is things like
remove logging (like rsyslogd - no idea how to stop systemd writing to
SD card, I don't use it), mounting /tmp/ as ramdisk (see /etc/defaults/shm )
and generally tuning application to minimise writes, if possible.

Gordon

Re: Shutdown time for RPi-3?
On Sun, 16 Apr 2017 19:42:50 +0000, Gordon Henderson wrote:

Quoted text here. Click to load it

I'll take a look at that too once I get my tech to make me the power cable
with separable conductors needed for monitoring the current consumed.  I'm
also curious to see how much current the RPi consumes once it is shut-down
(since it reboots after some 10s or so it must be running, at a minimum, some
kind of timer/clock).

Quoted text here. Click to load it

It's running a GUI that controls a research instrument.  The only disk activity
is very infrequent, to save altered instrument configuration/settings.  At this  
point (the users may come up with changes in the future), there's no data  
logging.

Excellent idea to kill any syslog activities, etc., thanks!

    -F


Re: Shutdown time for RPi-3?
On 17/04/2017 17:45, Frank Miles wrote:
Quoted text here. Click to load it

Not significantly different. Power isn't switched like in ATX PC power  
supplies, would draw more than potential savings.


Re: Shutdown time for RPi-3? (some measurements)
On Mon, 17 Apr 2017 15:45:49 +0000, Frank Miles wrote:

Quoted text here. Click to load it

I've tried a few experiments to reduce the shutdown/poweroff demand, to little
effect.  These all used "poweroff" or equivalent while the power supply
actually remained on.

My test unit (connected to a 7" touch screen, powered separately) draws:
  ~ 350mA while idle (with or without X)
  ~ 500mA (avg) during the ~2sec it seems to take to shut down
  ~ 100mA after shutdown appears complete
The 2s of "extended current draw" occurs after the screen blanks,
which is nearly instantaneous - i.e. the screen blanking is  
misleadingly fast.

Preliminary attempts to quicken or reduce the magnitude of current
during shutdown - by not using X, or stopping rsyslog have been
completely ineffective.

The Tx line drops as suggested; at least it's coincident with the majority
of the current dropping from ~500mA to ~100mA (there's 0.4 to 0.5s of
75mA more after the Tx line drop - hopefully that's not more "disk"  
activity).

Yuck.  Probably gonna have to beef up my 5V supply's stored energy to
avoid system flash data corruption.  I may yet try a few things - there's  
lots of activity posted to syslog.

   -F

Site Timeline