Skip to main content

Questions tagged [gpio]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
2 answers
25 views

How to read a pin state on a Raspberry Pi and select (either/or) between two entries in a cron file?

So I built an MLB scoreboard with a RPI 3. Right now the display can either show my favorite teams playing, OR all the teams playing and cycle through them as they are going on. I would like to add a ...
Joe Schmo's user avatar
0 votes
0 answers
239 views

How can I access the GPIO pins on Raspberry Pi from Docker container and how to avoid conflicts?

How can I configure a docker container so I can access and manipulate a pin of the GPIO and how can I avoid a conflict between more than one container, ex. if two Containers try to turn on/off a led, ...
xmaze's user avatar
  • 31
1 vote
0 answers
261 views

Unable to access GPIOs on Intel Alder Lake CPU

I have a motherboard with an Alder Lake CPU on it (i9-12900E). I'm trying to access the GPIO pins on the motherboard using libgpiod. After I boot linux, I have no /dev/gpiochipX entries. When I run ...
bcattle's user avatar
  • 131
0 votes
2 answers
628 views

Docker with device [GPIO] access while running as a specified user that is not `root`

We have an internal test system for our multi-platform software library which runs, with its zoo of third-party tools, inside an [Ubuntu] Docker container. To keep things simple, the host machine AND ...
Rob's user avatar
  • 103
0 votes
2 answers
978 views

gpiomon from libgpiod library seem not to behave correctly

I am trying to monitor GPIO events using libgpiod on the armbian linux. Accourding to pinout of my device (BananaPI Zero M2 /w H3 allwinner chip) I have pin CON2-P18 hooked on impulse button so I can ...
greengold's user avatar
  • 113
1 vote
0 answers
549 views

Converting to an immutable gpio chip

I have spent the last 10 hours trying to boot asahi linux on my M1 Mac, and now I can finally run the boot command. However, when I run it, there is an error message that says [0.202844] gpio ...
TedFaro's user avatar
  • 11
1 vote
0 answers
1k views

How to access gpio-keys from a shell script

In my embedded linux system, I defined some GPIOs as keys in the device tree so I can use them as keys in my application. This works fine so far. Now I want to add an early startup script to respond ...
Philippos's user avatar
  • 13.6k
0 votes
1 answer
261 views

x86: Drive a SSD1351 OLED Display

I've a bunch of SSD1351 OLED displays like this one: Those are driven over a SPI Interface and I use them in the Raspberry Pi and other ARM SBCs like the NanoPi with the following libraries: https://...
TCB13's user avatar
  • 741
0 votes
1 answer
824 views

How to find the relation between a USB/TTL (dev/ttyUSB_) and it's GPIO pins (/dev/gpiochip_)

I have a number of USB/TTL adapters, based on CP2102N, which have four GPIO lines. I can open one of the serial devices by /dev/ttyUSB0, and the related GPIO lines are controlled by libgpiod: /dev/...
Phil W. Gum's user avatar
0 votes
0 answers
450 views

RPi.GPIO RuntimeError

So I am getting an error: RuntimeError: Not running on a RPi! When the python script tries to setup a pin. This script worked when I ran it from an SD card, but now I have an external SSD connected ...
Mato's user avatar
  • 1
1 vote
2 answers
3k views

Cross-compile libgpiod library and use it in my program

I am trying to cross-compile a program with the "gpiod" library. My host pc has Ubuntu 18.04 and the target platform I am cross-compiling for is a Board with IMX8X SOM. I found source code ...
powermignolo's user avatar
0 votes
0 answers
156 views

KDE Neon fails to boot due to gpio gpiochip2: (gpio_aaeon) errors

I recently built myself i new PC. In the past i used to be happy with KDE Neon on my Laptop and I wanted to use it on my PC too. When I booted from the USB-Stick everything was normal. But when I ...
Baumistlustig's user avatar
0 votes
1 answer
652 views

Where can I install systemd service that executes zsh script as early as possible

I am wondering where can I install this service that executes zsh script to run my script as soon as possible. Script uses serial port at /dev/ttyS5 and gpio pins. Is there a earlier target than multi-...
kamil_debski's user avatar
2 votes
0 answers
332 views

Blink LED on different times on Linux

I made a python program to blink LED on Ubuntu installed on Raspi3b. It's running and I could blink the LED. Next steps are to blink at different times: when I power on, after ssh is active, and the ...
PeRGeLAdAm's user avatar
0 votes
1 answer
126 views

gpio_name_to_desc in gpiolib.c in Linux kernel should be externalized?

We have an embedded project, and for our purposes, it seems handy to name all the gpios in the gpio controller device tree stanza using gpio-line-names feature in device tree, mentioned in ...
John Klug's user avatar
  • 343
1 vote
0 answers
195 views

Idiomatic GPIO control in Linux 4.8+

The userspace interface to GPIOs was changed in Linux 4.8, deprecating the old sysfs interface in favor of a character device. I am struggling to see how I can wrangle this new model into something ...
user488486's user avatar
0 votes
2 answers
5k views

What gpio gpiochip0 kernel error means and how to solve?

I found this in my logs: kernel: gpio gpiochip0: (gpio_aaeon): tried to insert a GPIO chip with zero lines kernel: gpiochip_add_data_with_key: GPIOs 0..-1 (gpio_aaeon) failed to register, -22 kernel: ...
Adrian's user avatar
  • 701
5 votes
2 answers
4k views

Are ioctl calls blocking?

I am writing some code around libgpiod's interface. For example, I want to set a line to output high. Under the hood, libgpiod opens an fd provided by the kernel for the line, and then calls ioctl(fd, ...
detly's user avatar
  • 5,240
0 votes
1 answer
559 views

Cannot make persistant Insertion of a kernel object (debian) using Insmod

I'm trying to insert the [.]Ko (Kernel Object) file for the on-board GPIO into my Linux kernel which succeeds using the command insmod < file-name.ko > But when the OS/Device Reboots, the kernel ...
FireCruZ's user avatar
1 vote
1 answer
6k views

GPIO Errors - "echo: I/O error" and "write error: Device or resource busy"

I've been trying the past 6 hours to run a very simple LOOKING code. It just turns an LED hooked to pin 18 on and off... This is on a raspberry PI 4. I've tried using different pins I've tried adding ...
Mappy Wilks's user avatar
0 votes
0 answers
109 views

Are /dev/i2c-1 and /dev/mem colliding?

I write a program which should handle a motion sensor and an ultrasonic sensor at the same time. I'm using a Jetson Nano with 40 GPIO-pins. The first one uses I2C interface and thus accesses /dev/i2c-...
Totemi1324's user avatar
1 vote
0 answers
4k views

Mmap failed with operation not permitted

I've compiled application on Linux, but I got this error wiringPiSetup: mmap (GPIO) failed: Operation not permitted After that: I've added iomem=relaxed to grub cat /proc/cmdline BOOT_IMAGE=/...
unknown's user avatar
  • 11
0 votes
1 answer
318 views

Rasberry PI 3 debian /sys/class/gpio/export error

I've a problem When I run on my raspberry pi 3 (debian10) echo 17 > /sys/class/gpio/export I get error -bash: echo: write error: Invalid argument Help me please
Andrey Fugas's user avatar
1 vote
2 answers
166 views

USB device driver [closed]

I Wrote a USB device driver for STM32h7 and register the device as GPIO by using Struct gpio_chip structure. my questions are here: I configure usb peripheral in NUCLEO-H743ZI board to CUSTUM HID ...
sasan darvishzadeh's user avatar
0 votes
1 answer
312 views

how does a gpiochipNN is selected or set in gpiolib kernel?

I am looking into kernel gpiolib and gpio-xilinx.c. I see that my device has only cat /sys/kernel/debug/gpio gpiochip0: GPIOs 960-1023, I am confused on how this 960 has arrived. How does the kernel ...
Prawn Hongs's user avatar
1 vote
0 answers
297 views

How to start system shutdown or poweroff by hardware interrupt

I have a small headless embedded Linux box (NXP i.MX6, with userspace based on Debian, but am interested in more general solution). It has no HID input, no desktop stuff, just a serial console and a ...
ddbug's user avatar
  • 135
1 vote
0 answers
361 views

Why is my gpio access from user space slower?

I did some research on how good I am able to access a gpio while other heavy tasks are executed. With a first test I toggeled a gpio pin from user space using the libgpiod API. With a second test I ...
Robin's user avatar
  • 21
1 vote
0 answers
228 views

Defining GPIO for LED board - Meraki MX100

I have a Meraki MX100 that I have installed VyOS on. While otherwise perfectly functional, the one thing that I cannot seem to get working is the LED board on the front panel. I'm no developer which I'...
Ozzy S's user avatar
  • 111
0 votes
1 answer
2k views

Driver development vs sysfs access vs mmap for GPIOs

I believe I could not fully understand the benefits of writing device drivers in embedded systems for some specific devices, such as GPIO, when there are alternative ways of doing the same job. You ...
benjamin button's user avatar
2 votes
1 answer
405 views

GPIO board read/write via bash

Trying to get a GPIO board working, need to access it from script, here is what I am using: stty -F /dev/ttyACM1 115200 raw -echo #CONFIGURE SERIAL PORT exec 3</dev/ttyACM1 #...
alabamatoy's user avatar
2 votes
2 answers
24k views

How to identify GPIO pin numbers? Is GPIO driver loaded?

I am trying to get the GPIO pins on my mainboard working but I don't know the numbers/descriptions of the pins and if a driver is loaded or not. I found this guide where it says that I should echo ...
spider_gotten_pricetag's user avatar
0 votes
1 answer
412 views

How to Resolve `permission denied` on Cloned Image

I had a Linux image on an Orange Pi that was had access to the GPIO pins via the command line sudo echo 1 > /sys/class/gpio_sw/PA1/data. I took the SD card out and put it into another Orange Pi ...
Matthew's user avatar
  • 113
0 votes
1 answer
741 views

How to Set Default Pin State on Orange Pi

When booting an Orange Pi the default pin state seems to be HIGH. Is there a document that I can edit that will change their default state to LOW?
Matthew's user avatar
  • 113
2 votes
0 answers
605 views

What is the preferred way to unhog a hogged GPIO pin?

So I'm doing development on an ARM embedded system which is using the device trees. We're going to integrate a small PCB with a processor and support components onto a bigger PCB, which will be the ...
AndrejaKo's user avatar
  • 213
1 vote
1 answer
207 views

Why are systemd scripts not producing the expected results at boot, but correctly afterwards?

I have a Raspberry Pi on Raspbian Stretch and I want to enable some GPIO pins at boot time. I wrote the following service: [Unit] Description=GPIO23 exported as output, value off [Service] Type=...
FarO's user avatar
  • 234
1 vote
1 answer
3k views

Unable to export specific gpio pins. How to check what uses GPIO pins and how to access register?

I use an i.mx6 board (yocto(jethro)) and am configuring a device tree. I changed a dts file and put the dtb file in a boot partition. I set GPIO4_IO19 in dts file as follows. &iomuxc { pinctrl-...
user8257918's user avatar
1 vote
0 answers
494 views

Set GPIO Bank Mux Mode

I'm working with an ARM machine that has a buzzer attached to GPIO pin 102. The machine is running Linux 2.6, so we have a sysfs interface to the pins in /sys/class/gpio. When I first tried to get the ...
millinon's user avatar
  • 343
3 votes
0 answers
439 views

GPIO in unprivileged LXC container

I currently try to get GPIO-access into an unprivileged LXC application container. In future this container shall execute an application. But for now (while development) I just start a normal bash in ...
Sebastian S.'s user avatar
2 votes
0 answers
211 views

Linux GPIO mapping

I have a WD-Mycloud, which has an LED and a button as the interface. I can access the LED under /sys/class/leds/, but I cannot find where or how the button is mapped. I know how to access the GPIO ...
vakker's user avatar
  • 21
2 votes
0 answers
94 views

lirc refusing to play

I've installed lirc on a Raspberry Pi (running Wheezy) but can't get it to send any signal. The LED is hooked up correctly (tested it using a python script). See it working here on youtube. I used ...
Jim's user avatar
  • 240
1 vote
1 answer
854 views

Driver gpio_keys type of buttons

I'm confused about the driver gpio_keys. This driver distinguishes between two types of buttons: IRQ-only buttons and GPIO-driven buttons Could anyone explain the difference between one and ...
Alex's user avatar
  • 75
1 vote
0 answers
29 views

configure analogic pin as digital pin

I have the SAMA5D3 Xplained. This kit has several analog ports and my idea is to be configured as analog or digital as needed. Would it be possible to do it in an easy way from the kernel?
Alex's user avatar
  • 75
6 votes
0 answers
2k views

Triggering Linux shutdown on power failure

I have an embedded Linux system (currently running Angstrom) with supercapacitor hardware to provide time for writes to complete and avoid corrupted filesystems when external power is removed. ...
Ben Voigt's user avatar
  • 309
6 votes
1 answer
916 views

Running daemon involving GPIO on Pi

I have a daemon that monitors various things using the GPIO ports. I have used python to write the code for this using the RPi.GPIO module. I would like to ensure that the daemon is always running, i....
Aaron's user avatar
  • 187
3 votes
1 answer
3k views

Can one core on a multicore linux system be dedicated to one user-space app?

Can a core be dedicated to one user-space app (e.g. for the purpose of bit-banging GPIO without any interruptions)?
fadedbee's user avatar
  • 971
0 votes
1 answer
498 views

Debian Lenny Adafruit_BBIO failure to install

I have Debian Lenny installed on a Beagle bone Black Rev B. I have been following the outlined steps provided on this web page: https://learn.adafruit.com/character-lcd-with-raspberry-pi-or-beaglebone-...
Chance's user avatar
  • 1
2 votes
0 answers
118 views

How to enable second SIM slot in ALIX6F2 and how to switch 3G to it from the 1st one?

I am trying to enable the SIM slot under the RF card but with no success whatsoever. I'm using Voyage 0.8 (a stripped off Debian distribution) as an operating system. A bit of searching landed me to ...
Abby's user avatar
  • 21
1 vote
0 answers
266 views

Is there a limit of GPIOs that can be used in Linux?

When it comes to use GPIOs, is there a limited number that can be used in Linux (except through the limitation of the physical availability/amount of the ports/pins) or is it theoretically possible to ...
user3085931's user avatar
1 vote
1 answer
419 views

What priority should I give to a script running on startup?

I 'm running Angstrom distribution on an embedded device. I want to make use of its GPIO expansion ports, that are set to be high on start-up. Below, is the code segment, that releases an expansion ...
dempap's user avatar
  • 735
0 votes
2 answers
463 views

GPIO User Space App

GPIO User Space App describes user space application to test the GPIO. Another related link is Linux GPIO Driver. This would be running on a xilinx zynq board having an ARM Cortex A 9 processor. I ...
user2799508's user avatar
  • 1,712