Hi!
I just tried an aarch64 kernel on a RasPi 3 B+ (booted Devuan "ASCII"), and found that "This module can only be run on a Raspberry Pi!", because in aarch64, the "Hardware" and "Revision" aren't any longer in /proc/cpuinfo.
Similar information can be obtained:
root@astroreader:/proc/device-tree/system# cat linux,serial |xxd
00000000: 0000 0000 6d1e 9c7d ....m..}
root@astroreader:/proc/device-tree/system# cat linux,revision |xxd
00000000: 00a0 20d3 .. .
root@astroreader:/proc/device-tree# cat model
Raspberry Pi 3 Model B Plus Rev 1.3
root@astroreader:/proc/device-tree# cat serial-number
000000006d1e9c7d
The very same information cat be obtained from a genuine Raspbian kernel / installation.
I hacked in an (inproper) quick patch:
(didn't check manufacturer) and this makes GPIO useable for my usage case: check 3 GPIO pins for events (three simple buttons attached.) Though there are some warnings while building it:
Is this Python module still maintained? I'd quite like to work on this. Maybe by just letting the code call a wrapper function that first tries the "old" method and then tries the generic aarch64 locations to gain the needed information?
The project is still maintained but doesn't get much attention any more. If you produce a patch for this issue, I will happily include it to the module.
A new release is probably due soon to include a few miscellaneous patches.
Hi Ben - just attaching a patch for this. It gives priority to /proc/device-tree/system/linux,revision as this appears to be available on all distros now (including Raspbian), but still contains a fallback to the classic /proc/cpuinfo in order to continue supporting older releases that don't have /proc/device-tree.
The patch has been included and modified because it broke the detection of early boards. Could you please test the latest development copy on aarch64 and confirm that it works.
The commands to install it will be something along the lines of:
$ sudo apt install mercurial
$ pip3 install --upgrade hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO
Brilliant, thanks Ben. Sorry about the old board detection - I should've used "%04x" in the sprintf call to match the old format. Anyway, I'll give this a whirl today.
Tested on a Pi 3B under aarch64; works nicely - many thanks!
In release 0.7.0
Ben thanks, that all right!
Last edit: Shamkin Roman Alexandrovich 2021-04-12