Accessing GPIOs over pin 26 causes an exception on a Pi 4B
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
rpi.gpio (Ubuntu) |
Invalid
|
Medium
|
Unassigned | ||
Bionic |
Triaged
|
Undecided
|
Unassigned | ||
Focal |
Triaged
|
Undecided
|
Unassigned |
Bug Description
[Impact]
With Focal running on a Pi 4B accessing any GPIO over 26 causes an exception:
$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as gpio
>>> print(gpio.VERSION)
0.6.5
>>> gpio.setmode(
>>> gpio.setup(22, gpio.IN)
>>> gpio.setup(24, gpio.IN)
>>> gpio.setup(26, gpio.IN)
>>> gpio.setup(32, gpio.IN)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: The channel sent is invalid on a Raspberry Pi
Note that the above works fine on a Pi 3A+. Also, works fine on a Pi 4B after installing python3-rpi.gpio from Groovy:
$ python3
Python 3.8.5 (default, Jul 28 2020, 12:59:40)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO as gpio
>>> gpio.setmode(
>>> print(gpio.VERSION)
0.7.0
>>> gpio.setmode(
>>> gpio.setup(22, gpio.IN)
>>> gpio.setup(24, gpio.IN)
>>> gpio.setup(26, gpio.IN)
>>> gpio.setup(32, gpio.IN)
>>> gpio.setup(36, gpio.IN)
>>> gpio.setup(38, gpio.IN)
>>> gpio.setup(40, gpio.IN)
[Test Case]
See above.
[Fix]
Backport version 0.7.0-0.2 from Groovy to Focal. The changes between Focal's 0.6.5 and Groovy's 0.7.0 are mostly fixes for Pi 4B support so backporting is easier/cleaner than applying individual fixes to 0.6.5.
[Regression Potential]
If this introduces a regression, users would probably see Python exceptions similar to what is shown above.
description: | updated |
Changed in rpi.gpio (Ubuntu): | |
importance: | Undecided → Medium |
status: | New → Invalid |
Changed in rpi.gpio (Ubuntu Focal): | |
status: | New → Triaged |
Changed in rpi.gpio (Ubuntu Bionic): | |
status: | New → Triaged |
The Pi is not properly detected with 0.6.5: RPI_INFO)
>>> print(gpio.
{'P1_REVISION': 2, 'REVISION': 'b03112', 'TYPE': 'Model B', 'MANUFACTURER': 'Sony', 'PROCESSOR': 'Unknown', 'RAM': 'Unknown'}
Probably needs: /sourceforge. net/p/raspberry -gpio-python/ code/ci/ 03be41933c1b4fa b3aa0daf2931adb 4561029bd1/ /sourceforge. net/p/raspberry -gpio-python/ code/ci/ 3fe31bd67745a33 4cd7a33ba441ddf 1993208b55/
https:/
https:/