Public bug reported:

A recent update to Ubuntu 24.04 seems to have broken gpiozero on Raspberry Pi 
5. This seems to be due to a change in the gpiochip number (from 4 to 0) as 
outlined in the issue here:
https://github.com/gpiozero/gpiozero/issues/1166
According to the above this seems to have been fixed in a post release for 
gpiozero v2.0.1. Can this fix be merged into this package?

My issue is the similar to the one in the link above. I'm not sure which
update/kernel version started this behavior, but I am currently on
Ubuntu 24.04.5 LTS with kernel version Linux 6.8.0-1065-raspi. gpiozero
version 2.0.1-0ubuntu1. gpiozero code previously worked fine prior to
updating the system.

This is my first bug report, so I apologize if I missed anything.

Example:
$ python3
Python 3.12.3 (main, Aug 31 2026, 10:18:26) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gpiozero
>>> b = gpiozero.Button(3)
/usr/lib/python3/dist-packages/gpiozero/devices.py:300: PinFactoryFallback: 
Falling back from lgpio: 'can not open gpiochip'
  warnings.warn(
/usr/lib/python3/dist-packages/gpiozero/devices.py:300: PinFactoryFallback: 
Falling back from rpigpio: No module named 'RPi'
  warnings.warn(
/usr/lib/python3/dist-packages/gpiozero/devices.py:300: PinFactoryFallback: 
Falling back from pigpio: No module named 'pigpio'
  warnings.warn(
/usr/lib/python3/dist-packages/gpiozero/devices.py:300: PinFactoryFallback: 
Falling back from native: unable to open /dev/gpiomem or /dev/mem; upgrade your 
kernel or run as root
  warnings.warn(
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 108, in 
__call__
    self = super().__call__(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 412, in 
__init__
    super().__init__(
  File "/usr/lib/python3/dist-packages/gpiozero/mixins.py", line 417, in 
__init__
    super().__init__(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 162, in 
__init__
    super().__init__(
  File "/usr/lib/python3/dist-packages/gpiozero/mixins.py", line 243, in 
__init__
    super().__init__(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/input_devices.py", line 79, in 
__init__
    super().__init__(pin, pin_factory=pin_factory)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 544, in 
__init__
    super().__init__(pin_factory=pin_factory)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 245, in 
__init__
    Device.ensure_pin_factory()
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 270, in 
ensure_pin_factory
    Device.pin_factory = Device._default_pin_factory()
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 302, in 
_default_pin_factory
    raise BadPinFactory('Unable to load any default pin factory!')
gpiozero.exc.BadPinFactory: Unable to load any default pin factory!

** Affects: gpiozero (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2172270

Title:
  Kernel update breaks pin factory

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gpiozero/+bug/2172270/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to