My kernel version is :
If you use the sysfs method of declaring a port (as input or output), as inLinux raspberrypi 4.1.13+ #826 PREEMPT Fri Nov 13 20:13:22 GMT 2015 armv6l GNU/Linux
Code: Select all
sudo sh -c "echo '25' > /sys/class/gpio/export"You would think that the RPi.GPIO software does the same, but it does not.
Just declaring a port as input or output does not register this in /sys/class/gpio.
If a port is registered in /sys/class/gpio already, you cannot assign it again. As you would expect, you get the warning message that the port is already in use.
Within it's own software environment, (within one Python program) it does also check this, which is why you also can get the warning message that the port is already in use.
All is well, it seems, but can go awry when you use two or more separate programs that are using the GPIO pins. A second program can happily change the settings of a port already in use by another running program, and wreak havoc on your connected hardware.
There is one exception, when you declare a port as having an interrupt, like with "GPIO.wait_for_edge", the particular port does get registered in /sys/class/gpio.
Event detects
Code: Select all
GPIO.add_event_detect(10, GPIO.FALLING)
GPIO.add_event_detect(11, GPIO.FALLING, callback=test)Before I report this as a bug, does anybody else have seen this or do you have comments?
Tks!