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
49 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
71 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
32 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
0 votes
2 answers
26 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
152 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
50 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
87 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
63 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
25 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
35 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
75 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
46 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
249 views

Install GPIO problem

It seems like I cannot download GPIO...
user avatar
-1 votes
1 answer
51 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
109 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
1k 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
94 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
621 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
82 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
45 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
32 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
55 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
107 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
60 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
574 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
102 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
122 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
83 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
103 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
298 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
  • 53.5k
0 votes
1 answer
127 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
298 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
81 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
98 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
64 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
270 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
146 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
20 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
109 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
380 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
227 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
179 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
0 votes
1 answer
545 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 ...
user avatar
1 vote
0 answers
472 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 ...
user avatar
  • 19
0 votes
1 answer
44 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 ...
user avatar
0 votes
2 answers
1k 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 ...
user avatar
  • 7,018

1
2 3 4 5
14