I am trying to set a gpio pin to true while my system is running. The porpuse is that I have an external controller that boots is when my tv is turned on but I need to know if the pi is allready on because otherwise it will do a shutdown.
I have installed the add on raspberry pi tools but I cant get the gpio to work.
I have the script.
Python
import sys
sys.path.append('/storage/.kodi/addons/virtual.rpi-tools/lib')
from gpiozero import LED
led = LED(17)
led.on()
This produces the error
Code
Traceback (most recent call last):
File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/pi.py", line 101, in pin
pin = self.pins[n]
~~~~~~~~~^^^
KeyError: 17
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/storage/test.py", line 6, in <module>
led = LED(17)
^^^^^^^
File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/devices.py", line 108, in __call__
self = super(GPIOMeta, cls).__call__(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/output_devices.py", line 200, in __init__
super(DigitalOutputDevice, self).__init__(
File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/output_devices.py", line 83, in __init__
super(OutputDevice, self).__init__(pin, pin_factory=pin_factory)
File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/mixins.py", line 85, in __init__
super(SourceMixin, self).__init__(*args, **kwargs)
File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/devices.py", line 549, in __init__
pin = self.pin_factory.pin(pin)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/pi.py", line 103, in pin
pin = self.pin_class(self, n)
^^^^^^^^^^^^^^^^^^^^^^^
File "/storage/.kodi/addons/virtual.rpi-tools/lib/gpiozero/pins/rpigpio.py", line 111, in __init__
GPIO.setup(self.number, GPIO.IN, self.GPIO_PULL_UPS[self._pull])
RuntimeError: Cannot determine SOC peripheral base address
Display More
I Understand that this is because the hardware for rp5 is different but is there a possible method for doing this on the rp5.
Any help would be greatly appriciated