Using GPIO pins?

This forum is for topics dealing with problems with software specifically in the AArch64 repo.

Using GPIO pins?

Postby navise » Sat Feb 10, 2018 2:23 pm

I've been trying to set the state of my pins using a variety of solution, all without success.

I've tried wiringpi and gpiozero all return a similar error, this is the latter:

$this->bbcode_second_pass_code('', '
/usr/lib/python3.6/site-packages/gpiozero/devices.py:451: PinFactoryFallback: Falling back from rpigpio: This module can only be run on a Raspberry Pi!
'Falling back from %s: %s' % (name, str(e))))
/usr/lib/python3.6/site-packages/gpiozero/devices.py:451: 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:451: PinFactoryFallback: Falling back from pigpio: No module named 'pigpio'
'Falling back from %s: %s' % (name, str(e))))
/usr/lib/python3.6/site-packages/gpiozero/devices.py:451: 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))))
Traceback (most recent call last):
File "./lampon", line 2, 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 480, in <module>
Device.pin_factory = _default_pin_factory()
File "/usr/lib/python3.6/site-packages/gpiozero/devices.py", line 452, in _default_pin_factory
raise BadPinFactory('Unable to load any default pin factory!')
gpiozero.exc.BadPinFactory: Unable to load any default pin factory!
')

I've read around and there's a few remark of
$this->bbcode_second_pass_code('', '/proc/cpuinfo')
not containing the needed information to identify the board.

Also, I've tried to go and set my pin 'manually' but it seems no pins are present in the
/sys/class/gpio/

the typical command should be
$this->bbcode_second_pass_code('', '# echo 1> /sys/class/gpio/gpio2')

but this is all I have $this->bbcode_second_pass_code('', '
$ ls /sys/class/gpio/
export gpiochip458 unexport')
and
$this->bbcode_second_pass_code('', 'ls /sys/class/gpio/gpiochip458
base device label ngpio power subsystem uevent').

So how can I go to use the pins?
navise
 
Posts: 2
Joined: Sun Dec 11, 2016 12:24 am

Re: Using GPIO pins?

Postby WarheadsSE » Mon Feb 12, 2018 2:27 pm

1) What board do you have?
2) What userland and kernel version are you using?
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Using GPIO pins?

Postby untergeek » Wed Feb 14, 2018 8:35 pm

I am similarly curious. I have an EspressoBin and I'm trying to enable 1-Wire for temperature monitoring.

I've ascertained that there is a 1-wire group:

$this->bbcode_second_pass_code('', '
$ cat /sys/kernel/debug/pinctrl/d0013800.pinctrl/pinconf-groups
...
14 (onewire):
...
')

But my pins are all unconfigured:

$this->bbcode_second_pass_code('', '
$ cat /sys/kernel/debug/pinctrl/d0013800.pinctrl/pinmux-pins
Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (GPIO1-0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 1 (GPIO1-1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 2 (GPIO1-2): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 3 (GPIO1-3): (MUX UNCLAIMED) GPIO1:479
pin 4 (GPIO1-4): (MUX UNCLAIMED) GPIO1:480
pin 5 (GPIO1-5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 6 (GPIO1-6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 7 (GPIO1-7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 8 (GPIO1-8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 9 (GPIO1-9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 10 (GPIO1-10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 11 (GPIO1-11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 12 (GPIO1-12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 13 (GPIO1-13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 14 (GPIO1-14): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 15 (GPIO1-15): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 16 (GPIO1-16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 17 (GPIO1-17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 18 (GPIO1-18): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 19 (GPIO1-19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (GPIO1-20): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 21 (GPIO1-21): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 22 (GPIO1-22): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 23 (GPIO1-23): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 24 (GPIO1-24): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 25 (GPIO1-25): d0012000.serial (GPIO UNCLAIMED) function uart group uart1
pin 26 (GPIO1-26): d0012000.serial (GPIO UNCLAIMED) function uart group uart1
pin 27 (GPIO1-27): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 28 (GPIO1-28): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 29 (GPIO1-29): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 30 (GPIO1-30): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 31 (GPIO1-31): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 32 (GPIO1-32): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 33 (GPIO1-33): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 34 (GPIO1-34): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 35 (GPIO1-35): (MUX UNCLAIMED) (GPIO UNCLAIMED)
')

I can insmod the 1-wire driver, and it installs, but that's as far as I can get.

$this->bbcode_second_pass_code('', '
$ uname -a
Linux espressobin 4.15.3-1-ARCH #1 SMP Mon Feb 12 19:20:19 MST 2018 aarch64 GNU/Linux
')
untergeek
 
Posts: 2
Joined: Wed Feb 14, 2018 8:30 pm

Re: Using GPIO pins?

Postby untergeek » Wed Feb 14, 2018 8:38 pm

I have installed a 1-wire temperature sensor to GPIO1_14, and have it properly powered.

I have done this on OrangePi Zero boards before, so I'm not completely ignorant of how to wire them up and such. The newer DTB formatting is tricky, though. Not sure how to go about adding an overlay or some such.
untergeek
 
Posts: 2
Joined: Wed Feb 14, 2018 8:30 pm


Return to ARMv8

Who is online

Users browsing this forum: No registered users and 9 guests