Quantcast
Viewing all articles
Browse latest Browse all 4867

Beginners • Re: pigpiod: System does not appear to be a raspberry pi

If it is remote GPIO you are looking for and not local, then https://abyz.me.uk/lg/py_rgpio.html

Is the generic alternative (made by the same person/people) as pigpio.

It would be nice if RPiOS looked into this for Pi5 series users.
Thanks for the tip!

I find it a little odd, that the RPiOS ships with the raspi-config tool, which does not automatically detect on which version of PI it's running and confuses users by allowing to enable the Remote GPIO service, which will not work Image may be NSFW.
Clik here to view.
:roll:


Also vanilla RPiOS ships with the lgpio==0.2.2.0 preinstalled, but without rgpio==0.2.2.0 Image may be NSFW.
Clik here to view.
:roll:


Either way, as per your suggestion I have compiled the rgpio and created the following systemd service:

Code:

root@raspberrypi:~# systemctl cat rgpiod.service # /etc/systemd/system/rgpiod.service[Unit]Description=Daemon required to control GPIO pins via gpiozero[Service]ExecStart=/usr/local/bin/rgpiod -p 8888ExecStop=/bin/systemctl kill rgpiodType=simple[Install]WantedBy=multi-user.target
However now it's gpiozero who refuses to work Image may be NSFW.
Clik here to view.
:(

Code:

In [1]: from gpiozero import LED   ...: from gpiozero.pins.pigpio import PiGPIOFactoryIn [2]: factory = PiGPIOFactory(host='192.168.22.8')In [3]: led = LED(17, pin_factory=factory)---------------------------------------------------------------------------KeyError                                  Traceback (most recent call last)File ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/pins/pi.py:306, in PiBoardInfo.from_revision(cls, revision)    289 try:    290     (    291         model,    292         pcb_revision,    293         released,    294         soc,    295         manufacturer,    296         memory,    297         storage,    298         usb,    299         ethernet,    300         wifi,    301         bluetooth,    302         csi,    303         dsi,    304         headers,    305         board,--> 306         ) = data.PI_REVISIONS[revision]    307     usb3 = 0KeyError: 0During handling of the above exception, another exception occurred:PinUnknownPi                              Traceback (most recent call last)Cell In[3], line 1----> 1 led = LED(17, pin_factory=factory)File ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/devices.py:108, in GPIOMeta.__call__(cls, *args, **kwargs)    105         cls._instances[key] = weakref.ref(self)    106 else:    107     # Construct the instance as normal--> 108     self = super().__call__(*args, **kwargs)    109 # At this point __new__ and __init__ have all been run. We now fix the    110 # set of attributes on the class by dir'ing the instance and creating a    111 # frozenset of the result called __attrs__ (which is queried by    112 # GPIOBase.__setattr__). An exception is made for SharedMixin devices    113 # which can be constructed multiple times, returning the same instance    114 if not issubclass(cls, SharedMixin) or self._refs == 1:File ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/output_devices.py:192, in DigitalOutputDevice.__init__(self, pin, active_high, initial_value, pin_factory)    190 self._blink_thread = None    191 self._controller = None--> 192 super().__init__(pin, active_high=active_high,    193                  initial_value=initial_value, pin_factory=pin_factory)File ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/output_devices.py:74, in OutputDevice.__init__(self, pin, active_high, initial_value, pin_factory)     72 def __init__(self, pin=None, *, active_high=True, initial_value=False,     73              pin_factory=None):---> 74     super().__init__(pin, pin_factory=pin_factory)     75     self._lock = Lock()     76     self.active_high = active_highFile ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/mixins.py:75, in SourceMixin.__init__(self, *args, **kwargs)     73 self._source_thread = None     74 self._source_delay = 0.01---> 75 super().__init__(*args, **kwargs)File ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/devices.py:552, in GPIODevice.__init__(self, pin, pin_factory)    550     raise GPIOPinMissing('No pin given')    551 # Check you can reserve *before* constructing the pin--> 552 self.pin_factory.reserve_pins(self, pin)    553 pin = self.pin_factory.pin(pin)    554 self._pin = pinFile ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/pins/__init__.py:84, in Factory.reserve_pins(self, requester, *names)     78 with self._res_lock:     79     pins = (     80         info     81         for name in names     82         for header, info in self.board_info.find_pin(name)     83     )---> 84     for pin in pins:     85         for reserver_ref in self._reservations[pin]:     86             reserver = reserver_ref()File ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/pins/__init__.py:82, in <genexpr>(.0)     72 """     73 Called to indicate that the device reserves the right to use the     74 specified pin *names*. This should be done during device construction.     75 If pins are reserved, you must ensure that the reservation is released     76 by eventually called :meth:`release_pins`.     77 """     78 with self._res_lock:     79     pins = (     80         info     81         for name in names---> 82         for header, info in self.board_info.find_pin(name)     83     )     84     for pin in pins:     85         for reserver_ref in self._reservations[pin]:File ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/pins/__init__.py:186, in Factory.<lambda>(self)    182 def _get_board_info(self):    183     raise NotImplementedError    185 board_info = property(--> 186     lambda self: self._get_board_info(),    187     doc="""\    188     Returns a :class:`BoardInfo` instance (or derivative) representing the    189     board that instances generated by this factory will be attached to.    190     """)    192 def _get_pi_info(self):    193     warnings.warn(    194         DeprecationWarning(    195             "Please use Factory.board_info instead of Factory.pi_info"))File ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/pins/pi.py:427, in PiFactory._get_board_info(self)    425 def _get_board_info(self):    426     if self._info is None:--> 427         self._info = PiBoardInfo.from_revision(self._get_revision())    428     return self._infoFile ~/.pyenv/versions/3.12.1/envs/raspberry5/lib/python3.12/site-packages/gpiozero/pins/pi.py:310, in PiBoardInfo.from_revision(cls, revision)    308         eth_speed = ethernet * 100    309     except KeyError:--> 310         raise PinUnknownPi(f'unknown old-style revision "{revision:x}"')    311 headers = frozendict({    312     header: HeaderInfo(    313         name=header, rows=rows, columns=columns,   (...)    321     for header, (rows, columns, header_data) in headers.items()    322 })    323 return cls(    324     f'{revision:04x}',    325     model,   (...)    341     board,    342     )PinUnknownPi: unknown old-style revision "0"
Here's my board's revision info:

Code:

root@raspberrypi:~# grep Rev /proc/cpuinfoRevision: d04171Model: Raspberry Pi 5 Model B Rev 1.1

Statistics: Posted by nrz — Sun Jan 19, 2025 9:13 pm



Viewing all articles
Browse latest Browse all 4867

Trending Articles