Debian / raspi3-image-spec

contains the files to build the https://wiki.debian.org/RaspberryPi3 image
127 stars 32 forks source link

Unable to use GPIO #35

Closed paddatrapper closed 6 years ago

paddatrapper commented 6 years ago

Using this image, Python and sysfs access to the GPIO pins is unavailable. When using Python3 the following happens:

$ sudo python3 bcs.py 
Traceback (most recent call last):
  File "bcs.py", line 18, in <module>
    import RPi.GPIO as GPIO
  File "/usr/lib/python3/dist-packages/RPi/GPIO/__init__.py", line 23, in <module>
    from RPi._GPIO import *
RuntimeError: This module can only be run on a Raspberry Pi!

And using sysfs:

$ sudo -i
# echo "4" > /sys/class/gpio/export
-bash: echo: write error: Invalid argument
xdissent commented 6 years ago

They're offset by 458, so "4" should be "462". You can tell by looking at /sys/kernel/debug/gpio

jlu5 commented 6 years ago

Re RPi.GPIO not working: from what I can tell this is not a Debian-specific issue. Quite a few RPi libraries try to detect the CPU revision (and by extension, system model) from /proc/cpuinfo. But that does not show the required info on 64-bit systems, as reported as https://github.com/raspberrypi/linux/issues/2110.

For Raspberry-GPIO in particular there is https://sourceforge.net/p/raspberry-gpio-python/tickets/161/ for this problem.

paddatrapper commented 6 years ago

Thanks, I have updated the Debian wiki page to include this information.