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 » Sat May 28, 2016 8:44 am

This thread has gone completely ungodly. I've updated the readme.md on the github repository so all the information is all in one place. For installation instructions, just follow them there rather than fishing through this ridiculously long winded thread. lol. sorry about that.

https://github.com/NullCorn/GBZ-Power-Monitor

User avatar
Bubble
Posts: 35
Joined: Sun May 08, 2016 7:33 am
Has thanked: 7 times
Been thanked: 4 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Bubble » Sat May 28, 2016 9:24 am

Noob question, but can we put the powerlines breakout board, where you put Video DC on the diagram ?
Again, thanks for your work.
Will try this for sure !

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 » Sat May 28, 2016 9:28 am

Bubble wrote:Noob question, but can we put the powerlines breakout board, where you put Video DC on the diagram ?
Again, thanks for your work.
Will try this for sure !
Sure, use either one of the two VOUTs and GNDs from the Pololu switch and feed that mini power strip with that. So, you can use the Video power in my diagram, yes. Then pull your Pi and/or Video power from that strip instead of directly from the Pololu switch

Bendra
Posts: 21
Joined: Tue May 17, 2016 10:05 am
Has thanked: 12 times
Been thanked: 2 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Bendra » Sun May 29, 2016 1:03 am

Another noob question, what does the latching emergency reset button does exactly?

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 May 29, 2016 4:43 am

Bendra wrote:Another noob question, what does the latching emergency reset button does exactly?
Since we are changing the way the PI powers down, by software, in case your Pi has a kernel panic or, for example, the monitor unexpectedly crashes, your pi will be stuck on and you'd have to get your screwdriver out to reset it. How annoying! So this was added as a way to do that. It's also used when you want to store the unit for longer periods of time, this lets you disconnect the batteries. The button should be recessed so it's not easily hit. I'm going to drill a pin hole where I need a paperclip to be able to hit it.

Fortunately, I've been working to make the monitor quite stable so it seems pretty good so this shouldn't be a problem, but just in case. Speaking of the monitor, I found a couple small bugs and made some more optimizations since I initially posted. So, update your codebase:

Code: Select all

cd ~/GBZ-Power-Monitor;git pull origin master

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 May 29, 2016 5:22 am

What about gluing the reset button inside the shell, in the battery compartment ?
It would be protected and easily accessible. ;)

callumsmith1989
Posts: 36
Joined: Tue May 17, 2016 7:45 am

Re: Tackling Graceful Shutdowns on the GBZ

Post by callumsmith1989 » Sun May 29, 2016 8:59 am

Hi

I was going over you read me file for the graceful shutdown and noticed you had listed the powerboost 1000c as a component needed. Can the graceful shutdown still be achieved with the alternative power supply listed in the sudomod wiki page (http://www.banggood.com/37V-Liion-Batte ... 37201311DI)?

Thanks for all your hard work in figuring this out.

Regards,
Callum

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 May 29, 2016 2:26 pm

callumsmith1989 wrote:Hi

I was going over you read me file for the graceful shutdown and noticed you had listed the powerboost 1000c as a component needed. Can the graceful shutdown still be achieved with the alternative power supply listed in the sudomod wiki page (http://www.banggood.com/37V-Liion-Batte ... 37201311DI)?

Thanks for all your hard work in figuring this out.

Regards,
Callum
Seems that there is no Low Battery LED so with that power supply, you wouldn't be able to do the low battery shutdowns, sadly. But if you could live without the low battery warnings, you could forego that and just add support for the main power switch using this monitor. That would still work.

User avatar
Camble
Posts: 885
Joined: Thu May 05, 2016 2:31 am
Location: Scotland
Has thanked: 269 times
Been thanked: 488 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Camble » Sun May 29, 2016 3:32 pm

Popcorn wrote:
Fleder wrote:@[mention]Popcorn[/mention]
I am sorry, i am sure this was already answered, but will the push button switch work as well instead of the slide switch?
Yes, the push button will work. Put UART TX to CTRL. Everything else should be wired the same. We can also use the OFF pin and GPIO-Poweroff but CTRL should work fine.

Image
Popcorn, this is the Pololu I have and while the monitor detects the slide switch in the off position and shuts down the Pi, the Pololu remains powered. I have the UART pin connected to the CTRL pin on the switch. I should note that I've had to connect the switch pins on the Pololu through ground, as there isn't a common ground on the push button version.

Any ideas what could be causing the switch to stay powered?

User avatar
Bubble
Posts: 35
Joined: Sun May 08, 2016 7:33 am
Has thanked: 7 times
Been thanked: 4 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Bubble » Sun May 29, 2016 10:20 pm

https://youtu.be/gWsudI3gcA4

For noobs like me ;) :
Now, launch the Monitor manually and test that it's working properly
python ~/GBZ-Power-Monitor/gbz_power_monitor.py
Once you are satified that the monitor behaves properly, add the monitor to the startup process to complete the installation
Make a reboot
echo "@reboot /usr/bin/nice -n 19 /usr/bin/python ~/GBZ-Power-Monitor/gbz_power_monitor.py" >> mycron; crontab mycron;rm mycron

Thank you Popcorn, can't wait to see if automatic low-battery cut-off will work :mrgreen:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest