[FOR SALE] Pololu mini switch to gracefully shutdown GBZ (None left)

Completed sale threads will be moved here to keep things tidy in the main For Sale forum.
Post Reply
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

[FOR SALE] Pololu mini switch to gracefully shutdown GBZ (None left)

Post by Popcorn » Fri May 06, 2016 6:33 pm

EDIT: All these switches are gone. But just google around, you can find them for cheap.

Hey guys,

I went a bit click happy and accidentally purchased two additional versions of these switches. I would have cancelled the order, but based on my last experience at ThePiHut for outright cancelling both my RPI0 orders, I just kept it as is. Now I have 1 additional switch that I don't need. Even though I paid a bit more, I would sell them for 5€ each including shipping, just so I could recoup some of the costs back.

If anyone wants to take a crack at solving how to gracefully shutdown the PI, then this is what you'd use. Using the power switch mapped to this switch to turn it on (A & GND). You then would need an interrupt driven GPIO input to listen to the state of the power switch. When it's opened (shut off), then software will trigger the shutdown process and use a GPIO pin mapped to CTRL to turn it off (which happens after the shutdown process) using GPIO Poweroff.

This solution is not proven yet but I bought these switches because they were inexpensive and I wanted to give it a try.

Image

More info here (and where I bought them):

http://www.exp-tech.de/mini-pushbutton- ... tection-lv

PM me if interested or email me at abandonedemails@gmail.com but making certain that "sudomod" is somewhere in the subject or else I won't receive it. Thanks!
Last edited by Popcorn on Sat May 07, 2016 2:37 pm, edited 2 times in total.

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

Re: [FOR SALE] Pololu mini switch to gracefully shutdown GBZ

Post by chiz » Sat May 07, 2016 12:27 pm

@Popcorn

Are you able to make this switch work?

I tried the GPIO method with a momentary switch and while it worked, one has to be logged in as root. The implementation that I've seen for this Pololu switch using an Arduino is that this switch delays shutting the power.

At the moment, I can't think of a way to put in a python script that would first halt the system, then delay for a bit, then shut the power. Obviously, it can't be the other way around. Running 2 parallel process, perhaps will work, i.e., triggering the power down simultaneous with the system halt/shutdown, but I've not seen any implementation like this.

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: [FOR SALE] Pololu mini switch to gracefully shutdown GBZ

Post by Popcorn » Sat May 07, 2016 1:04 pm

Hi Chiz,

I haven't received my RPI0 to test it out yet. But I've been doing lots of reading on it though and it should work using the GPIO-poweroff driver, which I don't believe that you need to be root, or some weird threaded/timed suicidal process. Looks like just a kernel setting on boot

Here's Raspberry Foundation's dox on it

When the GPIO-poweroff driver is added in the config.txt, it makes the specified GPIO pin of your choosing set to HIGH (or Low) when the Pi reaches Shutdown mode. You would then map that specified high PIN to the OFF pin of the Pololu switch to force it to switch off. (or alternatively, route it to the CTRL pin). I can't wait to get my hands on the PI Zero to test it out. More info here.

The only thing additional to this is also adding an interrupt driven GPIO input which is mapped to the power switch that detects when the switch is flipped into "off". That will trigger the Shutdown process. And the shutdown will then trip the switch off, as i mentioned above.

If/when I do, I'll be sure to write up a detailed posting about it for others in the forums

Cheers!

mtarnuhal
Posts: 8
Joined: Thu May 05, 2016 2:15 pm
Location: The Netherlands
Been thanked: 1 time

Re: [FOR SALE] Pololu mini switch to gracefully shutdown GBZ (1 Left)

Post by mtarnuhal » Tue May 10, 2016 1:29 pm

Would like to have that one. can you send it with the pcb's? Still have to buy them if you reorder them ofc.

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: [FOR SALE] Pololu mini switch to gracefully shutdown GBZ (1 Left)

Post by Popcorn » Wed May 11, 2016 9:18 am

mtarnuhal wrote:Would like to have that one. can you send it with the pcb's? Still have to buy them if you reorder them ofc.
Ok, I'll reserve it for ya. I'm waiting for the current batch of PCBs to arrive next week. Once they all check out ok, I'll place another order and you can jump on that one. Thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest