Questions tagged [rpi.gpio]

rpi.gpio refers to the package name of a Python module for accessing the Raspberry Pi's GPIO pins. NOTE not supported on Pi5. The module allows GPIO pins to be initialised, turned on, and turned off. It uses a functional programming style.

Filter by
Sorted by
Tagged with
1 vote
0 answers
291 views

MCP23008 Python Input Handler

How do I declare a Python callback handler method on a MCP23008 input pin? This Adafruit tutorial, which uses CircuitPython shows how to read input from the extended GPIO pin on the MCP23008, but does ...
JJ Zabkar's user avatar
  • 111
1 vote
2 answers
1k views

Bullseye python2 RPi.GPIO

As I read from forums, Python2 is removal at bullseye. I install python2.7 manually but there is gpio problem with python2. sudo python2.7 -m pip install RPi.GPIO dont work. Raises collect2: error: ...
Hakan Ulusoy's user avatar
1 vote
1 answer
207 views

Raspberry PI GPIO protection

I'm designing a PCB to mount and interact with a raspberry pi4. One of the things I need it to do is drive a 24V relay. This circuit has worked great with some controllers I've used where the outputs ...
BBridges's user avatar
-2 votes
1 answer
172 views

GPIO Runtime Error with cron script at reboot

On my Pi I am using cron to run a shell script, which in turn runs a python script on startup using the @reboot flag. This python script sets up a GPIO pin to listen for a button push, and for some ...
Spencer's user avatar
  • 107
0 votes
2 answers
191 views

MG 996R Servo only works in one direction with pi 4b

I have an MG 996R Servo from DM DIY More hooked up to physical pin 18 of my raspberry pi 4b running python 2.7.16 with GCC 8.3.0 on Linux2. I am powering the servo with an external 5V supply capable ...
Livingsten's user avatar
-1 votes
2 answers
584 views

Checking which GPIO pin is high

In my program, I have 10 push buttons In a certain function of my program, I need to check if a particular push button is pressed. If it is pressed, function A should be called, while if any other ...
RishiC's user avatar
  • 143
0 votes
1 answer
155 views

RPi.GPIO library limitation - add_event_detect cache

How many callback events is cached in add_event_detect function? In my example below start_thread is executed just twice, but it is fired up five times (by the loop). To me it looks, that GPIO library ...
B.Ondrej's user avatar
-1 votes
2 answers
3k views

Raspberry pi 4 gpio pins not working

My Raspberry pi 4 gpio pins are not working for some reason I tried uninstalling and reinstalling rpi.gpio and gpio and it did not work here is the code import RPI.GPIO as GPIO import time led = 26 ...
user139246's user avatar
1 vote
1 answer
40 views

PWM transducer won't update frequency

I'm creating a simple script that outputs a text input to morse with an LED and a transducer via the GPIO pins on a Raspberry Pi 4 Model B. I tried to add input functionality with buttons that can ...
Leo Gortz's user avatar
0 votes
0 answers
389 views

Using same GPIO pins simultaneously from two Python scripts using RPi.GPIO

I have two different scripts. One is a Kivy app and another is a MQTT client script that subscribes to topics received from a web server. The same hardware connected to the GPIO pins can be used from ...
Shakeeb Ahmad's user avatar
0 votes
1 answer
327 views

dtoverlay=gpio-shutdown,gpio_pull=off

I was wondering if utilizing the code below would be sufficient in shutting down and restarting a Raspberry Pi 3 A+ with the use of a TTP223 capacitive touch sensor. By default, the touch sensor is ...
Guysho's user avatar
  • 11
1 vote
2 answers
224 views

Relay no longer works on GPIO ports

I'm french excuse me for my english language, i works on a industrial vision processing device. I use the following components : Picaméra Raspberry Pi 3B + Relay : SRD-05VDC-SL-C I work on a python ...
Henry's user avatar
  • 11
0 votes
1 answer
394 views

Receiving noise signal on input pin after connecting jumper wire to GPIO pin Raspberry pi 4

I am trying to use GPIO pin to get input from the sensonr, after connecting the sensor I noticed I have a lot of noise ( fluctuating signals between 0 and one). After further troubleshooting I noticed ...
Shahin Shirazi'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
  • 60k
0 votes
1 answer
352 views

Hardcode RF Codes - RPi-RF

I would like to use the rpi-rf module https://pypi.org/project/rpi-rf/ for a remote control alert system, using a PIR motion sensor as the input. I have so far set up the PIR input and send and ...
John Conor's user avatar
1 vote
2 answers
886 views

Controlling WS2812b LED strip produces inconsistent and uncontrollable output

Background I'm trying to control a single WS2812b LED strip from a Raspberry Pi. I've followed this tutorial from raspberrypi.com (with the exception of Prep & Installation step 4, because I ...
kviLL's user avatar
  • 131
2 votes
1 answer
654 views

Raspberry Pi Python 3 Script - RuntimeError: Failed to add edge detection

I have looked at all the posts about this error, but none have cured it for me. I am using a ChronoDot RTC on an old Pi B+ with the SQW Wave Output going to Pin 8 which I use to update an LCD display ...
themetman's user avatar
0 votes
1 answer
159 views

Using Pymodbus, I want to tie coil states to GPIO pins within my server not from a client

I am writing a PyModbus asynchronous updating server based on the example on the Pymodbus Asynchronous Server Example and I want to link the states of the coils to GPIO pin states, such as when coil 1 ...
Michael H.'s user avatar
1 vote
0 answers
161 views

How to set PWM frequency below 1Hz on RPi?

does anybody know how to generate a PWM with less than 1Hz of frequency on Raspberry Pi? I'd like to generate a PWM with 0.1Hz if possible. Thanks in advance!
Charles Wagner's user avatar
2 votes
1 answer
51 views

Bluetooth Ignition need help smoothing out functionality

I have been working on a Bluetooth authorized push to start the ignition in my truck. Right now it's installed and working but I would like to change the function of the button and shorten the time it ...
Citsk6's user avatar
  • 21
0 votes
2 answers
612 views

GPIO Pin 18 PCM clk

I'm new to the world of GPIO pins and I have 2 HATs that both want access to GPIO 18. As this is an output pin can you share it between 2 HATS without side effects?
lostdiaspora's user avatar
0 votes
1 answer
557 views

Controlling 4 servo motors through hardware PWM

I am working on a some time-critical system that will run image processing and controlling 4 SG90 servo motors. In short, I will do visual-servoing. Since I will do visual servoing, I don't want to ...
tango-1's user avatar
  • 109
0 votes
0 answers
31 views

ltp305 Dot Matrix Python Library not allowing me to use display.set_character()

I am trying to display a number on a Dot Matrix ltp305 display that increases with each button press, enabled by the pressing of a normal button connected to the GPIO. I am sure everything is ...
Commodore 64's user avatar
-1 votes
1 answer
285 views

RPi.GPIO button interrupt/callback inconsistent behavior - callback functions do not return

I have this programm that has 4 buttons (5,6,13,19) linked to the handleBtnPress callback function. The handleBtnPress function sets a busy flag, prints which button is pressed and then calls the main ...
J.P.'s user avatar
  • 1
0 votes
2 answers
2k views

Raspberry Pi DHT 11 sensor not working.I get None None

Have integrated Raspberry pi4 with a DHT sensor. The data pin is connected to pin GPIO 26 Have tried connecting the VCC to both 3.3V and 5V Have tried with both Adafruit_DHT.DHT11 and Adafruit_DHT....
Madhuraank B's user avatar
-1 votes
2 answers
829 views

RPi.GPIO: multiple buttons one callback function, ignore buttons while callback is executing

I have 4 buttons connected to my Raspberry Pi that call the same function when pressed. I'm using GPIO.add_event_detect to connect the buttons to the callback function. When one button press executes ...
J.P.'s user avatar
  • 1
-1 votes
1 answer
441 views

gpiozero button to raise SystemExit / gpiozero clash with GPIO.cleanup()

TL;DR: Since this is a long question I have the following problems: I'm looking for a good way to use gpiozero Button to raise SystemExit upon button press I have an imported module to drive an E-Ink ...
J.P.'s user avatar
  • 1
0 votes
2 answers
502 views

How can I query pull state of GPIO pin?

I am writing a script that should query if an input pin is configured as pull-up or pull-down using the RPi.GPIO package. When configuring each output I can call GPIO.setup(11, GPIO.IN, pull_up_down=...
tron_ccp's user avatar
1 vote
2 answers
2k views

PIR motion sensor HW-416-B does not behave properly. No motion but input is triggered regardless

So, this motion sensor works when it is taped to my desktop computer...but when I move it to the wall, specifically a higher spot on the wall, it just keeps giving back an input signal. So here is a ...
BigBoyProgrammer's user avatar
1 vote
0 answers
893 views

GPIO INPUT is always HIGH

I am working on a project with HC-SR04 Ultrasonic sensors. I am a beginner in raspberry-pi. I have 3 sensors which are calculates the distance. But one of them has problem which is echo (input) pin ...
hyorman's user avatar
  • 19
0 votes
1 answer
64 views

FruxePi Installation fails on RPI W

I've been trying to install FruxePi (https://github.com/fruxefarms/FruxePi), both 0.3 & 0.4 versions. But To my understanding the setuptools / pi fails to install, but I can't imagine a way to ...
Mantas Milkintas's user avatar
0 votes
2 answers
4k views

RPi.GPIO: Check if a pin is being used

During development, I frequently encounter this warning, as expected. My threaded code frequently prematurely terminates during experimentation. Steppers.py:26: RuntimeWarning: This channel is already ...
Aloha's user avatar
  • 7,156
0 votes
1 answer
657 views

RPi PWM issues - (re)start results in oscillating pin

I'm building a sauna controlling mechanism, controlled by the Pi, using PWM and solid-state relays. Works fine, but after a while, the PWM breaks down. At this moment, when I run the program and the ...
Wannes's user avatar
  • 3
0 votes
2 answers
447 views

How to create unfazed pwm signals?

I have two pins with the same frequency (10Hz) and same duty cycle (50%) assigned to two different leds. How can I make the two leds blink alternatively? How can I put a delay of 50% in one of the ...
Raquel Alves's user avatar
0 votes
1 answer
86 views

voltage issues with GPIO raspberry pi 2

Need some assistance here. I am trying to setup some high voltage SSRs to my Raspi for an eventual lightshowpi project. Trying to start small first. I have a bunch of LEDs I have been playing around ...
Andrew M's user avatar
0 votes
0 answers
107 views

How to set event handler for a GPIO in Mathematica for Raspbian

I wish to program my Raspberry Pi using Mathematica (rather than Python). One basic functionality easily done with Python is to set event handlers which triggers a function when some event is ...
Denis Cousineau's user avatar
0 votes
1 answer
198 views

Is it safe to use GPIO as GND for multiplexed 7-Segment display or should transistors be used?

I want to control a 4-digit multiplexed 7-Segment + Decimal Point Display (SH5461AS). This diagram (which allegedly comes from the datasheet of this display) suggests to use 4 external transistors to ...
julius100's user avatar
1 vote
2 answers
1k views

Ubuntu 20.10 and GPIO

I have trouble installing RPi.GPIO library on Ubuntu 20.10. I run apt-get update and apt-get upgrade then apt-get install python python3 python3-pip python3-dev everything went ok. Then I run pip ...
MorganMLG's user avatar
0 votes
1 answer
1k views

Raspberry Pi connected to Motor Controller- Getting error in code

*Hi, I am getting this code error: *blink.py:25: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.* GPIO.setup(ENA1,GPIO.OUT) ...
EngineeringJuice's user avatar
-1 votes
1 answer
139 views

input pin not working

I connected the 3v3 power pin to a switch and then to an IO pin set to input. when I turned on the switch, it works fine and I detect an input, but when I turned off the switch, it was going back and ...
forever's user avatar
0 votes
3 answers
1k views

My GPIO.event_detected code is unreliable

I made this short program to understand GPIO.event_detected() better, and ended up more confused than I started. Please help me understand my mistakes. Here is the code, and some test output of me ...
Drake P's user avatar
  • 395
2 votes
5 answers
16k views

What is the proper way to debounce a GPIO input?

I have a project that involves using a Raspberry Pi to sense the state of a mechanical switch (actually, a relay, part of this light beam sensor). When the switch is closed, I want to sound a doorbell....
Metamorphic's user avatar
0 votes
2 answers
176 views

No RPi. module found [duplicate]

Is it only possible to find the RPi. module when I'm connected with my Raspberry. I wanted to write the program first and then load it on to my Raspberry. But I get the Error that there is no RPi. ...
Durian's user avatar
  • 1
1 vote
0 answers
163 views

regulating the speed of a motor connected to a TB-6612 FNG motor driver using the pwm output generated by the pca9685 multichannel servodriver

I understand that this type of usage is not typical for the pca9685. I am trying to use one of the pwm pins of the pca9685 to regulate the speed of a motor. As for now the motor works regularly if ...
vuv's user avatar
  • 31
2 votes
0 answers
231 views

Wiring 12V 5 pin relay (without a module/board) for usage with Raspberry Pi

I'm trying to setup an automated garden as a quarantine project for my mother and I can't really figure out how to properly wire a 12V 5-pin relay module as every tutorial online only shows the ones ...
João Victor Martins's user avatar
1 vote
3 answers
431 views

How exactly do i make a LED Blink? I tried every possible result

I am trying to make a LED blink on a Raspberry Pi Breadboard, but after everything I've tried, it doesn't work. I have tried: Changing wires and moving them around Switching LED's to check if the ...
Raw Eggs's user avatar
2 votes
1 answer
2k views

Power multiple add-ons on one 5v pin

I have multiple add-ons connected to my Pi that currently use all of the 5v pins. I want to run more add-ons to the Pi that need 5v power. The 5v pins are connected using male to female GPIO jumper ...
Helen Johnson's user avatar
-1 votes
1 answer
253 views

Odd results when using RPi.GPIO's event_detected() function

I've recently been experimenting with RPi.GPIO's event_detected() function, to check if a button (connected to the gpio) has been presssed. However, for some reason events would randomly be detected. ...
Stalemate's user avatar
-1 votes
1 answer
41 views

Arduino to Pi reads high all the time [closed]

I'm trying to read a signal coming from an Arduino through a wire attached to pin 24 of the Pi. The problem is the Pi reads high all the time. I tried to do a pull up using GPIO.setup(24,GPIO.IN, ...
user124819's user avatar
0 votes
0 answers
13 views

RPI Stops Reading Micro SD Card If I Plugin PI Fans before it and Vice-versa

facing issues with the heat sink casing that I bought it got 2 fans. So, if I connect the fans before the boot RPI doesn't read the micro SD card and no green light. But, if I remove the fans ...
P082's user avatar
  • 101

1
2
3 4 5
15