Hi,
I've got a Raspberry Pi 4B in which I am using Arch Linux ARMv8. I realized I have some information related to hardware missing in /proc/cpuinfo, so I cannot make Python RPi.GPIO (both AUR package and PiPy one) recognize my device:
$this->bbcode_second_pass_code('', '$ python
Python 3.8.6 (default, Oct 6 2020, 22:56:58)
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import RPi.GPIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!
>>> import RPi.GPIO as GPIO
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/site-packages/RPi/GPIO/__init__.py", line 23, in <module>
from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!')
My /proc/cpuinfo is as follows:
$this->bbcode_second_pass_code('', 'processor : 0
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 1
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 2
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 3
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
')
Compared to Raspbian (https://www.raspberrypi.org/forums/viewtopic.php?t=243882), in the bottom of the file there are a Hardware, Serial Number and Revision entries. Creating a copy in my home directory, adding the lacking information from the directory /proc/cpuinfo, and therefore editing the source code of the RPi.GPIO release to look into this new file I managed to make the package work, but I would like to know if it is possible to permanently add these fields into /proc/cpuinfo file, or at least there is a proper way to get the package working.
My "fake" ~/cpuinfo:
$this->bbcode_second_pass_code('', '
processor : 0
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 1
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 2
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
processor : 3
BogoMIPS : 108.00
Features : fp asimd evtstrm crc32 cpuid
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x0
CPU part : 0xd08
CPU revision : 3
Hardware : BCM2711
Serial : XXXXXXXXXXX
Model : Raspberry Pi 4 Model B
Revision : c03111
')
Thanks,