Questions tagged [rpi.gpio]

rpi.gpio refers to the package name of a Python module for accessing the Raspberry Pi's GPIO pins. 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
0 votes
0 answers
26 views

Active high relay for Raspberry and Tents control

I would control a board for motorized tents with Raspberry. My wish is to have a touch panel for moving up and down the tents. The problem is: how can I send the input to the switches on the tents ...
user avatar
0 votes
1 answer
32 views

RGB Matrix interfering with GPIO button

I have a Raspberry Pi 4 running Raspbian Lite. On that I soldered an Adafruit Hat + RTC and connected Adafruit 64x32 RGB Matrix. I have also connected a GPIO push button to pin 5 & GND#4 For the ...
user avatar
0 votes
1 answer
33 views

signaling Raspberry Pi with PLC

I want to give signal via PLC to Raspberry Pi and when the raspberry pi gets that signal, it should run the python script and when the python script execute properly and cycle is completed, it should ...
user avatar
  • 1
0 votes
2 answers
34 views

How to set PWM to actual 0

I am controlling a stepper motor using PWM on a RPi 4 and python. The motor has a controller/driver (BLDC-8015A) that accepts 0-3.3V to set the rotational speed. According to the documentation, this ...
user avatar
0 votes
0 answers
57 views

Help! Designing a 3 push button circuit that sends emails

First time posting here. I'm in a bit of panic mode because I need to deliver a project this Wednesday and I'm having issues with my coding. As the title says, I'm using a circuit of three push ...
user avatar
1 vote
0 answers
75 views

Python code not working: Programming a motor to turn on using a switch (Raspberry Pi)

HELP! Ideally within the next 24hrs PLEASE!!!!! We have a simple circuit where we have a button, that when pressed, starts a motor that needs to run at a certain speed for a certain amount of time. (...
user avatar
  • 11
1 vote
0 answers
38 views

Not getting an GPIO output

I am trying to light a led with the raspberry pi 3b, but I am failing to get an output. I connected the LED to physical pin #11: [img]https://i.imgur.com/TYeJc10.jpg[/img] And to physical pin #6(...
user avatar
-1 votes
2 answers
33 views

How can I read the current ALT-Mode of a GPIO PIN?

i have a Hyperpixel 4.0 Touchscreen, which i use one my Raspberry PI 3b+ This Touchscreen is attached directly on the 40 GPIO-Pins and a few Pins have some special Alt-modes. Out of personal Interest, ...
user avatar
0 votes
1 answer
221 views

AttributeError: module 'RPi.GPIO' has no attribute 'ChangeDutyCycle'

Starting Day 2 troubleshooting this error. Code used to work on a previous rasp pi 4B but doesn't on a new one so I'm assuming I'm missing some breaking change. Problem: Using import RPi.GPIO as GPIO ...
user avatar
  • 143
1 vote
1 answer
58 views

How to check on which OS system the python program is running to import rpi.gpio?

Is there an easy way to let a python program check if it running on the raspberry Pi or the pc running windows? I would like to use this to automaticly use the rpi.gpio functions in my code. I am ...
user avatar
  • 13
1 vote
1 answer
125 views

Controlling stepper motor with Raspberry pi

I am building a sorting machine for a project where I want to sort the balls based on their color. For the actual sorting mechanism I am using a stepping motor (NEMA 17 with Driver DRV8825). I ...
user avatar
1 vote
3 answers
71 views

Rpi GPIO code not working

Following commands work well as full speed PWM. echo "s 18 2000" >/dev/pigpio pigs s 18 2000 But following code do nothing. I am using Raspberry Pi4 8G B model import RPi.GPIO as GPIO ...
user avatar
-1 votes
1 answer
32 views

How to assign one input when matrix keypad key is held down?

I have a simple matrix 3x4 keypad that executes a function based on the code entered. However I'm running into the issue when someone holds down a key. I would like it to where only one value is ...
user avatar
  • 1
0 votes
0 answers
52 views

python module 'spidev' not found

python software from pi plates doesn't work with python 3.10. One specific is that 'import spidev' cannot find spidev module. Any suggestions?
user avatar
0 votes
1 answer
106 views

ERROR: PWM Generation using pigpio C library

I am working on the RPI-CM4 board with raspbian buster OS. I am trying to generate the 38KHz PWM wave using pigpio the library. My code is as follows. #include <pigpio.h> #include <unistd.h&...
user avatar
-1 votes
1 answer
59 views

Can you use gpiozero wait_for_press() inside of a callback triggered by add_event_detect?

I am trying to write a script that uses a GPIO interrupt to callback a function that starts by playing a sound and then waits for a button to be pressed to start recording a sound, and then waits for ...
user avatar
0 votes
1 answer
267 views

Install GPIO problem

It seems like I cannot download GPIO...
user avatar
-1 votes
1 answer
55 views

need to avoid callback is triggered when changing gpio modes

I have following code and I need to run it so, callback is not triggered when changing gpio mode from OUT to IN. Is this manageable with this library? import pigpio, time _gpin_a = 27 pi_gpio = ...
user avatar
0 votes
0 answers
32 views

Raspberry Pi Pin 17 Displaying Abnormal Behavior

I found that GPIO 17 (there was a switch wired up to it) had abnormal behavior. I have wired up a hall effect sensor on pin 18, but when it goes low (it is high when not detected, low when detected), ...
user avatar
0 votes
1 answer
126 views

Raspberry pi zero GPIO pin not detecting Input

so I am using a raspberry pi zero to detect the signal from this NPN Inductive proximity sensor(its input supply range is 6to36V and the signal pin to output the same amount of Voltage which we give ...
user avatar
  • 21
5 votes
2 answers
2k views

Error installing RPi.GPIO in virtual environment

I am trying to create a virtual environment that can access GPIO pins. In order to do that, I need access to RPi.GPIO in the environment. I am unable to install that into the virtual environment. I ...
user avatar
  • 155
1 vote
0 answers
115 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 ...
user avatar
  • 111
1 vote
1 answer
688 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: ...
user avatar
1 vote
1 answer
87 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 ...
user avatar
-2 votes
1 answer
50 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 ...
user avatar
  • 107
0 votes
0 answers
35 views

GPIO change state record

I'm looking for a way to record Datetime and state of GPIO, but just want a record when the state change. I have this in my code: temp_def = 30.0 while True: print(read_temp()) if(read_temp() &...
user avatar
0 votes
2 answers
60 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 ...
user avatar
-1 votes
2 answers
132 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 ...
user avatar
  • 133
0 votes
1 answer
73 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 ...
user avatar
-1 votes
2 answers
682 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 ...
user avatar
1 vote
1 answer
23 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 ...
user avatar
0 votes
0 answers
111 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 ...
user avatar
-1 votes
1 answer
145 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 ...
user avatar
  • 1
1 vote
2 answers
95 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 ...
user avatar
  • 11
0 votes
1 answer
119 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 ...
user avatar
0 votes
1 answer
328 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 ...
user avatar
  • 54.1k
0 votes
1 answer
143 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 ...
user avatar
1 vote
2 answers
329 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 ...
user avatar
  • 121
1 vote
0 answers
88 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 ...
user avatar
0 votes
1 answer
108 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 ...
user avatar
1 vote
0 answers
70 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!
user avatar
1 vote
1 answer
36 views

Bluetooth Ignition need help smoothing out functionality

Hello I have been working on a Bluetooth authorized push to start ignition in my truck. Right now its installed and working but I would like to change the function of the button and shorten the time ...
user avatar
  • 11
0 votes
2 answers
299 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?
user avatar
0 votes
1 answer
167 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 ...
user avatar
  • 109
0 votes
0 answers
21 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 ...
user avatar
-1 votes
1 answer
124 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 ...
user avatar
  • 1
0 votes
2 answers
1k 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....
user avatar
-1 votes
2 answers
403 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 ...
user avatar
  • 1
-1 votes
1 answer
251 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 ...
user avatar
  • 1
0 votes
2 answers
206 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=...
user avatar

1
2 3 4 5
14