Your message dated Mon, 05 Dec 2022 17:42:05 +0100
with message-id <2873126.e9J7NaK4W3@bagend>
and subject line Re: Bug fixed
has caused the Debian Bug report #976118,
regarding python3-gpiozero: fails to work with the RPI 4 (on the Debian kernel)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
976118: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=976118
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python3-gpiozero
Version: 1.4.1-1.1
Severity: normal

Dear Maintainer,

gpiozero fails to work with the Debian kernel (as opposed to the
raspberry pi foundation one).

With version 1.4.1, I get:

Traceback (most recent call last):
  File "t2.py", line 4, in <module>
    led = LED(4)
  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/output_devices.py", line 141, 
in __init__
    pin, active_high, initial_value, pin_factory=pin_factory
  File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 47, in 
__init__
    super(OutputDevice, self).__init__(pin, pin_factory=pin_factory)
  File "/usr/lib/python3/dist-packages/gpiozero/mixins.py", line 69, in __init__
    super(SourceMixin, self).__init__(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 375, in 
__init__
    pin = self.pin_factory.pin(pin)
  File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 73, in pin
    pin = self.pin_class(self, n)
  File "/usr/lib/python3/dist-packages/gpiozero/pins/rpigpio.py", line 94, in 
__init__
    super(RPiGPIOPin, self).__init__(factory, number)
  File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 241, in 
__init__
    factory.pi_info.physical_pin(repr(self))
  File "/usr/lib/python3/dist-packages/gpiozero/pins/__init__.py", line 130, in 
<lambda>
    lambda self: self._get_pi_info(),
  File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 90, in 
_get_pi_info
    self._info = pi_info(self._get_revision())
  File "/usr/lib/python3/dist-packages/gpiozero/pins/local.py", line 67, in 
_get_revision
    raise PinUnknownPi('unable to locate Pi revision in /proc/cpuinfo')
gpiozero.exc.PinUnknownPi: unable to locate Pi revision in /proc/cpuinfo


I tried upgrading to the current upstream git tree.
I run in another issue, which is caused by missing support in RPi.GPIO:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 109, in pin
    pin = self.pins[n]
KeyError: 4

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "t2.py", line 4, in <module>
    led = LED(4)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 131, in 
__call__
    self = super(GPIOMeta, cls).__call__(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 217, 
in __init__
    pin, active_high, initial_value, pin_factory=pin_factory
  File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 99, in 
__init__
    super(OutputDevice, self).__init__(pin, pin_factory=pin_factory)
  File "/usr/lib/python3/dist-packages/gpiozero/mixins.py", line 106, in 
__init__
    super(SourceMixin, self).__init__(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 545, in 
__init__
    pin = self.pin_factory.pin(pin)
  File "/usr/lib/python3/dist-packages/gpiozero/pins/pi.py", line 111, in pin
    pin = self.pin_class(self, n)
  File "/usr/lib/python3/dist-packages/gpiozero/pins/rpigpio.py", line 132, in 
__init__
    GPIO.setup(self.number, GPIO.IN, self.GPIO_PULL_UPS[self._pull])
RuntimeError: Not running on a RPi!

That's due to missing support in RPi.GPIO (see #976114 and
https://sourceforge.net/p/raspberry-gpio-python/tickets/191/ ).

After fixing RPi.GPIO with the dirty patch I provided in the upstream ticket, 
gpiozero works fine.

However, gpiozero should also work without RPi.GPIO (see the native pin
factory in the code). Without RPi.GPIO, I get:

/usr/lib/python3/dist-packages/gpiozero/devices.py:289: PinFactoryFallback: 
Falling back from rpigpio: No module named 'RPi'
  'Falling back from %s: %s' % (name, str(e))))
/usr/lib/python3/dist-packages/gpiozero/devices.py:289: PinFactoryFallback: 
Falling back from rpio: No module named 'RPIO'
  'Falling back from %s: %s' % (name, str(e))))
/usr/lib/python3/dist-packages/gpiozero/devices.py:289: PinFactoryFallback: 
Falling back from pigpio: No module named 'pigpio'
  'Falling back from %s: %s' % (name, str(e))))
/usr/lib/python3/dist-packages/gpiozero/devices.py:289: PinFactoryFallback: 
Falling back from native: [Errno 1] Operation not permitted
  'Falling back from %s: %s' % (name, str(e))))
Traceback (most recent call last):
  File "t2.py", line 4, in <module>
    led = LED(4)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 131, in 
__call__
    self = super(GPIOMeta, cls).__call__(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 217, 
in __init__
    pin, active_high, initial_value, pin_factory=pin_factory
  File "/usr/lib/python3/dist-packages/gpiozero/output_devices.py", line 99, in 
__init__
    super(OutputDevice, self).__init__(pin, pin_factory=pin_factory)
  File "/usr/lib/python3/dist-packages/gpiozero/mixins.py", line 106, in 
__init__
    super(SourceMixin, self).__init__(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 536, in 
__init__
    super(GPIODevice, self).__init__(**kwargs)
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 250, in 
__init__
    Device.pin_factory = Device._default_pin_factory()
  File "/usr/lib/python3/dist-packages/gpiozero/devices.py", line 290, in 
_default_pin_factory
    raise BadPinFactory('Unable to load any default pin factory!')
gpiozero.exc.BadPinFactory: Unable to load any default pin factory!


This is known upstream, and there's a PR in progress:
https://github.com/gpiozero/gpiozero/pull/900

Lucas



-- System Information:
Debian Release: 10.6
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: arm64 (aarch64)

Kernel: Linux 5.8.0-0.bpo.2-arm64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_CRAP
Locale: LANG=en_DK.UTF-8, LC_CTYPE=C.UTF-8 (charmap=locale: Cannot set 
LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
UTF-8), LANGUAGE=en_DK.UTF-8 (charmap=locale: Cannot set LC_MESSAGES to default 
locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages python3-gpiozero depends on:
ii  python3           3.7.3-1
ii  python3-rpi.gpio  0.7.0-0.2

python3-gpiozero recommends no packages.

Versions of packages python3-gpiozero suggests:
pn  python-pigpio  <none>

--- End Message ---
--- Begin Message ---
On 27 May 2022 18:25:15 +0200 Philippe SWARTVAGHER <[email protected]> wrote:
> Control: fixed -1 1.6.2-1

Closing this bug as the issue *is* fixed.

> Could you consider backporting the package currently in testing into
> bullseye-backports?

Please open a separate wishlist bug for that.

Attachment: signature.asc
Description: This is a digitally signed message part.


--- End Message ---

Reply via email to