I've been trying to get this pin5/6 (and really, aren't we supposed to use the BCM nubers for these things? As in GPIO3 & GND) with some confusion.
Initally it simply wouldn't work at all and eventually I thought to look in `dmesg` to see if it listed any helpful errors. It doesn't often do any good but just often enough that I live in hope. Anyway, this time I saw -
Code: Select all
pi@motioneye:~ $ dmesg | grep shutdown
[ 3.424604] pinctrl-bcm2835 3f200000.gpio: pin gpio3 already requested by 3f804000.i2c; cannot claim for soc:shutdown_button
[ 3.424622] pinctrl-bcm2835 3f200000.gpio: pin-3 (soc:shutdown_button) status -22
[ 3.424641] gpio-keys soc:shutdown_button: Error applying setting, reverse things back
[ 3.424670] gpio-keys: probe of soc:shutdown_button failed with error -22
which lead me to try disabling i2c in raspi-config. That made the button work - but left me without i2c.
I wondered if it might be an ordering thing and so moved the dtoverlay=gpio-shutdown higher in the config.txt file. No luck.
So far it seems you can have a button or i2c. I read a hint that GPIO1 might also trigger a restart (it doesn't) but I did move my shutdown button to GPIO1/gnd and edited the dtoverlay to be
Code: Select all
which worked ok for the shutdown. It turns out that another button on GPIO3/gnd is ok to do the restart even with i2c enabled, so one option is to have two buttons. It certainly offers more blinkenlightsparkle if you have lighted buttons.
The obvious question is whether one can simply combine the wiring and have a single button that would connect GPIO3, GPIO1 and a gnd? If your Pi is burbling away with some i2c device attached and you short the i2c clock line at the same time as GPIO1 would it do anything nasty? Seems like it might be a bit rude to me...
It's really unfortunate that one useful thing is prevented by another useful thing.