New answers tagged

0 votes

Raspberry Pi 5 GPIO library questions

This might have already been noted, but the GPIO chip in the Pi5 was changed from the Pi4. Using RPi.GPIO in Python doesn't work anymore. It is suggested to use gpiod.Chip('gpiochip4) now for Pi5, ...
Jack Chaney's user avatar
0 votes

How can I write or read from a specific GPIO pin in from a kernel-module?

The interface described here no longer works on Raspberry Pi OS bookworm. echo 20 > /sys/class/gpio/export -bash: echo: write error: Invalid argument
Some Nut Job's user avatar
0 votes

Future of GPIO access on Pi5

The Raspberry Pi Model 5 was introduced at the end of 2023. It only works with Raspberry Pi Bookworm OS or later However, the biggest impact for most developers is that the RPi.GPIO input/output ...
Bob Rathbone's user avatar
1 vote
Accepted

Pico: GPIO pin need to be high at power up to ensure correct behaviour against connected 8-bit computer

All pins on Pico (and practically everything) are initially configured as INPUTS. Pins generally have default pull to ensure stability but this varies on pin. If you want them to have a defined value ...
Milliways's user avatar
  • 60k
1 vote
Accepted

Working code example for a button using GPIOd and Python

I have some code using gpiod. See https://raspberrypi.stackexchange.com/a/145544/8697 gpiod is poorly documented so it is not easy to use but my test worked but not fully tested on Pi5
Milliways's user avatar
  • 60k
0 votes
Accepted

Gpio export fails

Sounds like you are running a recent kernel that has finally removed the long deprecated sysfs GPIO interface. You could either build a custom kernel with CONFIG_GPIO_SYSFS enabled or switch to the ...
Kent Gibson's user avatar
1 vote

Current proper way to interface GPIO from C code?

Well... Yes - I feel "rag-tag" does sum up the situation fairly well for some of the libraries you've mentioned. As Milliways has pointed out, we've been hearing for years that sysfs is on ...
Seamus's user avatar
  • 22k
1 vote
Accepted

RPi randomly shutting down, maybe due to GPIO?

I'll suggest a simplification that may solve your problem: You do not need this software. The One Button ON-OFF setup has been around for years. It requires two pieces of wire, and one momentary push-...
Seamus's user avatar
  • 22k
1 vote

RPi randomly shutting down, maybe due to GPIO?

so this means to me this GPIO stuff triggers the shutdown You don't have to guess. Just put a line in the python script to log something including the exact time to a file (or syslog), and that ...
goldilocks's user avatar
  • 58.9k
1 vote

Current proper way to interface GPIO from C code?

The current "proper" way is libgpiod (a poor choice of name as it is not a daemon) although the current version in Bookworm is (at least) 3 years old, poorly documented and has absolutely NO ...
Milliways's user avatar
  • 60k
0 votes

Failed to add edge detection - Raspberry Pi 4 GPIO

I encountered the same error message, ‘Failed to add edge detection,’ on my Raspberry Pi 4. After reinstalling Raspberry Pi OS, I still faced the same issue. However, my problem was resolved by ...
Khaledalmolaa's user avatar
0 votes

Multithreading/infinite loops affecting sensor values

I may be off, but should you be using time.sleep() inside a thread? that may cause problems as far as I understand.
Clóvis Fritzen's user avatar
1 vote
Accepted

RPi.GPIO RuntimeError: Failed to add edge detection

After doing a lot of research i found a solution myself: It seems that the kernel interface for gpio access changed from library gpio to lgpio. Switching the python package rpi-gpio to rpi-lgpio as ...
uenz's user avatar
  • 19
0 votes

Raspberry Pi multiple NFC readers

I updated Lugico's code with Amogh's advice to work with 2 readers on a Raspberry Pi 3B+. Make sure you're supplying sufficient power to your pi or it will not be able to power all of your readers. ...
Alex Berliner's user avatar

Top 50 recent answers are included