Skip to main content

Questions tagged [libgpiod]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
25 views

Converting pigpio code to Gpiod library python

I have the following code of pigpio library and I have to convert it's functionality using gpiod library. Where pigpio has a good documentation I can understand the working of previous code using that....
farhan jatt's user avatar
0 votes
3 answers
94 views

How to determine the correct GPIO chip for libgpiod? [closed]

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 "...
Sod Almighty's user avatar
0 votes
1 answer
369 views

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 ...
utdream's user avatar
  • 113
1 vote
2 answers
548 views

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 ...
John U's user avatar
  • 181
0 votes
1 answer
129 views

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 ...
Nic A's user avatar
  • 1
0 votes
4 answers
3k views

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 ...
Seamus's user avatar
  • 22.4k
1 vote
1 answer
2k views

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 ...
DJViking's user avatar
  • 111
0 votes
1 answer
665 views

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 /...
Colin Hall's user avatar
6 votes
5 answers
7k views

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 "...
Seamus's user avatar
  • 22.4k
0 votes
0 answers
134 views

GPIO event monitoring fails on Zero 2

On my (first) Raspberry Pi Zero 2, gpiod_ctxless_event_monitor (from libgpiod) fails, while identical calls succeed on my other Pi 3 and 4. Is this a limitation of the Zero or does this indicate that ...
Christoph Wintersteiger's user avatar
0 votes
1 answer
1k views

How fast are C & Python libraries

I ran some code to monitor Pi hysteresis which involved mirroring a GPIO input to output. I was surprised as how slow the code was, so wrote a C version. Although this was slightly better it was still ...
Milliways's user avatar
  • 60.7k
2 votes
3 answers
3k views

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 ...
John's user avatar
  • 447
0 votes
1 answer
2k views

How to read any connected DS18B20 temperature sensors with C/C++

I'm new to the Raspberry Pi ecosystem so pardon me if I'm talking nonsense. I want to read the temperature data from the connected DS18B20 sensors using C/C++. I followed this schema to connect them: ...
Alexandre A.'s user avatar
2 votes
1 answer
2k views

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 ...
Toni M.'s user avatar
  • 23
2 votes
1 answer
6k views

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 ...
Seamus's user avatar
  • 22.4k
2 votes
0 answers
242 views

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 ...
Seamus's user avatar
  • 22.4k
0 votes
3 answers
605 views

libpgiod vs wiringPI code/configuration

I have an RPI, setup with wiringPi and some code I wrote to read a quadrature encoder. It works just fine, I can read the pins, using a wiringPiISR mechanism (the ISRs get executed on the rising as ...
Ron's user avatar
  • 11
0 votes
1 answer
308 views

libpgiod vs wiringPI ports/pins etc

since sysfs is deprecated, and wiringPi can't really be used anymore, I started with libgpiod. I found some examples I am trying to play with. But nothing yet. (I am trying to get an libpgiod version ...
Ron's user avatar
  • 11