Use /proc/device-tree/compatible to extract platform infos
A Python module to control the GPIO on a Raspberry Pi
Brought to you by:
croston
On some distributions, like SLES and openSUSE, the /proc/cpuinfo is not modified to include the Hardware and Revision fields. Enough information can be found in /proc/device-tree/compatible. See the upstream kernel Documentation/devicetree/bindings/arm/bcm/brcm,bcm2835.txt for the possible values to expect.
To avoid any regression for raspbian users, the device-tree data are used as a fallback if nothing can be found in cpuinfo.
The attached patch works like a charm on a SLES running on RPi 3.
Updated the patch: len variable was used instead of linelen, discard the first patch
Hello Sir,
I did all changes in cpuinfo.c file . then I got another error i.e Import Error: undefinded symbol /usr/lib64/python2.7/site-packages/ROi/_GPIO.so : Undefined symbol strn
In all cases you can find the package with the patch here:
https://build.opensuse.org/package/show/hardware/python-RPi.GPIO