[opensuse-arm] Control output pin on RPi
Has anyone ever managed to control an output pin on a raspberry pi 3 B+? Don't laugh! Using python gpiozero [2] a few days ago produced crash output indicating 4 different ways of accessing IO pins were tried and all failed. [1] (Running as root worked no better.) Now the same thing dies with Traceback (most recent call last): File "/usr/lib/python3.6/site-packages/gpiozero/pins/pi.py", line 71, in pin pin = self.pins[n] KeyError: 4 During handling of the above exception, another exception occurred: ... File "/usr/lib/python3.6/site-packages/gpiozero/pins/local.py", line 67, in _get_revision raise PinUnknownPi('unable to locate Pi revision in /proc/cpuinfo') gpiozero.exc.PinUnknownPi: unable to locate Pi revision in /proc/cpuinfo indicating someone's relying on what looks like proprietory kernel extensions. Trying wiringpi means installing the whole gcc lafaffel, on a minimal system. Is there a something like a 3-liner cli program that can flick an output pin on request and JUST WORKS(TM) on openSUSE? (leap 15) Thanks, Volker [1] /usr/lib/python3.6/site-packages/gpiozero/devices.py:452: PinFactoryFallback: Falling back from rpigpio: module 'RPi.GPIO' has no attribute 'IN' 'Falling back from %s: %s' % (name, str(e)))) /usr/lib/python3.6/site-packages/gpiozero/devices.py:452: PinFactoryFallback: Falling back from rpio: No module named 'RPIO' 'Falling back from %s: %s' % (name, str(e)))) /usr/lib/python3.6/site-packages/gpiozero/devices.py:452: PinFactoryFallback: Falling back from pigpio: failed to connect to localhost:8888 'Falling back from %s: %s' % (name, str(e)))) /usr/lib/python3.6/site-packages/gpiozero/devices.py:452: PinFactoryFallback: Falling back from native: unable to open /dev/gpiomem or /dev/mem; upgrade your kernel or run as root 'Falling back from %s: %s' % (name, str(e)))) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Can't connect to pigpio at localhost(8888) Did you start the pigpio daemon? E.g. sudo pigpiod Did you specify the correct Pi host/port in the environment variables PIGPIO_ADDR/PIGPIO_PORT? E.g. export PIGPIO_ADDR=soft, export PIGPIO_PORT=8888 Did you specify the correct Pi host/port in the pigpio.pi() function? E.g. pigpio.pi('soft', 8888) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Traceback (most recent call last): File "./pi-out-set", line 7, in <module> from gpiozero import LED File "/usr/lib/python3.6/site-packages/gpiozero/__init__.py", line 22, in <module> from .devices import ( File "/usr/lib/python3.6/site-packages/gpiozero/devices.py", line 486, in <module> Device.pin_factory = _default_pin_factory() File "/usr/lib/python3.6/site-packages/gpiozero/devices.py", line 453, in _default_pin_factory raise BadPinFactory('Unable to load any default pin factory!') gpiozero.exc.BadPinFactory: Unable to load any default pin factory! [2] from gpiozero import LED import sys out = LED(4) state = sys.argv[1] if state == "on" or state == "1": out.on() else: out.off() -- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On Tue 04 Sep 2018 01:49:49 PM CDT, Volker Kuhlmann wrote: <snip>
Trying wiringpi means installing the whole gcc lafaffel, on a minimal system.
<snip> Hi If you want to try wiringPi it has been updated for RPi3 B+? https://build.opensuse.org/package/binaries/home:malcolmlewis:SLES12-SP2-RPI... -- Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890) SLES 15 | GNOME Shell 3.26.2 | 4.12.14-25.16-default HP 255 G4 Notebook | E2-7110 X4 @ 1.80 GHz | AMD Radeon R3 up 4 days 13:34, 2 users, load average: 0.95, -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On Tue 04 Sep 2018 13:58:43 NZST +1200, Malcolm wrote:
If you want to try wiringPi it has been updated for RPi3 B+? https://build.opensuse.org/package/binaries/home:malcolmlewis:SLES12-SP2-RPI...
Great, thanks! zypper ar -k -f https://download.opensuse.org/repositories/home:/malcolmlewis:/SLES12-SP2-RP... zypper in wiringPi wiringPi-devel zypper in --no-recommends gcc gcc -Wall -o blink blink.c -lwiringPi /usr/lib64/gcc/aarch64-suse-linux/7/../../../../lib64/libwiringPi.so: undefined reference to `crypt' /usr/lib64/gcc/aarch64-suse-linux/7/../../../../lib64/libwiringPi.so: undefined reference to `pthread_join' /usr/lib64/gcc/aarch64-suse-linux/7/../../../../lib64/libwiringPi.so: undefined reference to `pthread_create' /usr/lib64/gcc/aarch64-suse-linux/7/../../../../lib64/libwiringPi.so: undefined reference to `pow' /usr/lib64/gcc/aarch64-suse-linux/7/../../../../lib64/libwiringPi.so: undefined reference to `shm_open' /usr/lib64/gcc/aarch64-suse-linux/7/../../../../lib64/libwiringPi.so: undefined reference to `pthread_cancel' collect2: error: ld returned 1 exit status Oops. Nothing to lose, let's play: gcc -Wall -o blink blink.c -lwiringPi -lcrypt -pthread -lm -lrt -rwx------ 1 test test 75192 2018-09-04 15:40 blink* WTF?!?? Volker -- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
The example from http://wiringpi.com/examples/blink/ gcc -Wall -o blink blink.c -lwiringPi -lcrypt -pthread -lm -lrt # ./blink wiringPiSetup: mmap (GPIO) failed: Operation not permitted (yes this is as root) Back to my original question: Has anyone managed to flick a GPIO pin with openSUSE on an RPi yet? Volker -- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Am 04.09.2018 um 06:29 schrieb Volker Kuhlmann:
The example from http://wiringpi.com/examples/blink/
gcc -Wall -o blink blink.c -lwiringPi -lcrypt -pthread -lm -lrt
# ./blink wiringPiSetup: mmap (GPIO) failed: Operation not permitted (yes this is as root)
I can't repeat often enough: Forget wiringPi! Its author doesn't understand Open Source and openly refused patches to make things work on openSUSE. Also it's under LGPLv3 and thus incompatible with any GPLv2-only projects.
Back to my original question: Has anyone managed to flick a GPIO pin with openSUSE on an RPi yet?
Sure, I have. It's as simple as echo, no libraries needed. The "official" Linux GPIO library to supersede the legacy sysfs interface is libgpiod. mraa might work as convenience wrapper, but never tried it myself. Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On Tue 04 Sep 2018 23:56:11 NZST +1200, Andreas Färber wrote:
I can't repeat often enough: Forget wiringPi!
Very happy to. Anything that works. Out of the box would be good. ;-)
Sure, I have. It's as simple as echo, no libraries needed.
Sounds great. Where do I look for info?
The "official" Linux GPIO library to supersede the legacy sysfs interface is libgpiod.
Cool. Bonus if it's easy to use. zypper search libgpiod No matching items found. zypper search libgpio No matching items found. It's in the hardware repo. No complaints there, but https://build.opensuse.org/package/show/hardware/libgpiod shows libgpiod as disabled for ARM. Why? Does it not compile on ARM?? http://download.opensuse.org/repositories/hardware/openSUSE_Factory_ARM/ which I have already configured doesn't have it.
mraa might work as convenience wrapper, but never tried it myself.
Might, but probably not if what it's wrapping isn't there... At least the blink examples compile without any issue and don't crash when run, but exit with error (as expected). Sorry to say but doing something trivial with a play platform like an RPi is beyond a joke. Volker -- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Sure, I have. It's as simple as echo, no libraries needed.
OK, found something. ls -1 /sys/class/gpio/ export gpiochip458 unexport echo 462 >/sys/class/gpio/export ls -1 /sys/class/gpio/ export gpio462 gpiochip458 unexport https://www.kernel.org/doc/Documentation/gpio/sysfs.txt Is a little obtuse about the pin number needing to be added to that 458. How do the pin numbers in sysfs on leap 15.0 correspond to the pins on the RPi header? Pin 4 (462) appears not to correlate with GPIO4 (pin 7 of the 2x20 pin header). Searching the net is a bit fruitless as everyone seems to assume they're running raspbian... Thanks muchly, Volker -- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On 05.09.18 09:34, Volker Kuhlmann wrote:
Sure, I have. It's as simple as echo, no libraries needed.
OK, found something.
ls -1 /sys/class/gpio/ export gpiochip458 unexport
echo 462 >/sys/class/gpio/export ls -1 /sys/class/gpio/ export gpio462 gpiochip458 unexport
https://www.kernel.org/doc/Documentation/gpio/sysfs.txt Is a little obtuse about the pin number needing to be added to that 458.
How do the pin numbers in sysfs on leap 15.0 correspond to the pins on the RPi header? Pin 4 (462) appears not to correlate with GPIO4 (pin 7 of the 2x20 pin header). Searching the net is a bit fruitless as everyone seems to assume they're running raspbian...
You need to first make sure the pin is muxed properly as GPIO and not associated with a special function: /sys/kernel/debug/pinctrl/3f200000.gpio/pinmux-pins Once that's clear, you can use the GPIO export to actually access the GPIO function. For that, add the "base" (458) to the BCM number from here: https://pinout.xyz/ and add an export like you did above :). Alex -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On Wed 05 Sep 2018 19:42:18 NZST +1200, Alexander Graf wrote:
You need to first make sure the pin is muxed properly as GPIO and not associated with a special function:
/sys/kernel/debug/pinctrl/3f200000.gpio/pinmux-pins
Once that's clear, you can use the GPIO export to actually access the GPIO function.
Ahh, how obvious... ;-) Thanks! OK, makes sense. grep gpio4 pinmux-pins says pin 4 (gpio4): (MUX UNCLAIMED) (GPIO UNCLAIMED) and I guess it ought to not say "MUX UNCLAIMED". But I can't find how to do that. All online instructions go straight to exporting the pin (assuming a base of 0...). Appending [all] gpio=4=op,dh gpio=462=op,dh to /boot/efi/extraconfig.txt and rebooting makes no difference. I'm stuck again :-( Thanks, Volker -- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On 05.09.18 11:00, Volker Kuhlmann wrote:
On Wed 05 Sep 2018 19:42:18 NZST +1200, Alexander Graf wrote:
You need to first make sure the pin is muxed properly as GPIO and not associated with a special function:
/sys/kernel/debug/pinctrl/3f200000.gpio/pinmux-pins
Once that's clear, you can use the GPIO export to actually access the GPIO function.
Ahh, how obvious... ;-) Thanks! OK, makes sense. grep gpio4 pinmux-pins says pin 4 (gpio4): (MUX UNCLAIMED) (GPIO UNCLAIMED) and I guess it ought to not say "MUX UNCLAIMED".
But I can't find how to do that. All online instructions go straight to exporting the pin (assuming a base of 0...).
Appending [all] gpio=4=op,dh gpio=462=op,dh to /boot/efi/extraconfig.txt and rebooting makes no difference.
I'm stuck again :-(
Looks like the pin muxing actually happens automatically :) rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_in in hi; irq 83 (none) rpi:~ # echo $(( 458 + 4 )) > /sys/class/gpio/export rpi:~ # echo out > /sys/class/gpio/gpio462/direction rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) rpi:~ # echo 1 > /sys/class/gpio/gpio462/value rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in hi; irq 83 (none) Alex -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Op woensdag 5 september 2018 11:06:28 CEST schreef Alexander Graf:
On 05.09.18 11:00, Volker Kuhlmann wrote:
I did generate rpm's in the beginning of this year for armv6hl, armv7hl, and aarch64 on openSUSE Tumbleweed, using the source file RPi.GPIO-0.6.3.tar.gz with my own patches to overcome the problem with a non-zero in gpiochip, both for Python 2 and 3. So in total 6 files. I did this on my three different RPi's. I am using only the Python 2 version on a RPi A (armv6hl). I do have patch files and the .spec file to build these packages with rpmbuild. I assume these rpm's are usable on other versions of openSUSE or even on other OSes. With these rpm packages you can use the examples for Python to manipulate pins and to run some action on an event that occurred on a pin. The library also provides two types of pin mapping. See the documentation. -- 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
On Wed 05 Sep 2018 21:06:28 NZST +1200, Alexander Graf wrote:
rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_in in hi; irq 83 (none) rpi:~ # echo $(( 458 + 4 )) > /sys/class/gpio/export rpi:~ # echo out > /sys/class/gpio/gpio462/direction rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) rpi:~ # echo 1 > /sys/class/gpio/gpio462/value rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in hi; irq 83 (none)
Ah, getting closer. This one starts with "in lo", and stays "in lo" aver after writing 1 to value: # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_in in lo; irq 83 (none) # echo 462 > /sys/class/gpio/export # echo out > /sys/class/gpio/gpio462/direction # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) # echo 1 > /sys/class/gpio/gpio462/value # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) # echo 0 > /sys/class/gpio/gpio462/value # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) # echo 1 > /sys/class/gpio/gpio462/value # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) This is the one that needed enable_uart=0 in extraconfig.txt or it would stop on boot probably thinking there was serial line input... So probably dodgy hardware. The pin is always supplying enough power for a base of an NPN (emitter to ground) to make that NPN conductive at least slightly. There was another person on the Internet whos pins wouldn't switch until after he got his RPi replaced. I'll have a word with Element14. Trying the same in a different RPi fails currently - when I swap the two microSD cards between the 2 RPis neither of them boots any more. Hmm. Volker -- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
On Mittwoch, 5. September 2018 13:01:26 CEST Volker Kuhlmann wrote:
On Wed 05 Sep 2018 21:06:28 NZST +1200, Alexander Graf wrote:
rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_in in hi; irq 83 (none) rpi:~ # echo $(( 458 + 4 )) > /sys/class/gpio/export rpi:~ # echo out > /sys/class/gpio/gpio462/direction rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) rpi:~ # echo 1 > /sys/class/gpio/gpio462/value rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in hi; irq 83 (none)
Ah, getting closer. This one starts with "in lo", and stays "in lo" aver after writing 1 to value:
# grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_in in lo; irq 83 (none) # echo 462 > /sys/class/gpio/export # echo out > /sys/class/gpio/gpio462/direction # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) # echo 1 > /sys/class/gpio/gpio462/value # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) # echo 0 > /sys/class/gpio/gpio462/value # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) # echo 1 > /sys/class/gpio/gpio462/value # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none)
This is the one that needed enable_uart=0 in extraconfig.txt or it would stop on boot probably thinking there was serial line input... So probably dodgy hardware. The pin is always supplying enough power for a base of an NPN (emitter to ground) to make that NPN conductive at least slightly. There was another person on the Internet whos pins wouldn't switch until after he got his RPi replaced. I'll have a word with Element14.
Can confirm there seems to be something wrong with the RPis GPIOs. Even tried to directly write to the registers from U-Boot, some pins worked as expected, some did not. Went through all the relevant registers - function-MUX, directions, drive strenght, ... - nothing helped. The pins worked neither as function pins (I2C in my case) nor as GPIOs. Some days/weeks later it suddenly worked again for some time. Kind regards, Stefan-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi, ----- Alexander Graf <agraf@suse.de> a écrit :
On 05.09.18 11:00, Volker Kuhlmann wrote:
On Wed 05 Sep 2018 19:42:18 NZST +1200, Alexander Graf wrote:
You need to first make sure the pin is muxed properly as GPIO and not associated with a special function:
/sys/kernel/debug/pinctrl/3f200000.gpio/pinmux-pins
Once that's clear, you can use the GPIO export to actually access the GPIO function.
Ahh, how obvious... ;-) Thanks! OK, makes sense. grep gpio4 pinmux-pins says pin 4 (gpio4): (MUX UNCLAIMED) (GPIO UNCLAIMED) and I guess it ought to not say "MUX UNCLAIMED".
But I can't find how to do that. All online instructions go straight to exporting the pin (assuming a base of 0...).
Appending [all] gpio=4=op,dh gpio=462=op,dh to /boot/efi/extraconfig.txt and rebooting makes no difference.
I'm stuck again :-(
Looks like the pin muxing actually happens automatically :)
rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_in in hi; irq 83 (none) rpi:~ # echo $(( 458 + 4 )) > /sys/class/gpio/export rpi:~ # echo out > /sys/class/gpio/gpio462/direction rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in lo; irq 83 (none) rpi:~ # echo 1 > /sys/class/gpio/gpio462/value rpi:~ # grep 'pin 4 ' /sys/kernel/debug/pinctrl/3f200000.gpio/pins pin 4 (gpio4) function gpio_out in hi; irq 83 (none)
For information, I created a wiki page for GPIO as it seems to be a problem for some people: https://en.opensuse.org/openSUSE:GPIO It is general usage information, not specific to a board (even if there are output examples) Guillaume
Alex -- 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
On Thu 06 Sep 2018 03:42:50 NZST +1200, Guillaume GARDET wrote:
For information, I created a wiki page for GPIO as it seems to be a problem for some people: https://en.opensuse.org/openSUSE:GPIO
Great! However all that info is readily available, and the 2 pieces of info that stopped me from making things work are missing on that page: "For Leap 15.0, you need to install it from 'hardware' repo. One click installation is also available" Ooops, not so. The hardware repo does not have libgpiod for any ARM because it's disabled!!, and I dare say most such boards do not run x86... The sysfs interface fails to point out that the base number from gpiochipN needs to be added to the board's GPIO number. I imagine this will trip lots of people up, because all the RPi info doesn't mention it because N is 0 on raspbian. I'll add it. Of course faulty hardware (one would have thought there's a factory test...) doesn't help. Volker -- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
----- Volker Kuhlmann <list57@top.geek.nz> a écrit :
On Thu 06 Sep 2018 03:42:50 NZST +1200, Guillaume GARDET wrote:
For information, I created a wiki page for GPIO as it seems to be a problem for some people: https://en.opensuse.org/openSUSE:GPIO
Great! However all that info is readily available, and the 2 pieces of info that stopped me from making things work are missing on that page:
"For Leap 15.0, you need to install it from 'hardware' repo. One click installation is also available"
Ooops, not so. The hardware repo does not have libgpiod for any ARM because it's disabled!!, and I dare say most such boards do not run x86...
Indeed, I will ask to get the hardware repo building for ARM.
The sysfs interface fails to point out that the base number from gpiochipN needs to be added to the board's GPIO number. I imagine this will trip lots of people up, because all the RPi info doesn't mention it because N is 0 on raspbian. I'll add it.
Of course faulty hardware (one would have thought there's a factory test...) doesn't help.
Sure. ;) Guillaume
Volker
-- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- 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
Am 06.09.2018 um 09:15 schrieb Guillaume GARDET:
----- Volker Kuhlmann <list57@top.geek.nz> a écrit :
On Thu 06 Sep 2018 03:42:50 NZST +1200, Guillaume GARDET wrote:
For information, I created a wiki page for GPIO as it seems to be a problem for some people: https://en.opensuse.org/openSUSE:GPIO
Great! However all that info is readily available, and the 2 pieces of info that stopped me from making things work are missing on that page:
"For Leap 15.0, you need to install it from 'hardware' repo. One click installation is also available"
Ooops, not so. The hardware repo does not have libgpiod for any ARM because it's disabled!!, and I dare say most such boards do not run x86...
Indeed, I will ask to get the hardware repo building for ARM.
You're the libgpiod maintainer, so you can check those boxes yourself. I've done it for you now. In any case, libgpiod is in Factory, so Tumbleweed users are not affected by whether or not it's built in hardware repo. Regards, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi Andreas, ----- Andreas Färber <afaerber@suse.de> a écrit :
Am 06.09.2018 um 09:15 schrieb Guillaume GARDET:
----- Volker Kuhlmann <list57@top.geek.nz> a écrit :
On Thu 06 Sep 2018 03:42:50 NZST +1200, Guillaume GARDET wrote:
For information, I created a wiki page for GPIO as it seems to be a problem for some people: https://en.opensuse.org/openSUSE:GPIO
Great! However all that info is readily available, and the 2 pieces of info that stopped me from making things work are missing on that page:
"For Leap 15.0, you need to install it from 'hardware' repo. One click installation is also available"
Ooops, not so. The hardware repo does not have libgpiod for any ARM because it's disabled!!, and I dare say most such boards do not run x86...
Indeed, I will ask to get the hardware repo building for ARM.
You're the libgpiod maintainer, so you can check those boxes yourself.
The problem was there was no Leap 15.0 ARM repo, I asked this morning to get it added. ;)
I've done it for you now.
Thanks. Yes, some packages are disabled for ARM, not sure why. Guillaume
In any case, libgpiod is in Factory, so Tumbleweed users are not affected by whether or not it's built in hardware repo.
Regards, Andreas
-- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg)
-- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Hi Guillaume, Am 06.09.2018 um 18:56 schrieb Guillaume GARDET:
----- Andreas Färber <afaerber@suse.de> a écrit :
Am 06.09.2018 um 09:15 schrieb Guillaume GARDET:
----- Volker Kuhlmann <list57@top.geek.nz> a écrit :
On Thu 06 Sep 2018 03:42:50 NZST +1200, Guillaume GARDET wrote:
For information, I created a wiki page for GPIO as it seems to be a problem for some people: https://en.opensuse.org/openSUSE:GPIO
Great! However all that info is readily available, and the 2 pieces of info that stopped me from making things work are missing on that page:
"For Leap 15.0, you need to install it from 'hardware' repo. One click installation is also available"
Ooops, not so. The hardware repo does not have libgpiod for any ARM because it's disabled!!, and I dare say most such boards do not run x86...
Indeed, I will ask to get the hardware repo building for ARM.
You're the libgpiod maintainer, so you can check those boxes yourself.
The problem was there was no Leap 15.0 ARM repo, I asked this morning to get it added. ;)
I've done it for you now.
Thanks. Yes, some packages are disabled for ARM, not sure why.
For build power reasons i had added arm but disabled it by default. Packages that need arm builds (e.g., raspberrypi-firmware) can then enable it as needed. For Leap 15.1 please help ensure that libgpiod gets included in the distro, then we won't need extra builds in hardware. Cheers, Andreas -- SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
File "/usr/lib/python3.6/site-packages/gpiozero/pins/local.py", line 67, in _get_revision raise PinUnknownPi('unable to locate Pi revision in /proc/cpuinfo') gpiozero.exc.PinUnknownPi: unable to locate Pi revision in /proc/cpuinfo
Hardcoding the version into the python2 file /usr/lib/python2.7/site-packages/gpiozero/pins/local.py exits with I/O error on /dev/mem when the few lines of python are run as user (ok fine), and segfaults when run as root. Volker -- Volker Kuhlmann http://volker.top.geek.nz/ Please do not CC list postings to me. -- To unsubscribe, e-mail: opensuse-arm+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-arm+owner@opensuse.org
Op dinsdag 4 september 2018 04:51:25 CEST schreef Volker Kuhlmann:
File "/usr/lib/python3.6/site-packages/gpiozero/pins/local.py", line 67, in _get_revision> raise PinUnknownPi('unable to locate Pi revision in /proc/cpuinfo')
gpiozero.exc.PinUnknownPi: unable to locate Pi revision in /proc/cpuinfo
Hardcoding the version into the python2 file /usr/lib/python2.7/site-packages/gpiozero/pins/local.py
exits with I/O error on /dev/mem when the few lines of python are run as user (ok fine), and segfaults when run as root.
Volker
Sometime ago I needed to read input on a GPIO pin. I found a problem in the kernel of openSUSE to access these pins compared to what is documented for Python in Raspbian. The problem is apparent when you do "ls /sys/class/gpio/". At least you need to see gpiochipN there, where N is some number. On my Raspberry Pi A with openSUSE it is 298. Raspbian has 0. The Python library RPi.GPIO needs to use this N to address the right pin. This also means that the right /sys/class/gpio/gpioM needs to be used for a certain pin. -- 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 (7)
-
Alexander Graf
-
Andreas Färber
-
Brüns, Stefan
-
Freek de Kruijf
-
Guillaume GARDET
-
Malcolm
-
Volker Kuhlmann