Hi all, I’m new to Manjaro.
Just installed on an RPI4 and everything works well apart from…
I have a python 3 script that controls a small fan on my RPI4 using a GPIO pin, which starts like this:
#!/usr/bin/env python3
import time
from gpiozero import OutputDevice
For that to work, it has to import from module gpiozero and despite installing the following packages, verified using “pacman - Qe”, it fails to run:
python-gpiozero 1.6.2-1
python-raspberry-gpio 0.7.0-2
The screen full of errors I get when posting this is printed below:
Traceback (most recent call last):
File “/usr/lib/python3.9/site-packages/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 “/home/fat/Documents/pi-fan-controller/RPIfancontrol.py”, line 35, in
fan = OutputDevice(GPIO_PIN)
File “/usr/lib/python3.9/site-packages/gpiozero/devices.py”, line 108, in call
self = super(GPIOMeta, cls).call(*args, **kwargs)
File “/usr/lib/python3.9/site-packages/gpiozero/output_devices.py”, line 83, in init
super(OutputDevice, self).init(pin, pin_factory=pin_factory)
File “/usr/lib/python3.9/site-packages/gpiozero/mixins.py”, line 85, in init
super(SourceMixin, self).init(*args, **kwargs)
File “/usr/lib/python3.9/site-packages/gpiozero/devices.py”, line 549, in init
pin = self.pin_factory.pin(pin)
File “/usr/lib/python3.9/site-packages/gpiozero/pins/pi.py”, line 103, in pin
pin = self.pin_class(self, n)
File “/usr/lib/python3.9/site-packages/gpiozero/pins/rpigpio.py”, line 111, in init
GPIO.setup(self.number, GPIO.IN, self.GPIO_PULL_UPS[self._pull])
RuntimeError: Not running on a RPi!
Any ideas how to make this work or will I have to build an external circuit to drive the fan and forget about GPIO on the RPI4 under Manjaro? it has worked fine on both Lubuntu and Ubuntu so far.
Regards,
AV.