Tackling Graceful Shutdowns on the GBZ

Various user-contributed guides for software-related things
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 » Wed May 11, 2016 7:10 am

Fleder wrote:@Popcorn
Sweet! Y'all got any more of them Honolulus? :D
Edit: https://www.pololu.com/product/2810

:]
Last edited by Ganreizu on Wed May 11, 2016 8:37 am, edited 1 time in total.

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

Re: Tackling Graceful Shutdowns on the GBZ

Post by Fleder » Wed May 11, 2016 7:26 am

Thanks, but oh wow, those shipping fees are high.

Edit: Nevermind, found them in my country, too.
Last edited by Fleder on Wed May 11, 2016 7:29 am, edited 1 time in total.

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

Re: Tackling Graceful Shutdowns on the GBZ

Post by Camble » Wed May 11, 2016 7:27 am

Ganreizu wrote:
Fleder wrote:@Popcorn
Sweet! Y'all got any more of them Honolulus? :D
https://www.pololu.com/product/2808

:]
Here's the one Popcorn used, it has a slide switch.

https://www.pololu.com/product/2810

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

Re: Tackling Graceful Shutdowns on the GBZ

Post by Fleder » Wed May 11, 2016 7:31 am


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 » Wed May 11, 2016 8:37 am

Camble wrote:Here's the one Popcorn used, it has a slide switch.

https://www.pololu.com/product/2810
Oh whoops, i had that product page on my other computer but got led to the push switch one instead this time.

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 » Wed May 11, 2016 8:38 am

I bought both actually. Either will work. The pushbutton one has an OFF pin which will work with GPIO-Poweroff setting to HIGH.

I have also tested the switch using GPIO 14 / UART TX going to the ON pin and it works great. So we no longer need an output GPIO assigned. Now, we only need 2 input pins to listen for the Power Off and Low Battery and a daemon to detect the case change on those two pins. I'm still testing it all out.

Something else I thought about. Another feature that I want to add is a manual reset/reboot somehow. Let's say the GBZ crashes and has a Kernel Panic, we need a way to manually shut off the unit or at least reset it, otherwise it will be stuck. I'm thinking of using one of the countless tactile switches I have and mounting it somewhere inside, where I can then drill a super small hole in the case, and use a paperclip to hit the tactile switch to do the manual power reset. Still trying to map it all out. I'll keep you all in the loop as I progress.

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 » Wed May 11, 2016 8:56 am

Popcorn wrote:I bought both actually. Either will work. The pushbutton one has an OFF pin which will work with GPIO-Poweroff setting to HIGH.

I have also tested the switch using GPIO 14 / UART TX going to the ON pin and it works great. So we no longer need an output GPIO assigned. Now, we only need 2 input pins to listen for the Power Off and Low Battery and a daemon to detect the case change on those two pins. I'm still testing it all out.

Something else I thought about. Another feature that I want to add is a manual reset/reboot somehow. Let's say the GBZ crashes and has a Kernel Panic, we need a way to manually shut off the unit or at least reset it, otherwise it will be stuck. I'm thinking of using one of the countless tactile switches I have and mounting it somewhere inside, where I can then drill a super small hole in the case, and use a paperclip to hit the tactile switch to do the manual power reset. Still trying to map it all out. I'll keep you all in the loop as I progress.

So buying the switch rather than the pushbutton is the preferable option right? It doesn't have that weird behavior that you mentioned? It just uses 2 GPIO pins and we're good to go?

How does it mount in the case, right where the original power switch is? I thought the screw hole next to the USB would get in the way and we can't remove that.

I like the idea of a paperclip reset button! Don't know how common crashing is though.

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 » Wed May 11, 2016 9:01 am

It's a bit premature. I'm still working on the proof-of-concept. But from everything I've tested both those switches are good. The slide switch is more of the budget version of the two. I like the fact that the pushbutton switch has OFF and CTRL. But, we might get away with not needing those since everything is working with GPIO killing power so it works fine with the Slide Switch version of having just an ON pin.

I haven't mounted it in the case yet, I'm just breadboarding it all now. That will all come.

And you are right, hopefully a kernel panic is super super rare. Maybe once in a year or never! But if/when it happens, I'd hate to have to actually get my screwdriver out, to open it up, just so I can turn it off! lol

And there doesn't seem to be any weird behaviour using UART TX. The Pololu switch recognizes it as a HIGH state and remains on right from power on.

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 » Wed May 11, 2016 9:12 am

Fleder wrote:@Popcorn
Sweet! Y'all got any more of them Honolulus? :D
Sadly both are spoken for now but it seems you found the link to exp-tech which is exactly where I got them too! :)

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 » Wed May 11, 2016 9:19 am

Popcorn wrote:It's a bit premature. I'm still working on the proof-of-concept. But from everything I've tested both those switches are good. The slide switch is more of the budget version of the two. I like the fact that the pushbutton switch has OFF and CTRL. But, we might get away with not needing those since everything is working with GPIO killing power so it works fine with the Slide Switch version of having just an ON pin.

I haven't mounted it in the case yet, I'm just breadboarding it all now. That will all come.

And you are right, hopefully a kernel panic is super super rare. Maybe once in a year or never! But if/when it happens, I'd hate to have to actually get my screwdriver out, to open it up, just so I can turn it off! lol

And there doesn't seem to be any weird behaviour using UART TX. The Pololu switch recognizes it as a HIGH state and remains on right from power on.
So according to this image: http://www.raspberrypi-spy.co.uk/wp-con ... 00x900.png

Which GPIO pins would it map to? Pin 8 and ?

Will be nice when we get the wiki page up and we can get guides on how to add components and features! :D

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest