TonyLHansen / raspberry-pi-safe-off-switch

A set of scripts that can be used to provide a "safe power off switch" for a Raspberry Pi.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

does it work on pi3b?

pmitham opened this issue · comments

Tony,

I've downloaded all of your shutdown scripts and none of them work on a pi3b running raspbian jessi.
Have you been able to get this to work? when I try to run I ge tthe following output:

/shutdown-led-simple.py
Traceback (most recent call last):
File "./shutdown-led-simple.py", line 22, in
btn = Button(offGPIO, hold_time=holdTime)
File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 95, in call
self = super(GPIOMeta, cls).call(*args, **kwargs)
File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 292, in init
pin, pull_up, bounce_time, pin_factory=pin_factory
File "/usr/lib/python3/dist-packages/gpiozero/mixins.py", line 338, in init
super(HoldMixin, self).init(*args, **kwargs)
File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 95, in init
self.pin.when_changed = self._fire_events
File "/usr/lib/python3/dist-packages/gpiozero/pins/init.py", line 388, in
lambda self, value: self._set_when_changed(value),
File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 289, in _set_when_changed
self._enable_event_detect()
File "/usr/lib/python3/dist-packages/gpiozero/pins/rpigpio.py", line 219, in _enable_event_detect
bouncetime=self._bounce)
RuntimeError: Failed to add edge detection

thanks

Got it working had to move the line in rc.local so that its above the exit0 statement

ah. Glad it's working now