Donations towards server fund so far this month.

 
£0.00 / £100.00 per month
Page:
Home > Show Us Yours! > A couple of new PCBs - but especially the RPi...

jbelanger

1267 Posts
Member #: 831
Post Whore

Montreal, Canada

Rod,

How do you deal with the power coming back up when you've started the shut down process? Regardless of what I've mentioned, I don't see how you address it in either.

One way I can see would be to have some sort of external watchdog that resets the RPi (and the initial 60 second timer) unless the RPi keeps it from doing so. If you have a time out for the watch dog longer than the initial 60 seconds you need for boot up, that would cover that possibility. The only problem is that you can now have a 60+ second of inactivity but it would not require any user input.

Jean

http://www.jbperf.com/


jbelanger

1267 Posts
Member #: 831
Post Whore

Montreal, Canada

Actually, there is one thing that I'm not sure about which would have an impact on the sequence of events. What happens during shutdown in this case? Is it simply the process of closing all applications and all open files to go in a safe state and wait for power to go off (or actively switch it off if that's the chosen solution)?

If it is that then it simplifies things a bit because the key on state can be checked before switching the power off and you can then reset the 60 second timer and either start TS or reboot entirely.

So you would have a power supply (connected directly to the battery) that is either activated by key on, a 60-second timer or the RPi. Once running the RPi activates the power supply and watches for the key state. Upon key off, it goes in the shutdown state and if the key is still off, it shuts down power. If key is back on, it resets the 60-second timer and restarts. (Actually, it can loop in the key on check process so if somehow the power is put back on just after checking the state it will just pick it up in the next iteration)

That means you need 3 I/Os from the RPi: an input for key on, an output for the power supply and an output for the timer reset. And you need a resettable timer circuit.

http://www.jbperf.com/


Rod S

User Avatar

5988 Posts
Member #: 2024
Formally Retired

Rural Suffolk

On 23rd Nov, 2012 jbelanger said:
Rod,

How do you deal with the power coming back up when you've started the shut down process? Regardless of what I've mentioned, I don't see how you address it in either.


Current thoughts/design is a latching gate to prevent powerup when a shutdown is running.


On 23rd Nov, 2012 jbelanger said:
One way I can see would be to have some sort of external watchdog that resets the RPi (and the initial 60 second timer) unless the RPi keeps it from doing so. If you have a time out for the watch dog longer than the initial 60 seconds you need for boot up, that would cover that possibility. The only problem is that you can now have a 60+ second of inactivity but it would not require any user input.


It's the 60s inactivity I'm determined to avoid.

Writing this in code is probably quite easy *happy*

Using simple logic chips or 555 timers or C/R networks etc is making my head hurt but I'm sure it's possible.....


I'm off to put my CD on... :)

Schrödinger's cat - so which one am I ???


Rod S

User Avatar

5988 Posts
Member #: 2024
Formally Retired

Rural Suffolk

and......

after many phone calls to UPS and Farnell the bits I paid for to be delivered today (to finish my MAP/MAF/EGT circuits) won't actually arrive until Monday)....

********s

Luckily my local pub is only three doors away.

Schrödinger's cat - so which one am I ???


Rod S

User Avatar

5988 Posts
Member #: 2024
Formally Retired

Rural Suffolk

On 23rd Nov, 2012 jbelanger said:
Actually, there is one thing that I'm not sure about which would have an impact on the sequence of events. What happens during shutdown in this case? Is it simply the process of closing all applications and all open files to go in a safe state and wait for power to go off (or actively switch it off if that's the chosen solution)?

If it is that then it simplifies things a bit because the key on state can be checked before switching the power off and you can then reset the 60 second timer and either start TS or reboot entirely.

So you would have a power supply (connected directly to the battery) that is either activated by key on, a 60-second timer or the RPi. Once running the RPi activates the power supply and watches for the key state. Upon key off, it goes in the shutdown state and if the key is still off, it shuts down power. If key is back on, it resets the 60-second timer and restarts. (Actually, it can loop in the key on check process so if somehow the power is put back on just after checking the state it will just pick it up in the next iteration)

That means you need 3 I/Os from the RPi: an input for key on, an output for the power supply and an output for the timer reset. And you need a resettable timer circuit.


Jean,

Didn't see that reply before my previous post.

We have plenty of I/Os from the RPi (so long as it hasn't lost power or crashed) it's just how best to use them.

Pub now.....

Schrödinger's cat - so which one am I ???


Graham T

User Avatar

608 Posts
Member #: 1106
Post Whore

Hungerford, Berks

I thought I had the logic sorted in my head until I read these last few posts, now I’m not so sure…

Anyway, The current OS I am playing with is Raspbian Hexxeh – Not the latest official Raspbian image from the Rpi foundation, but an image from back in May (ish).
In both the hardfloat and soft float “official” images, there are a lot applications that we do not need, so a lot of overhead on the already minimal system resources, hence I am avoiding them at the moment.

On the 256Mb Rpi we have a time of ~55 seconds from power on to TS displaying real time data. Overclocking only gains you about 3 seconds on the full start up routine.
Gauges are nice and smooth on maximum frame rate.
However to get this time the OS has been stripped right down to basics, which is not a good user experience because the whole thing requires command line to work in.
NO USB devices and no networking either ( they add 5 seconds to the overall boot time)
The OS boots in 14 seconds and the rest of the time is TS loading the project and the gauges.


I think I can cut the time down more by using the softfloat version of the OS which will let me use Oracles Java SE rather than openjdk. Apparently oracles JIT (just in time) processing is MUCH quicker than openjdk.


The 512Mb Rpi loads the same image in the same amount of time, so I do not think that RAM has been the bottle neck with speed. When TunerStudio is open and operating I’m left with over 300Mb RAM
I’m feeling my way through this but I think with the extra RAM I can allocate to the Graphics processor, the softfloat OS will be OK still to give a reasonably jitter free smooth display. I really don’t fully understand all of it yet and have not had time to test all the different configurations.



SD card corruption – as Rod says, we have only seen it once but this was down to me preforming a hard shutdown when I thought the Rpi had hung while writing files to the SD card. Luckily the system recovered on this occasion.



I’ve mostly proven the script which monitors the gpio input, to either shutdown or control gpio outputs, so I believe we could set outputs based on input values, hence use gpio’s for some of the logic.

’77 Clubman build thread
http://www.turbominis.co.uk/forums/index.php?p=vt&tid=618189

Siamese 5 port EFI testing
http://www.turbominis.co.uk/forums/index.php?p=vt&tid=611675


Brett

User Avatar

9502 Posts
Member #: 1023
Post Whore

Doncaster, South Yorkshire




On 23rd Nov, 2012 Graham T said:

The 512Mb Rpi loads the same image in the same amount of time, so I do not think that RAM has been the bottle neck with speed.

could the bottle neck be the SD card? reading them is usually quite quick but i notice one of mine is getting alot slower, it was getting hammered untill recently though

Yes i moved to the darkside *happy*

Instagram @jdm_brett


Graham T

User Avatar

608 Posts
Member #: 1106
Post Whore

Hungerford, Berks




On 23rd Nov, 2012 Brett said:


could the bottle neck be the SD card? reading them is usually quite quick but i notice one of mine is getting alot slower, it was getting hammered untill recently though


It could be, or at least contributing. I did test the SD card I/O speeds at one point, but cannot remember the results.

I've tried class 6, class 10 and even cheap no name SD cards but none have appeared to make much difference, if any.
What i did find though was that an 8Gb card seemed to slow down boot up. The swap file took a lot longer to activate in comparison to smaller cards.

Though with the latest Kernal for 512Mb support there maybe support for the faster I/O cards that there was not before. More testing to do...

’77 Clubman build thread
http://www.turbominis.co.uk/forums/index.php?p=vt&tid=618189

Siamese 5 port EFI testing
http://www.turbominis.co.uk/forums/index.php?p=vt&tid=611675


Carl S
Forum Mod

User Avatar

1927 Posts
Member #: 1761
Stalker

Bristol

Try a USB stick instead of the SD card, you can configure it to boot off them instead.

Some people claim substantial speed increases, but I have only read about this from the Raspbmc forums, I will add.

Home > Show Us Yours! > A couple of new PCBs - but especially the RPi...
Users viewing this thread: none. (+ 3 Guests) <- Prev  
To post messages you must be logged in!
Username: Password:
Page: