Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] GPIO Sysfs path mismatch #8

Open
j3ffrw opened this issue Mar 19, 2022 · 0 comments
Open

[BUG] GPIO Sysfs path mismatch #8

j3ffrw opened this issue Mar 19, 2022 · 0 comments

Comments

@j3ffrw
Copy link

j3ffrw commented Mar 19, 2022

Given the ff. test code
$ cat test-gpio.py

import RPi.GPIO as GPIO
PIN = 11
GPIO.setmode(GPIO.BOARD)
GPIO.setup(PIN, GPIO.IN)
def test(channel):
  pass

GPIO.add_event_detect(11, GPIO.BOTH, test)

Results in

Traceback (most recent call last):
  File "test-gpio.py", line 8, in <module>
    GPIO.add_event_detect(11, GPIO.BOTH, test)
RuntimeError: Failed to add edge detection  

strace shows driver access

openat(AT_FDCWD, "/sys/class/aml_gpio/export", O_WRONLY) = -1 ENOENT (No such file or directory)

but actual is

# ll /sys/class/ | grep gpio
drwxr-xr-x  2 root root 0 Jan  1  1970 gpio/
drwxr-xr-x  2 root root 0 Jan 10 12:56 meson-gpiomem/

Current workaround for me was to override odroid_found to 0
https://github.com/jfath/RPi.GPIO-Odroid/blob/master/source/cpuinfo.c#L54

reference docs
https://wiki.odroid.com/troubleshooting/gpiomem#rootless_gpio_sys-filesystemsysclassgpio

Additional Info
$ pip list | grep GPIO
RPi.GPIO 0.6.3.post1
https://odroid.in/ubuntu_20.04lts/c0_c1/ubuntu-20.04-3.10-minimal-odroid-c1-20200519.img.xz

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

$ cat /proc/cpuinfo
Processor : ARMv7 Processor rev 1 (v7l)
processor : 0
BogoMIPS : 4.62

processor : 1
BogoMIPS : 4.62

processor : 2
BogoMIPS : 4.62

processor : 3
BogoMIPS : 4.62

Features : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part : 0xc05
CPU revision : 1

Hardware : ODROIDC
Revision : 000a
Serial : 1b00000000000000

$ uname -ar
Linux odroid 3.10.107-25 #2 SMP PREEMPT Wed Feb 3 13:41:38 -02 2021 armv7l armv7l armv7l GNU/Linux

$ dmesg | grep gpio
[ 0.705546] amlogic_gpio gpio: Probed amlogic GPIO driver

$ lsmod | grep gpio
w1_gpio 3465 0
wire 20495 1 w1_gpio
meson_gpiomem 3455 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant