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
2answers
1k views

GPIO.wait_for_edge and signal.signal()

I have the below sample code that is trying to implement a safe shutdown mechanism ( yet to fully implement) For some reason, I am not able to catch any signals using the registered signal handlers. ...
-1
votes
1answer
241 views

convert py file for RPIO to RPi.GPIO [closed]

According to Joan's instruction. First, git clone https://github.com/metachris/RPIO.git cd RPIO sudo python setup.py install sudo python3 setup.py install and sudo python3 jjy.py I made a jjy ...
2
votes
1answer
467 views

RPi threading too slow

So I have rpi wheeled robot, with wheel encoders and I want to always keep the track of the encoders and to be able to access the value when ever I need it. Basically, I created a thread, which ...
0
votes
0answers
82 views

python error from RPi.GPIO

Im getting an error "Error waiting for edge" In this script: import RPi.GPIO as io import time from picamera import PiCamera from datetime import datetime #PIR setup pir_pin = 4 io.setmode(io.BCM) ...
0
votes
1answer
456 views

Frecuent missing data error on DHT11

First of all, as this question involves a raspberry, python, Rpi. Gpio module and hardware build, I thought this was the place for it. In the past I've done some work around Dht11 sensor and python ...
0
votes
1answer
508 views

Controlling High voltage devices with Raspberry Pi

Can I control high voltage (here 5V) to power a led lamp and a fan(both operating at 5v) from Raspberry Pi GPIO only using a transistor . Or should I isolate both the circuits using a relay or octo-...
0
votes
1answer
64 views

Disable buttons while the mp3's they trigger are playing [closed]

I am using this python script to use 2 buttons to trigger 2 different mp3 files in a museum exhibit. As the files are 30 minutes long, I have also added a stop button to stop the playing mp3 so that ...
0
votes
1answer
1k views

Need a GPIO button to stop the currently playing mp3 file

I am using a RPi3 in a museum to connect to 2 buttons via GPIO. Each button plays an mp3 file. I used the Adafruit guide here: https://learn.adafruit.com/playing-sounds-and-using-buttons-with-...
0
votes
2answers
312 views

Allowing uwsgi to make GPIO calls

I've got a Raspberry Pi Zero W acting as a Flask python server that listens for webhooks, then runs a function to turn on a motor until the GPIO pins read a certain combination of inputs. I used to ...
-1
votes
1answer
775 views

GPIO pins always set to high

I have many pins on my raspberry pi GPIO constantly set to high, and I can't seem to set them to low, even after GPIO.cleanup(). Is my Pi faulty? Some seem to be set to low, and I can't set them to ...
1
vote
1answer
386 views

Precision of Raspberry Pi GPIO outputs voltages [closed]

Raspberry Pi has several output voltages, GPIO outputs theoretically giving exactly 0V for False and exactly 3.3V for True, 3.3V line and 5V line. However, how precise are these outputs? Can the ...
0
votes
1answer
261 views

Unable to get input from RPi3 GPIO serial, crashes when using RX pin

I have a sensor which spits out information via serial and I am trying to receive that input on my Raspberry Pi 3 via the serial RX (BCM pin 15). I'm using the wiringPi library in a C++ program to ...
0
votes
1answer
332 views

Connect multiple concurrent MCP23017 to Raspberry Pi

So I want to control multiple (12) RGB LEDs using the raspberry pi. I have 6 connected to the GPIO ports on the pi itself and want 6 connected to 2 MCP23017. I cannot seem to get them both to show up ...
1
vote
0answers
617 views

How can i emulate a ps/2 keyboard with raspberry pi3

So I am working on an medical machine which runs on microcontroller(So,No OS).It gets the input from ps/2 keyboard. I would like to automate it. I would like some basic idea and some help on how to do ...
0
votes
2answers
363 views

Can't set GPIO to LOW/HIGH PySerial

Hello I wanted to blink a LEDS. I have Raspberry Pi 3 B+ and I have LED connected to PIN 4 5v Power. The LED lights but I can't OFF LED ledPin(4) GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO....
2
votes
1answer
3k views

No module named 'RPi.GPIO'

I looked everywhere for answers and non worked, hopefully i will have someone who can help me, simply I want to turn on and turn off a led and I have this code > import RPi.GPIO as GPIO import time ...
1
vote
0answers
119 views

GPIO not producing power but gpio readall says it should [closed]

I have Raspberry Pi 3 model B, running RaspbianOS. I was trying to work with GPIO, but the pins were not producing power. I was using RPi.GPIO library in python to turn on and off the pins. I tried ...
1
vote
0answers
177 views

Raspberry pi shutdown when running python code

i have a python code which is running and has no errors, it is connected with arduino uno using nanpy firmware and lcd which has the library of adafruit/Adafruit_Python_CharLCD and it uses gpio BCM, ...
1
vote
0answers
191 views

conflict GPIO pin (between setting a pull-up resistor and a hat not claiming to use that pin)

I have a raspberry PI 3 (Raspbian) with HifiBerryDac+, running Mixxx. I wanted to run a pythonscript (2.7) which would allow users to automatically restart Mixxx by pressing a button (in case they ...
2
votes
0answers
602 views

PI Zero W, Running NodeJS and reading sensors - bad performance [closed]

I am doing a little project for my pet snake and that is a Terrarium controller with my Raspberry PI Zero W. Just for fun I created it using NodeJS since I am a bit familiar with it. A friend of mine ...
0
votes
1answer
51 views

How to find a suitable `herz` value for a Low Inertia Solar Motor [closed]

I would like to use a Low Inertia Solar Motor-1820 RPM with the Raspberry Pi. More specifically, I want to control its speed using pulse width modulation (PWM) as is explained in this video ...
-1
votes
2answers
664 views

Why is my script running twice when i autostart through .bashrc?

I'm sure this has been answered before but I can't seem to find the solution that works. I am running the latest Raspbian on an RPi 3. I created a bash script named "loop.sh" that loops through two ...
0
votes
1answer
507 views

Rotary encoder is giving less PPR reading

I am testing 400 PPR(Pulses Per Revolution) rotary encoder using code.I am rotating it by using the hand. I have connected Phase A and Phase B and also, ground and Vcc properly. The code is giving ...
1
vote
1answer
475 views

Raspberry Pi 3 with Feetech FS90R servo

Currently I have a very basic setup where I have a FS90R continuous servo running on a my Raspberry Pi 3 using Windows IoT and a C# based application. I'm trying to get the servo to pin using the ...
1
vote
1answer
171 views

Trying to blink (2) LEDs using RPi.GPIO module

I'm a noobie with Python3 and am having problems getting (2) LEDs to blink. The threads run one after the other and not concurrently. ''' Python3 - gpio_test_02 - use threads to blink ...
4
votes
3answers
11k views

Debouncing buttons with RPi.GPIO — too many events detected?

I'm using RPi.GPIO to handle events from a simple pushbutton. Pushing the button connects the associated GPIO pin (4) to ground. I would like to trigger an event when the button is released (e.g., ...
0
votes
2answers
5k views

Run a shell script from a python script when a button is pressed

I'm trying to create a very simple python script that waits for a GPIO button press and then runs a shell script. I personally don't know much about python so what I've come up with is mostly from ...
0
votes
0answers
1k views

Controlling a LED on a Raspberry Pi 3 with PHP

I want to control a LED using PHP on a Raspberry Pi 3 via web page. I have installed Raspbian on RPi 3. I have installed apache2 php5 libapache2-mod-php5 and the wiring Pi library. I can access my ...
1
vote
1answer
404 views

Simultaneous generation of multiple different square waves on GPIO

I am working with a simple hardware design that requires the generation of 3 different square waves on different GPIO pins of the Raspberry Pi 3. I have reviewed posts such as this one: RPi GPIO as ...
5
votes
4answers
2k views

“Blinking” relay by toggling pins between input and output

Edit for searches: This question is about using a 5v relay with Raspberry Pi GPIO pins that outputs 3.3v. There are a number of great questions below, read them through to understand whats going on. ...
3
votes
1answer
1k views

GPIO Status during boot

I've been trying to find some documentation on the status of all GPIOs during boot. I have a relay board permanently connected to the GPIOs, and I've noticed that during boot, there is a lot of ...
0
votes
1answer
57 views

Fire up a function if there is no RPM being detected off the Infra red sensor

The code prints the rpm and keep on running after every 0.1 seconds. What I am trying to do is call another function if there is no rpm printed on the screen for 10 seconds (that means when the rpm ...
1
vote
1answer
956 views

Is RPi.GPIO included in Raspbian?

I'm working through this tutorial, and it says to manually, and I mean manually, install RPi.GPIO: cd /home/pi/Downloads wget https://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.11.tar.gz ...
3
votes
0answers
748 views

How to properly trigger multiple Raspberry Pi camera modules via GPIO?

I am working with three Raspberry Pi 3 B boards, which in turns have RPi camera modules V2 connected to each. I followed this very detailed post about triggering another Pi using GPIO pins and it ...
1
vote
1answer
360 views

Can a GPIO pin be used instead of a I2C pin?

Can a sensor with a I2C output be used with arbitrary GPIO pins on the Raspberry Pi? For example, what about the Sht31 temperature/humidity sensor: https://www.adafruit.com/product/2857
0
votes
1answer
169 views

Raspberry, relay and GND

I have a relay that I can activate it with a PIN to GND. I have connected that relay to a separate power supply, different from the used for the raspberry. As I have read, I can't supply GND using ...
2
votes
0answers
386 views

device tree and led blink

I am trying to create one led driver via device tree in Rpi 3 I had created the dtsi file /dts-v1/; /plugin/; / { compatible = "brcm,bcm2837"; fragment@0 { target = <&...
0
votes
0answers
1k views

GPIO callbacks throw segmentation fault

I am using callbacks to sense obstacles in a small robot. A left sensor and a right sensor. Therefore I add an event twice. Now when the callback is called I remove the event and then later add it ...
0
votes
3answers
75 views

Powering a raspberry pi from another raspberry pi through gpio over a relatively long distance

I've got a rudamentary range extender system set up using two raspberry pi 3s and an Ethernet cable. One of the pi's is in a hallway with a clear signal from the original WiFi network, and the ...
-1
votes
2answers
1k views

False trigger issue using GPIO input

I am using a Raspberry Pi 3 and in my particular case, I am using it to sense when either a button is pressed, or power is dropped, both using the same GPIO input. Both functions work, however, there ...
0
votes
1answer
336 views

GPIO callbacks called simultaneously

With Raspberry Pi, if you have import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(20, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP) def ...
0
votes
3answers
5k views

Error installing RPI.gpio

I'm a new enthusiast trying to learn with raspberry pi so I apologize if I don't use the correct programming terms... The problem that i'm having at the moment is that when I try pip install rpi-gpio ...
4
votes
2answers
2k views

Why can't I return value from python script to PHP script when trying to use GPIO

I have spent two days on this and have tried nearly everything I could find. I am using an apache server (2.4.10). I have two files in a folder called testPythonPHP that is located in the root ...
0
votes
1answer
864 views

How can I turn on/off LED of RPi.GPIO in the same number key?

I am trying to write the following program (8Relay.py) using python on the Raspberry Pi. I want to use the input from a GPIO pin to turn an LED on or off, depending on what input was pressed (1~8). ...
2
votes
1answer
185 views

Inconsistent laser brightness on same voltage

Why does the brightness of the ky-008 laser head sensor module differ greatly between being connected directly to the 3.3V power rail of a bread board and to a GPIO pin? The laser emits a very bright ...
1
vote
1answer
51 views

Program not behaving properly after added to pi startup

I've written a small program that spins a motor throughout the day on the Raspberry Pi 2 Model B, using its GPIO pins. The program works perfectly well, and hasn't had any issues with the GPIO pins. ...
1
vote
1answer
430 views

Is there a GPIO visual plotter for Raspberry like Arduino's Serial Plotter

Arduino has a "Serial plotter" that displays gpio status/value in a simple graphical view similar to an oscilloscope. Is there a similar for (easy to use, no frills) for Raspberry?
1
vote
1answer
156 views

Servo turns one way except in Python

I am currently busy with a project where i need a servo to turn, i wrote a script in WiringPi (Python & .NET) that does this: //Set GPIO scheme. WiringPi.WiringPiSetupGpio(); ...
1
vote
1answer
307 views

Reading inputs from moisture sensor is only giving me 0s and 1s but I want a bigger span

I'm currently reading values from a moisture sensor with this code: import RPi.GPIO as GPIO print "testing" GPIO.setmode(GPIO.BCM) GPIO.setup(14, GPIO.IN) while True: input_value = GPIO.input(14)...
0
votes
1answer
683 views

Help with connecting NPN proximity sensor to rpi3

I have an NPN LJ12A3-4-Z/BX proximity sensor that I want to use to detect water usage on a water meter that has a rotating iron disk. To make sure I don't overpower the 3.3v GPIO inputs I want to use ...