Hey everyone. Can I add my huge thanks to all contributors (especially floob and techtipsta) as a newcomer with no linux experience – everything works very well and is of exceptional quality.
I am just finishing off the physical building of my project, and need to decide on a few last things.
One of the issues I seem to be having with my pi 2 B is occasional corruption of data on my SD card, resulting in fsck errors and strange behaviours (deleting my images from scraping on each reboot claiming they contain errors, for example).
I am hoping to fix this by using a proper shutdown method as opposed to simply pulling the usb cable out. For my final build I won’t have a keyboard available – I am using an IPAC-2 to interface a standard arcade buttons and joysticks with a couple of extra microswitches for function buttons.
How difficult is it to program one of these microswitches to function as a “soft” power button (via input through the IPAC-2)? Or would purchasing something like the PowerBlock be what I am after here?
I’ve just been using a momentary switch and a pull up resistor connected to a couple unused pins on the GPIO, this triggers a script that issues the shutdown command.
It’s probably the simplest, least expensive option IMO.
In case my PI ever freezes, I have another momentary switch connected to the reset pins on the PI as well. this one is for emergency use only, because it has the same risk of corrupting your SD card, but has come in handy a couple times.