This module can only be run on a Raspberry Pi!
A Python module to control the GPIO on a Raspberry Pi
Brought to you by:
croston
I'm unable to use this package on a Raspberry Pi running Gentoo.
System details:
Linux 4.20.1-v8+
Python 2.7.15 and 3.6.6
RPi.GPIO 0.6.5 and latest development version (reports version as 0.6.5)
All combinations of these fail with the same error (code below from Python 2.7 with development version):
>>> import RPi.GPIO as GPIO Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/root/.local/lib64/python2.7/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!
I've confirmed that I'm able to use the GPIO pins from the terminal, so they're functional.
This is most likely a duplicate of #161 in that RPi.GPIO currently expects to find revision information under /proc/cpuinfo. On arm64 and other alternate kernels this information is only present in /proc/device-tree/system/linux,revision. I've posted a patch to fix this properly (with fallback to /proc/cpuinfo) under #161 but the comment is currently awaiting approval. Might see if I can dig out my mercurial skills in a bit and post it as a PR (or whatever SF's equivalent is).
This worked great, I was able to import the module without any problems after patching it. Thanks.
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
I'm able to install and import the module, at least, so the original issue seems to have been fixed.
I'll post an update when I've had a chance to test toggling output.
In release 0.7.0