Questions tagged [libgpiod]

22 questions
5
votes
4 answers

Confusion with libgpiod and the gpiod user tools?

For some time I've heard about the new GPIO character device API, sysfs deprecated, etc. Since I recently upgraded one of my RPi to bullseye, I decided to try this new API - or at least the "user tools" in the package named gpiod. I wanted a GPIO…
Seamus
  • 23,558
  • 5
  • 42
  • 83
2
votes
1 answer

Current proper way to interface GPIO from C code?

I've done a lot of googling and it's only confused me further. The old /sys/class/gpio way is deprecated and there's a rag-tag bunch of libraries that appear to have sprung up, none of which have much of an air of officialdom about them, the…
John U
  • 199
  • 1
  • 13
2
votes
1 answer

libgpiod read value Operation not permitted

Trying to read the values from gpio chips in a Python script using the gpiod python module. When calling get_value() we are getting "Operation not permitted". Have tried running the python script as both root and pi user. My python test…
DJViking
  • 131
  • 1
  • 4
2
votes
3 answers

Why is gpioinfo not showing me pin names?

I'm running the same image on 2 different Pis: 2020-08-20-raspios-buster-armhf-lite.img. Kernel 5.4.51-v7+. One Pi is Pi3, and the other is Pi4. On both, I installed gpiod, and ran: $ sudo gpioinfo On the Pi 4, I get proper pin names: gpiochip0 -…
John
  • 467
  • 1
  • 5
  • 10
2
votes
1 answer

How to control a Servo via libgpiod on a raspberry PI

I am trying to control a Servo in c ++ using the libgpiod library. My problem is in defining the 50Hz pwm pulse on the pin that the servo is connected to. The servo signal cable is connected to pin 33 which corresponds to GPIO 13 (pwm1). #define…
Toni M.
  • 23
  • 1
  • 3
2
votes
1 answer

High Impedance state for GPIO

I've not used GPIO on RPi much. On other hardware, the GPIO pins can be configured in software to be in a "High Impedance" state (Hi-Z). I have assumed that it's possible to place most of the RPi GPIO pins in Hi-Z, but after some searching, I find…
Seamus
  • 23,558
  • 5
  • 42
  • 83
2
votes
0 answers

Schedule for Raspi OS upgrades to 5.5 kernel & libgpiod 1.5

Several months ago, this blog post appeared in a search. In summary, this post outlines the new char device-based GPIO interfaces. It further states that a full complement of features will be available with the release of the 5.5 Linux kernel, and…
Seamus
  • 23,558
  • 5
  • 42
  • 83
1
vote
0 answers

Rpi-5 Pulse width modulation

I am a beginner learning how to operate the gpio of a Raspberry Pi 5. I’ve heard that the gpiod nor many other Pi-5 compatible libraries do not support pwm. This leaves me with not many options but to operate my own makeshift pwm. To do this I set…
Matthew Moller
  • 75
  • 1
  • 12
1
vote
2 answers

How to determine the correct GPIO chip for libgpiod?

I am writing software that needs to control some of the Raspberry Pi's GPIO pins. The Internet tells me that sysfs is deprecated and anyhow doesn't work on the Raspberry Pi 5. Apparently the "correct" solution is to use libgpiod. The libgpiod…
Sod Almighty
  • 121
  • 7
1
vote
1 answer

I am looking for clarity on how the libgpiod works with higher functions (esp I2C)

I am working on a RPi 5 running Bookworm with C. Adding the line dtparam i2c_arm=on to the config.txt enables I2C on GP Pins 2/3 accessed through /dev/i2c_1. Reboot to activate. This works fine on Chip 4 lines 2/3. However: if libgpiod functions are…
Nic A
  • 11
  • 1
0
votes
2 answers

Setting internal pull up resistor from python

I recently bought myself a raspberry pi 5 and am learning how to work with the gpio pins. The gpio pins require a library to control them. These library’s that are compatible with the Raspberry Pi 5 are the GPIOZERO and gpiod libraries but I find…
Matthew Moller
  • 75
  • 1
  • 12
0
votes
1 answer

GPIO chip Device or resource busy error

I am trying to control a E-Paper display using my Raspberry Pi 5. I want to use the gpiod library since it seems to be the best option (especially since RPi.GPIO is not supported on the Pi 5) together with spidev in python (suggestions for other…
dongxi
  • 9
  • 2
0
votes
1 answer

Working code example for a button using GPIOd and Python

I am attempting to rewrite a bit of code that used gpiozero for a Raspberry Pi that no longer works on the Raspberry Pi 5 due to the GPIO changes in the Raspi 5. I need it to be backwards compatible to possibly run on our Raspi 2's that we were…
utdream
  • 113
  • 4
0
votes
3 answers

Raspberry Pi 5 GPIO library questions

This Q reflects some of the reservations expressed in another Question here. I too have questions re "The future of GPIO access on Pi 5"; hopefully, the questions here are answerable questions: While researching my question, one of the references…
Seamus
  • 23,558
  • 5
  • 42
  • 83
0
votes
1 answer

Cannot write() i2c-dev after using libgpiod

Question: Is anyone able to advise on how to interleave operation of the RPi I2C hardware with general GPIO using libgpiod? Summary: I'm experiencing some unexpected behaviour with RPi4, gpiod and /dev/i2c-1. Calls to write() on /dev/i2c-1 are…
1
2