Tackling Graceful Shutdowns on the GBZ

Various user-contributed guides for software-related things
User avatar
Popcorn
Trailblazer
Trailblazer
Posts: 354
Joined: Thu May 05, 2016 12:58 am
Location: Berlin
Has thanked: 29 times
Been thanked: 71 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Popcorn » Sun Jul 10, 2016 3:50 am

My opinion is obviously biased. But since I've also corrupted a total of two SD cards now, I think this feature is actually essential. ;)

User avatar
Popcorn
Trailblazer
Trailblazer
Posts: 354
Joined: Thu May 05, 2016 12:58 am
Location: Berlin
Has thanked: 29 times
Been thanked: 71 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Popcorn » Sun Jul 10, 2016 4:09 am

SidSilver wrote:@Popcorn : I've followed your tutorial for the pololu graceful shutdown.
When I switch off I have a kernel panic.
Image
Wow. All that the script is doing is a simple "sudo shutdown -h now". Can you try exiting Emulation Station and trying that manually to see if it does the same thing?

SidSilver
Posts: 263
Joined: Sun May 22, 2016 6:22 am
Location: France
Has thanked: 137 times
Been thanked: 37 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by SidSilver » Sun Jul 10, 2016 8:07 am

Popcorn wrote:
SidSilver wrote:@Popcorn : I've followed your tutorial for the pololu graceful shutdown.
When I switch off I have a kernel panic.
Image
Wow. All that the script is doing is a simple "sudo shutdown -h now". Can you try exiting Emulation Station and trying that manually to see if it does the same thing?
I've found the problem. I did the gpio thing for the tact pololu but i have the switch pololu. Removed it now it's ok.

User avatar
Popcorn
Trailblazer
Trailblazer
Posts: 354
Joined: Thu May 05, 2016 12:58 am
Location: Berlin
Has thanked: 29 times
Been thanked: 71 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Popcorn » Sun Jul 10, 2016 10:27 pm

TheNotorious wrote:oh that would suck i took one that was listed in the wiki haha
http://sudomod.com/wiki/index.php?title ... wer_Supply
the adafruit products are quite exspensive next to some others thats why but if it is not the right one im back to the ordering table haha.
I answered this question in the FAQ. You can still use the graceful shutdowns with this power supply, but if it doesn't have a low battery led, then you won't be able to detect that and do the shutdowns when the battery is low. It will still work for the power switch though. Check for a low battery led and let us know how it works

User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 118 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by chiz » Mon Jul 11, 2016 12:29 am

@Popcorn
Thinking of implementing your graceful shutdown solution to solve for the "low batt too soon issue" with the PB1000C. However, I've got two questions that I hope you can help confirm:

1. UART TX (BCM 14) Connection

As you may recall, I cut my RPi2 leaving me with only the odd-numbered pins. With pin 8 missing, which odd-numbered pin can I substitute for it?

2. Latching Switch

Do I still need this switch if in my set-up I can easily unplug the battery from the PB1000C? See pic below of my battery connection:

[spoiler="battery connection"]Image[/spoiler]

User avatar
Fleder
Posts: 848
Joined: Thu May 05, 2016 9:04 am
Location: Germany
Has thanked: 183 times
Been thanked: 257 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Fleder » Mon Jul 11, 2016 12:36 am

chiz wrote:Thinking of implementing your graceful shutdown solution to solve for the "low batt too soon issue" with the PB1000C. However, I've got two questions that I hope you can help confirm:
May i hijack this thread to ask you one question?
If you are using the PB1000C, why do you soldered on a protective module to your battery?
Isn't this redundant with the PB in use?

User avatar
chiz
Posts: 228
Joined: Thu May 05, 2016 12:05 am
Has thanked: 29 times
Been thanked: 118 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by chiz » Mon Jul 11, 2016 1:21 am

Fleder wrote:
chiz wrote:Thinking of implementing your graceful shutdown solution to solve for the "low batt too soon issue" with the PB1000C. However, I've got two questions that I hope you can help confirm:
May i hijack this thread to ask you one question?
If you are using the PB1000C, why do you soldered on a protective module to your battery?
Isn't this redundant with the PB in use?
There's an article in Adafruit website that talks about the raw vs protected batteries and they said in the article that the batteries they sell are protected ones. They even went on saying be careful using unprotected batteries. This is what prompted me to add a protection circuit to the batteries I'm using even if they're connected to the PB1000C. In the industry I'm at (I.T.), redundant system is always good. :D

User avatar
Popcorn
Trailblazer
Trailblazer
Posts: 354
Joined: Thu May 05, 2016 12:58 am
Location: Berlin
Has thanked: 29 times
Been thanked: 71 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Popcorn » Mon Jul 11, 2016 4:11 am

chiz wrote:@Popcorn
Thinking of implementing your graceful shutdown solution to solve for the "low batt too soon issue" with the PB1000C. However, I've got two questions that I hope you can help confirm:

1. UART TX (BCM 14) Connection

As you may recall, I cut my RPi2 leaving me with only the odd-numbered pins. With pin 8 missing, which odd-numbered pin can I substitute for it?

2. Latching Switch

Do I still need this switch if in my set-up I can easily unplug the battery from the PB1000C? See pic below of my battery connection:

[spoiler="battery connection"]Image[/spoiler]
Yeah, you just need any GPIO with an output set to high. Once that is feeding the ON pin of the Pololu, it will override the Off of the slide switch and will then shutdown after the Pi shuts down. You can pick whichever even numbered pin to do the same job. Pick one and add something like this to your startup script (using GPIO4 in this example):

Code: Select all

echo out > /sys/class/gpio/gpio4/direction # set it as an output pin
echo 1 > /sys/class/gpio/gpio4/value # set the value to ON


That's the quick and dirty. There's probably a way to it using dtoverlay and setting the GPIO pin to an output and to high. That would be preferable because it would happen alot sooner in the bootup process. Have to google around to see if I can find how to set that.

And the latching switch is totally optional. You don't need it if you have an easy way to get at the batteries.

Let me know how it goes. Curious. Thanks!

User avatar
tent
Posts: 32
Joined: Thu Jul 07, 2016 4:40 pm
Has thanked: 6 times
Been thanked: 1 time

Re: Tackling Graceful Shutdowns on the GBZ

Post by tent » Tue Jul 12, 2016 4:00 am

RazorX wrote:there's a more expensive alternative but requires next to no work:

ATXRaspi-R2


https://www.youtube.com/watch?v=w4vSTq2WhN8
what is your opinion about the http://lowpowerlab.com/atxraspi/#whatisit ?
what it is missing is the low battery functionality but it looks attractive to me because with that one you do not need to have the powerboost 1000C or any boost that needs to have EN pin.. or could this be done as well with the Pololu?
tent:wq

User avatar
tent
Posts: 32
Joined: Thu Jul 07, 2016 4:40 pm
Has thanked: 6 times
Been thanked: 1 time

Re: Tackling Graceful Shutdowns on the GBZ

Post by tent » Wed Jul 13, 2016 7:33 am

Camble wrote:You'll still be able to use a Pololu switch to perform a graceful shutdown. The problem of the supply being on exists with both the Banggood module, as there is no EN pin to shut it off manually. You could always add a switch between your battery and the power supply module though.
Well if the idea is to shutdown gracefully by button press but then not taking off the power then you do not even need a pololu any pushbutton to a gpio would do...
Ok then I add a switch to disconnect battery.. Ok basically not nice and practical but with a switch and a button no particular hw is needed but it's strange no ps2 exists for embedded that also features something like atx and apm for shutdown and battery level...
tent:wq

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest