Tackling Graceful Shutdowns on the GBZ

Various user-contributed guides for software-related things
User avatar
Felix
Posts: 44
Joined: Wed May 11, 2016 7:17 am
Location: Antwerp, Belgium
Has thanked: 3 times
Been thanked: 12 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Felix » Thu Jun 09, 2016 10:33 am

So, I want to use the code but I'm not going to use a pololu. The part that I want to use is the low battery and instead of a slide switch I want a tactile switch that gives the command to shutdown the rp0 if it's been pressed for ~2sec. That's for the rp0 shutdown, for the shutting down of the power I'm just using a switch between the enable pin and ground (I don't like popcorn's way that the powerboost is still on after the shutdown and power off).

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 » Thu Jun 09, 2016 11:17 am

Felix wrote:So, I want to use the code but I'm not going to use a pololu. The part that I want to use is the low battery and instead of a slide switch I want a tactile switch that gives the command to shutdown the rp0 if it's been pressed for ~2sec. That's for the rp0 shutdown, for the shutting down of the power I'm just using a switch between the enable pin and ground (I don't like popcorn's way that the powerboost is still on after the shutdown and power off).
Can't the Pololu be wired directly to the battery, with the Powerboost connected to the output of the Pololu?

User avatar
Ganreizu
Posts: 552
Joined: Thu May 05, 2016 8:20 am
Has thanked: 168 times
Been thanked: 97 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Ganreizu » Thu Jun 09, 2016 11:31 am

Camble wrote:Can't the Pololu be wired directly to the battery, with the Powerboost connected to the output of the Pololu?
But then how do you switch out the battery in the wild? Can we wire the connector that the powerboost has to the pololu?

I absolutely want to find a fix for the powerboost always being on and connected, but also want to be able to remove the battery on the fly.

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 » Thu Jun 09, 2016 2:21 pm

Don't think I didn't struggle with this. This was the best compromise using what we have.

In the end, I positioned my latching switch so it's right next to the slide switch. The nice feature about the way I did it is that when flipped on, the plastic tab covers the hole, so you cannot access the emergency latch while the system is ON. That will preserve the graceful shutdowns. Also, I made it so when it is latched to shut the powerboost off, I made the latch extend out, so that blocks the plastic tab. Which means that you can't accidentally try to turn it on, while it's latched off. A win-win.

If you want to use my script to trigger after 2 seconds, go for it. I placed the power button timeout as 1 second in the variables section at the top of the script. Just edit it to 2 instead.

Please note that I'm working on version 1.1 which moves all of these into a config file instead

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 » Thu Jun 09, 2016 2:37 pm

Ganreizu wrote:
Camble wrote:Can't the Pololu be wired directly to the battery, with the Powerboost connected to the output of the Pololu?
But then how do you switch out the battery in the wild? Can we wire the connector that the powerboost has to the pololu?

I absolutely want to find a fix for the powerboost always being on and connected, but also want to be able to remove the battery on the fly.
Two... power supplies? :lol: I think I might just put up with it tbh.

User avatar
Ganreizu
Posts: 552
Joined: Thu May 05, 2016 8:20 am
Has thanked: 168 times
Been thanked: 97 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Ganreizu » Thu Jun 09, 2016 2:43 pm

I suppose we could just unplug the battery every time we stop using it. o.o Tedious but whatever.

User avatar
Felix
Posts: 44
Joined: Wed May 11, 2016 7:17 am
Location: Antwerp, Belgium
Has thanked: 3 times
Been thanked: 12 times

Re: Tackling Graceful Shutdowns on the GBZ

Post by Felix » Thu Jun 09, 2016 4:22 pm

Camble wrote:
Felix wrote:So, I want to use the code but I'm not going to use a pololu. The part that I want to use is the low battery and instead of a slide switch I want a tactile switch that gives the command to shutdown the rp0 if it's been pressed for ~2sec. That's for the rp0 shutdown, for the shutting down of the power I'm just using a switch between the enable pin and ground (I don't like popcorn's way that the powerboost is still on after the shutdown and power off).
Can't the Pololu be wired directly to the battery, with the Powerboost connected to the output of the Pololu?
Actually that might be possible because the pololu needs a min. voltage of 2v.
Ganreizu wrote:
Camble wrote:Can't the Pololu be wired directly to the battery, with the Powerboost connected to the output of the Pololu?
But then how do you switch out the battery in the wild? Can we wire the connector that the powerboost has to the pololu?

I absolutely want to find a fix for the powerboost always being on and connected, but also want to be able to remove the battery on the fly.
That's a possible way to connect and if it doesn't fit you can solder some wires to it.

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 » Thu Jun 09, 2016 9:05 pm

Felix wrote:
Camble wrote:
Felix wrote:So, I want to use the code but I'm not going to use a pololu. The part that I want to use is the low battery and instead of a slide switch I want a tactile switch that gives the command to shutdown the rp0 if it's been pressed for ~2sec. That's for the rp0 shutdown, for the shutting down of the power I'm just using a switch between the enable pin and ground (I don't like popcorn's way that the powerboost is still on after the shutdown and power off).
Can't the Pololu be wired directly to the battery, with the Powerboost connected to the output of the Pololu?
Actually that might be possible because the pololu needs a min. voltage of 2v.
Ganreizu wrote:
Camble wrote:Can't the Pololu be wired directly to the battery, with the Powerboost connected to the output of the Pololu?
But then how do you switch out the battery in the wild? Can we wire the connector that the powerboost has to the pololu?

I absolutely want to find a fix for the powerboost always being on and connected, but also want to be able to remove the battery on the fly.
That's a possible way to connect and if it doesn't fit you can solder some wires to it.
If you put the pololu on the battery, that means you can't charge while the unit is off

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 » Thu Jun 09, 2016 9:13 pm

Camble wrote:
Ganreizu wrote:
Camble wrote:Can't the Pololu be wired directly to the battery, with the Powerboost connected to the output of the Pololu?
But then how do you switch out the battery in the wild? Can we wire the connector that the powerboost has to the pololu?

I absolutely want to find a fix for the powerboost always being on and connected, but also want to be able to remove the battery on the fly.
Two... power supplies? :lol: I think I might just put up with it tbh.
One main power switch. The other for emergency shutdowns as a reset button. If you read the FAQ, the latching switch is in case the monitor crashes or the pi has a kernal panic. Rare events but in case they happen. You dont need to install it, its totally optional. But if that happened, and you didn't have it, you'd need to get your screwdriver out to shut it off.

Here's what mine looks like:

Image

Image

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 » Thu Jun 09, 2016 9:32 pm

Wait a sec! Why didn't I think of this before? I think I might have found a way to have the pololu shut off the Powerboost. I wont be able to test until after the weekend. Can someone try this and report back? You need the pololu mini slide switch.

Connect everything up like the guide but also add two wires. EN and GND on the Powerboost continue to go to a latching switch still (we still need an emergency reset) BUT, they also map to the center OFF and GND that are pinned out as part of the onboard switch in the middle of the board. Looking at the schematic, they close when off, which is what we need to shut off the Powerboost. Someone let us know if this works? Or I'll let you know by Tuesday. I'm out of town til then.

Image

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest