Page 2 of 37

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed May 11, 2016 7:10 am
by Ganreizu
Fleder wrote:@Popcorn
Sweet! Y'all got any more of them Honolulus? :D
Edit: https://www.pololu.com/product/2810

:]

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed May 11, 2016 7:26 am
by Fleder
Thanks, but oh wow, those shipping fees are high.

Edit: Nevermind, found them in my country, too.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed May 11, 2016 7:27 am
by Camble
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

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed May 11, 2016 7:31 am
by Fleder

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed May 11, 2016 8:37 am
by Ganreizu
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.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed May 11, 2016 8:38 am
by Popcorn
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.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed May 11, 2016 8:56 am
by Ganreizu
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.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed May 11, 2016 9:01 am
by Popcorn
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.

Re: Tackling Graceful Shutdowns on the GBZ

Posted: Wed May 11, 2016 9:12 am
by Popcorn
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! :)

Re: Tackling Graceful Shutdowns on the GBZ

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