Page 34 of 37

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Sat Jul 23, 2016 6:41 am
by Camble
Just a quick update.

Using GPIO4 (physical pin 7) instead of UART TX and adding the following into /boot/config.txt reduces the time on bootup from 8-10 seconds to 5 seconds. This means you only have to wait half the time after powering on before switching off to ensure a graceful shutdown.

Code: Select all

dtoverlay=gpio-poweroff,gpiopin=4,active_low="y"
Thanks @Popcorn :D

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Sat Jul 23, 2016 8:34 am
by Popcorn
According to this, anything that happens in the first through third stage bootloader wouldn't corrupt your SD card anyway. The SD gets mounted after the Kernel is booted. So even if you were to shutdown within the first 5 seconds, your system should still be safe from SD corruption, which is the whole point of this thing.

Image

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Sat Jul 23, 2016 8:35 am
by Camble
@Popcorn Well that's awesome. Even more peace of mind.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Sun Jul 24, 2016 8:47 am
by Popcorn
Camble wrote:@Popcorn Well that's awesome. Even more peace of mind.
Great news. Do you have the wiring diagram and component list for your alt MOSFET solution? I want to try to build one and modify the instructions on my monitor to match. Thanks!

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Sun Jul 24, 2016 3:56 pm
by Camble
@Popcorn It's all here.

[edit] I've updated the guide to include an alternative circuit, for use with the original DMG-01 switch. No need to buy a fancy switch at all!

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed Jul 27, 2016 11:00 pm
by Artist_block
Hey Camble. I'm I bit confused, your shutdown circuit is almost identical to this one. https://www.raspberrypi.org/forums/view ... 42#p781542 https://www.youtube.com/watch?v=3hhhXcmpcac So is your circuit supposed to delay the powerboost from powering down, just long enough to for the pi to cycle down?

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Thu Jul 28, 2016 12:33 am
by SidSilver
Artist_block wrote:Hey Camble. I'm I bit confused, your shutdown circuit is almost identical to this one. https://www.raspberrypi.org/forums/view ... 42#p781542 https://www.youtube.com/watch?v=3hhhXcmpcac So is your circuit supposed to delay the powerboost from powering down, just long enough to for the pi to cycle down?
It looks like the same but it's not.
Instead of the capacitor acting as a count down, Camble as wires to the pi to have a signal of the actual pi shutdown.
So the powerboost is powered off only when the pi is actually off.

With the capacitor you have to wait a fixed time that may be too long and in some cases can be too short and damage your SD because of a bad shutdown.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Fri Jul 29, 2016 6:09 am
by alien0matic
I did the part with the low battery warning on my GBZ, but as soon as the LED starts blinking, the screen starts to switch on and off, the sound gets on and off, too. I did all this a few weeks back and I thought I had it wired wrong, but this doesn't seem to be the case.
Is there any advice on how to find the error? Will try to do a video of it if this helps.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Fri Jul 29, 2016 6:32 am
by day
maybe your calibration is not correct and you need to set a slightly higher value of "low battery" level ?

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Fri Jul 29, 2016 9:50 am
by alien0matic
To get the facts straight:
Sound and screen starts to shut off and on when the power is low. I'm trying to figure out what is wrong. If the LED is fully light there is 3V on the GPIO pin.

edit:
So, I just added debug messages to the python script. The lowBattery callback is never called. The only thing I can trigger it to be called is when I measure the resistor with my multimeter. Someone please give me an advice on where to look. Thanks.