On 06/14/2018 05:43 PM, Freek de Kruijf wrote:
Op woensdag 13 juni 2018 15:58:25 CEST schreef Alexander Graf:
On 13.06.18 14:27, Freek de Kruijf wrote:
I am using a Raspberry Pi 1B to count some pulses on one of the GPIO pins,
using Python script. This script runs fine on an older version of
Tumbleweed, namely 20160625.
When I run my script on the current version, 20180502, it throws an error
message:
GPIO.add_event_detect(PIN, GPIO.FALLING, callback=cb, bouncetime=100)
RuntimeError: Failed to add edge detection
Try to find out who throws that error. Maybe just grep for the error
message in the python library directory.
Another thing that may give hints is to run strace on your application
and see what it tries to access before and what doesn't work?
I found a message from Frank Kunz about using the pins via sysfs, of which
I have the feeling this related. Maybe not!
The solution that was mentioned was installing the pinmux driver. However
I
can't find such a thing.
The in-kernel pinmux driver is =y, so no need to install or load anything:
https://kernel.opensuse.org/cgit/kernel-source/tree/config/armv6hl/default#n
3208
Alex
I used the strace and found that in fact the equivalent bash command:
echo "4" > /sys/class/gpio/export
gives the error message:
-bash: echo: write error: Invalid argument
This command should create new devices /sys/class/gpio/gpio4/* which one can
use to change the behavior of the GPIO pins.
What can be done to make this basic bash command work.
Below some more information as root:
# ls -l /sys/class/gpio/
total 0
--w------- 1 root root 4096 jun 14 17:41 export
lrwxrwxrwx 1 root root 0 apr 23 09:40 gpiochip298 -> ../../devices/
platform/soc/20200000.gpio/gpio/gpiochip298
--w------- 1 root root 4096 jun 14 16:34 unexport
Sounds like the library doesn't realize that there is an offset for GPIO
numbers on the system. The DT usually indicates what the respective
offset is.
Alex
--
To unsubscribe, e-mail: [email protected]
To contact the owner, e-mail: [email protected]