Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

1
vote
0answers
26 views

How do I pause a python program and then wait if no signal is received to a GPIO pin?

I'm developing a datalogger using a Raspberry Pi 3B+. I have 2 separate square wave signals connected to two separate GPIO pins and some code to record and store the date and time of each transition ...
0
votes
2answers
22 views

Restore UART pins 8 & 10 after GPIO.cleanup() without reboot

A Raspberry Pi 3B+ is talking to an STM32 chip via UART over pins 8 (TXD) & 10 (RXD). When I take control of those pins using GPIO.setup(8, GPIO.OUTPUT); GPIO.output(8, GPIO.LOW); and later ...
2
votes
2answers
36 views

How to stop python script that was started with crontab reboot

I have a python script that continuously saves data to a CSV file and is started as soon as the Pi starts up using crontab reboot. Does anyone know how I stop the script from within the Raspberry Pi ...
0
votes
0answers
23 views

Measure the time of the relay on

I have python code, where the state of the relay changes throughout the day. I want to measure the time of the relay on and off... I try this code, but not work, count all time.... I want when change ...
-2
votes
0answers
50 views

false trigger on GPIO setup

I have a relay connected to a GPIO output of my raspberry 3 B. As soon as I start the setup the relay goes open and shut in a breeze. I need to avoid this behaviour. I'm using rpi-gpio in my NodeJS ...
0
votes
1answer
27 views

How do I stop CSV file being overwritten when rebooting Raspberry Pi 3B+

I have some code (shown below) which turns the Raspberry Pi into a datalogger. I use GPIO.add_event_detect to detect the date and time that a square wave signal changes state. This data is then saved ...
0
votes
1answer
354 views

RuntimeError: Failed to add edge detection. GPIO.BOTH Raspberry Pi datalogger

I am coding a datalogger using a Raspberry Pi and am starting to test my code but now keep getting an error saying 'RuntimeError: Failed to add edge detection'. Here is my code: import RPi.GPIO as ...
1
vote
1answer
63 views

Datalogging square wave signal using GPIO.BOTH

I'm currently making a datalogger using a Raspberry Pi which will record the real time and date of each falling and rising edge (GPIO BOTH) of a square wave signal (going through one input port). The ...
-1
votes
1answer
17 views

Modifying input of HID via GPIO of PI (unless there is a better way?)

Basically I want to control the input of a USB HID via one or more other HIDs. I know there are commercial options available to do this however they are closed source and expensive. I'd like to get ...
0
votes
1answer
43 views

How can I control a 12V solenoid door lock - Pi Zero

I have a solenoid door lock that requires 3 different voltages to operate - Unlocked Idle: Requires low voltage (6V) that'll hold the solenoid seated - Locked: No power (0V) - Unlock: 50-100ms ...
1
vote
1answer
28 views

UART RX stops reading data after working correctly

I'm trying to read an continuous stream of data from my device (laser altimeter). The device is connected to the UART Rx pin of raspberry Pi 3B+. Everything works fine with this python code: import ...
0
votes
0answers
23 views

Digital weight scale callibration

I have built a digital scale, similar to the one explained here, using four 50Kg load cells forming the Wheatstone bridge. The following two steps give experiments give me different output which I do ...
1
vote
1answer
16 views

GPIO.input(24) is coming back True when it shouldn't be (false button presses)

I have a button in a working circuit. Within sys/class/gpio/gpio24, value changes properly (it becomes 1 when pressed down, 0 otherwise). When I use GPIO.setup(24, GPIO.IN) within python, GPIO.input(...
0
votes
1answer
30 views

Why Raspbian jessie version 8 won't allow communication through GPIO serial pins?

I am running Raspbian Jessie 8 on Raspberry 3 and I followed the answer to the question Why my program won't communicate through ttyAMA0 on Raspbian(jessie)? But I still can't get my program to ...
2
votes
1answer
33 views

LED not blinking

Raspberry Pi Zero Wireless I have a Pi Zero connected to a breadboard using the GPIO Extension Board and ribbon cable. I have followed several of the basic blinking LED tutorials. One jump cable is ...
1
vote
0answers
110 views

RPi.GPIO - Properly Wiring and Setting Up Pins for Button Inputs

Edit: Breadboard, schematic, and code updated. I accidentally fried my Pi by shorting it out through the GPIO pins, so I figured it would be a good idea to ask for some help before trying my current ...
-1
votes
1answer
32 views

python basic problem in developing raspberry pi 3 GPIO skill

this is a part of a code for picroft skill: def handle_command_intent(self, message): if message.data["command"].upper() == "BLINK": self.speak_dialog("ledblink") the "data" and "...
0
votes
1answer
43 views

Writing to GPS HAT on Raspberry Pi Zero W Never Returns Anything

I have attached a GPS HAT to a Raspberry Pi Zero W running RASPBIAN STRETCH WITH DESKTOP. When I SSH in to run a simple Python script that writes to the HAT serial port, nothing happens and I am not ...
1
vote
0answers
46 views

Problem counting pulses

I want to count pulses and find the frequency. Here is the picture of pulses from the oscilloscope: Obviously, frequency is around 1/2.3 ms = 420 Hz. First I tried this program: import RPi.GPIO as ...
0
votes
2answers
45 views

Raspberry Pi Detects I2C Device Sometimes

I have my MPU-92/65 connected to my Raspberry Pi and it's sometimes detected but not always. $ i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -...
0
votes
0answers
26 views

gnd pin to a gpio

My pi was on a robot and a ground wire of the battery back that was driving the motors accidentally touch a gpio pin on the pi. After that my pi began heating up whenever it's plugged in. Is my pi ...
1
vote
1answer
32 views

Controlling electromagnets in clock display

I have an electromechanical 7-segment clock display with each segment controlled by an electromagnet. A segment is 'on' depending on the polarity of the last pulse to its electromagnet. Can anyone ...
1
vote
1answer
80 views

Use Raspberry Pi GPIO to sync multiple video players. Possible?

Is it possible to use GPIO to sync multiple RasPi video players? As shown in the picture below, I need to sync 16 RasPi video players. The master RasPi will trigger the video players (start, stop, ...
0
votes
0answers
22 views

How to create installer files in Raspberry pi

I have created a program in Raspberry pi and I am running it using the command python myprogram.py . Is it possible to create the installer file of this program? that means after installing this ...
2
votes
2answers
356 views

How fast can GPIO pins toggle?

I'm currently using Python's RPi.GPIO module to toggle some pins, and I want to know how quickly it can do this. I need the pins to be toggled on the schedule of a ~50 mhz FPGA clock, which I'm ...
0
votes
1answer
253 views

ImportError: No module named 'RPi'

I am trying to make a humidity sensor using this code import RPi.GPIO as GPIO import dht11 import time import datetime # initialize GPIO GPIO.setwarnings(False) GPIO.setmode(GPIO.BCM) GPIO.cleanup()...
0
votes
1answer
154 views

Read GPIO pin on web page

I was able to control an led from a web page using the following code. when I call http://myip/pinon.php it will light up the LED and http://myip/pinoff.php will turn off the LED. pinon.php <?php ...
2
votes
2answers
194 views

Short pulse detection about 35ms, is it possible

I got somewhat short pulse 35ms, I written script in python using RPi.GPIO, using event and callback. Is it possible to detect so short pulses? On related question how close to 3V3 I need to get? I ...
0
votes
1answer
103 views

Get measured value of gpio vibration sensor (SW420)

I've managed to connect 2 SW420 vibration sensors to my rpi3 and can identify a vibration event on callback. However, I'd like to get the measured value (voltage change?) from the sensors, to see ...
1
vote
0answers
28 views

pigpio monitor GPIO not detecting change correctly

I am having trouble detecting a level change on pin 16 (or any other pin). My script is as follows: import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BOARD) GPIO.setup(16, GPIO.IN, ...
0
votes
0answers
95 views

Issue with FC-51 IR sensor

I am developing a robot with raspberry pi. To detect obstacles I am using FC-51 IR sensor. This is my current code. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) ObstaclePin = 18 ...
-3
votes
1answer
519 views

Which is the standard python library for Rpi other than GPIO library? [closed]

Which python library is best one to use for programming RPI? I want to program RPI zero and Rpi 3 model B+ using python. I know that there is a GPIO library available for RPI. However, in its readme ...
1
vote
2answers
81 views

Testing my low frequency generator

I have my pi hooked up to a shaking device, and I'm looking to drive it at relatively low frequencies. My code looks like this: # Import the necessary header modules import RPi.GPIO as GPIO from time ...
0
votes
0answers
39 views

Is there a python coding method for reading the value of a GPIO pin

Recently I have been learning to prototype circuits on a couple devices, as I am inspired to one day design and develop embedded systems. The two devices that I have been prototyping with are the AVR ...
0
votes
1answer
133 views

Python Adafruit DHT11 error

I have a very simple Python program on my RPi0W to display DHT11 Temp and Pressure readings using SSH. I'm planning to build on it to develop a data logger using MySql. I tested the program and it ...
0
votes
0answers
83 views

GPIO mode in another file B different from the file A

I face a problem. File B has import from gpiozero which controls LED. The default GPIO mode is a BCM. While in file A, it allows NFC reader to read card which imports MFRC522. However, MFRC522 gpio ...
0
votes
0answers
20 views

Help with multiple inputs and responding to how long the inputs have been active

I'm using python 2.7.13 on a Raspberry Pi 3 The goal of my program is to send an email when an input is received (input goes low and I'm using software pull-ups) and then send out another email with ...
0
votes
3answers
412 views

Powering RPI 3 and using relay from same source

I want to build something of a smart home device such as a smart switch /outlet for example that controls something like a light. However, I don't know what the wiring should be Like, if it's possible....
0
votes
1answer
18 views

GPIO.event_detected() Python3 IDLE vs Shell execute startup

I have a script with GPIO.event_detected(port) to count number of times a hall effect sensor is initiated. My script works amazing when executed in python3 IDLE run module. Counts are accumulated per ...
0
votes
1answer
150 views

Cannot execute Python3 RPi.GPIO import from shell/rc.local

I have a python script with import RPi.GPIO as GPIO. When I execute in my Raspberry Pi3 Python3 IDLE, it runs just fine with no issues. If I launch the script with shell pi@my_user_name, it says "no ...
1
vote
1answer
590 views

Cloning RFID tags with Raspberry Pi 3 and RC522?

I've looked around a lot now and can barely find any information on how to clone RFID tags with the Raspberry Pi, I've seen plenty of content on how to do it using an Arduino but I would really rather ...
1
vote
2answers
152 views

Check relay module state

I found a few good answers and guides about how to control a relay module from the pi, however, I want to find a way to check its state/status from the pi, is there a way to determine if the relay is ...
0
votes
2answers
237 views

Open/Close Sliding Gate Using Raspberry Pi and Python

This is my first Raspberry Pi project. I’m a bit of a noob at the Pi, Python and other types of programming languages, as well as circuits and such. I’m trying to open my sliding gate to the entrance ...
1
vote
1answer
335 views

3.3 V and 5 V pins shorted — is the Pi dead?

I am new to Pi development now while working suddenly the cable wires of pin1 (3.3 V) and pin2 (5 V) got in contact for a short time then the Pi shutdown. When I turn it back on, only the LED red is ...
1
vote
1answer
65 views

Pi 3 reboots when GPIO 13 is given 3V

simulate this circuit – Schematic created using CircuitLab I am taking the 3V from Pi and giving it to COM of a relay. The NO goes to GPIO 13 of the same Pi. I have a 120V line that triggers ...
1
vote
0answers
24 views

Pin on off engine javascript nodejs

I have a little engine linked at pin 1 and 3. How can I turn it on and off throught nodejs? Is there also a way to control how many volts are sent (to make the engine faster or slower)?
0
votes
0answers
20 views

How can I make a web UI where the user can set time to trigger an output pin in nodejs?

I am running nodejs webserver on my raspberry pi 3 and I want to create a user interface where the user can set a specific time of a day and trigger an output on that particular time. I have tried ...
3
votes
1answer
69 views

My PIR sensor seems alittle keen to sense things

Before you tell me answers for my issue already exist I'd like to mention that I have checked previous answers and where similar issues have occurred I have tried to use their approved answer. So far ...
2
votes
1answer
407 views

Real time audio input for use in Python program

I am working on some audio manipulation with my RPI and have a question on how I should process the signals. Right now I have a USB adapter with an Audio In and an Audio Out. What I would like to do, ...
-1
votes
1answer
61 views

Dynamically set a timer for a GPIO event? — Using Flask + RPi to control a shop fan

I have a big fan in my shop that I can control via a quick and dirty Flask API i wrote that runs on the pi that controls my fan. I have a web app on my main server (also Flask) that I use to control ...