[opensuse-arm] Trying to use GPIO using /sys/class/gpio/
I tried to use "echo '23' > /sys/class/gpio/export" as root on a Raspberry Pi 1B, but I get an error message. Tried other values as 23 also, but I continue to get the error message. Any hints? -- fr.gr. member openSUSE Freek de Kruijf -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi, What is the error message? Which kernel? Guillaume ----- Freek de Kruijf <freek@opensuse.org> a écrit :
I tried to use "echo '23' > /sys/class/gpio/export" as root on a Raspberry Pi 1B, but I get an error message. Tried other values as 23 also, but I continue to get the error message.
Any hints?
-- fr.gr.
member openSUSE Freek de Kruijf
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Op woensdag 25 mei 2016 10:24:44 schreef guillaume.gardet@free.fr:
Hi,
What is the error message?
# LC_ALL=C echo '23' > /sys/class/gpio/export -bash: echo: write error: Invalid argument
Which kernel?
# uname -a Linux rpizpf 4.5.4-1-default #1 Wed May 11 15:23:21 UTC 2016 (db90c25) armv6l armv6l armv6l GNU/Linux
Guillaume
----- Freek de Kruijf <freek@opensuse.org> a écrit :
I tried to use "echo '23' > /sys/class/gpio/export" as root on a Raspberry Pi 1B, but I get an error message. Tried other values as 23 also, but I continue to get the error message.
Any hints?
-- fr.gr. member openSUSE Freek de Kruijf -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Op woensdag 25 mei 2016 10:16:14 schreef Freek de Kruijf:
I tried to use "echo '23' > /sys/class/gpio/export" as root on a Raspberry Pi 1B, but I get an error message. Tried other values as 23 also, but I continue to get the error message.
Any hints?
I managed to compile the package RPi.GPIO, a plugin for python to control GPIO interfaces on the RPi. I was able to us this package to turn on and off a connected LED. And to read a low and high value of such a port. However waiting for a falling signal produced an error message. Maybe this is related to the above problem. The version of RPi.GPIO I used is 0.6.2. I used a spec file from OBS, but the version in OBS is 0.3.1a. In my home on OBS I tried to build 0.6.2. -- fr.gr. member openSUSE Freek de Kruijf -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Op woensdag 25 mei 2016 10:16:14 schreef Freek de Kruijf:
I tried to use "echo '23' > /sys/class/gpio/export" as root on a Raspberry Pi 1B, but I get an error message. Tried other values as 23 also, but I continue to get the error message.
Any hints?
I found the answer in https://www.kernel.org/doc/Documentation/gpio/sysfs.txt The documentation of the Rasberry Pi does not mention anything about the device /sys/class/gpio/gpiochipX, apparently in other systems X is 0, however openSUSE shows /sys/class/gpio/gpiochip298. base and ngpio show respectively 298 and 54. So I should use channel 298+23, which after use does not give an error message and shows that /sys/class/gpio321 has been created. -- fr.gr. member openSUSE Freek de Kruijf -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
participants (2)
-
Freek de Kruijf
-
guillaume.gardet@free.fr