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
1answer
560 views

Raspberry Pi - Press for on / Press for off switch

I've begun tinkering with using electronics and am also new to using Python. I was wondering if someone could help me please? What I'm trying to achieve is to use an on/off switch to run a motor - ...
1
vote
1answer
38 views

GPIO PWM. ESCs still run different after calibration

I’m putting a quadcopter together. I’m using a python script to calibrate the ESCs... they beep like a blinking led when I give them power. Then I run the calibrate script and they give me the proper ...
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-...
1
vote
1answer
30 views

Value of GPIO.input() automatically change

I have a simple code that read the input from pin 17 (BCM). import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN) try: while True: print(GPIO.input(17))...
2
votes
1answer
997 views

pull up resistors from rpi-gpio.js

I want to use the internall pull down resistor. In python the setup method accepts a parameter for that, like: GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP) according the rpi-gpio.js ...
2
votes
1answer
5k views

How to set a GPIO pin to default HIGH before setting it to output?

I have a raspberry pi connected to a Sainsmart 4-channel relay, where each relay is activated by a LOW signal. When I set a GPIO pin to output, it defaults to LOW, which of course activates the ...
0
votes
1answer
29 views

/etc/init.d/lirc doesn't exist

I am working on creating an IR remote for an older TV using my GPIO, primarily using this tutorial http://www.raspberry-pi-geek.com/Archive/2015/10/Raspberry-Pi-IR-remote#article_l1. However, when I ...
1
vote
1answer
2k views

Problem with ESC, brushless motor and Raspberry Pi

I have connected an ESC (an electronic speed control) with a battery and a brushless motor. The Raspberry is connected to the ESC to control it. I know - when I turn on the program that is on the ...
2
votes
1answer
70 views

pi4 no module named gpio

I am trying to import rpi.gpio in my geany on pi4, but it comes with error no module named gpio. The odd is that i updated pip and python and installed successfully with sudo apt-get install python3-...
0
votes
1answer
449 views

RPi.GPIO not working at all

I have just started with the GPIO on my raspberry pi but can't get any of the code to work. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(18,GPIO.OUT) ...
3
votes
1answer
1k 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 ...
0
votes
3answers
4k 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 ...
0
votes
1answer
1k 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
823 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). ...
1
vote
1answer
389 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?
39
votes
4answers
55k views

Can I use Raspberry Pi in commercial production?

I'm quite new to Raspberry Pi. I recently started hacking my new RPI with raspbian and working on a video streaming project. I finished my prototype and things are ready for production. RPI is ...
0
votes
1answer
31 views

2 Motors functioning unevenly - right motor gets more power than the left

I'm trying to execute this piece of code to run 2 motors on my robot. The code is really simple it's just repetitive. For some reason that I can't figure out, the motors run unevenly. Here is the ...
16
votes
7answers
42k views

Getting more than 26 GPIO pins

I would like to be able to output 75 digital out signals from the Raspberry Pi. However it has only 26 GPIO pins. Precise timing is not critical as long as it is within 1 second. I need to be able ...
-2
votes
0answers
37 views

how to import 'Adafruit_GPIO.SPI'?

import time import Adafruit_GPIO.SPI as SPI import Adafruit_MCP3008 CLK=18 MISO=23 MOSI=24 CS=25 mcp=Adafruit_MCP3008.MCP3008(clk=CLK,cs=CS,miso=MISO,mosi=MOSI) while True: v=(mcp.read_adc(0)/1023....
-2
votes
2answers
60 views

Runtime warning: This channel is already in use, continuing anyway [duplicate]

I'm trying to fix this code for a robot with multiple sensors. The values of TRIG and ECHO are input through another part of the code. Set this at the beginning of the code def init(): GPIO....
1
vote
1answer
1k views

Python picamera exposure_mode night not working

This program is coded within Python. As I wanted to get my raspberry to be aware of the current time(night or day) and being able to upload a video that is using night vision from the normal cam....
4
votes
2answers
2k views

Raspberry Pi camera doesn't work only displays red light

When I run my code, I get this error: No data received from sensor. Check all connections, including the Sunny one on the camera board The red light on the camera module glows, but doesn't ...
0
votes
1answer
3k views

How to start and stop python script using button

I've written some python code that should start and stop another python script (Datalogger) when a button is pressed. So when the Pi is booted up I'm wanting the button script to run and then once I ...
6
votes
5answers
50k views

How to connect a graphic card to Raspberry pi?

I want a way to connect a graphic card like nvidia or amd to raspberry pi do you think has a way to do that?
2
votes
1answer
53 views

I2C Communication between Arduino and RPi failing when Arduino is sending data

I'm trying to read some data from the Arduino slave and when I receive the data it shows some numbers but not the correct ones. I'm using node and i2c-bus module, also tried with wiringPi but got the ...
0
votes
1answer
43 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
37 views

Water Sensor Pull_Down

I've got the classic Iduion Water Sensor (Link) and I want it to simply detect the presence of water but I get unreliable readings when using it like this: import RPi.GPIO as GPIO import time GPIO....
1
vote
1answer
46 views

Make Raspberry Pi to work as AP and Station to receive wireless temperature sensor values

Hi after reading the manual of Xbee device, I am able to use XBee device with raspberry pi. But how to make raspberry pi to work as an access point as well as the station at the same time? using ...
4
votes
1answer
62 views

How to Monitor GPIO Input Indefinitely Without Recursion

I actually joined StackOverflow to ask this question because I wasn't sure it was RPi specific, but as I was thinking about how to form the question, I realized it might be GPIO specific (for some ...
1
vote
1answer
33 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(...
1
vote
1answer
58 views

False Contact Closures - Do I Need Physical Pull Up Resistors to Resolve?

I'm running Raspbian Jessie 4.9.35-v7+ on a Pi 3 Model B. I cobbled together a basic python script to monitor a GPIO pin and send a network signal to a remote application, made two copies of the ...
2
votes
0answers
119 views

How fast can GPIO pins toggle on the Pi 4?

Benchmarking of the Pi 4 using the Python GPIO Zero library shows a significant increase in the frequency of toggling a GPIO pin on and off compared to previous models. This result is attributed to ...
1
vote
1answer
32 views

Pausing code execution till a button is pressed

I'm trying to pause code execution till a button is pressed and this is what I came up with. I have not tested this but can anyone tell me if this is the right way to go about it? Button 'pressed' is ...
1
vote
1answer
174 views

Raspberry Pi 3 GPIO pins always active

Wiring setup for Rpi: I have an rpi 3, and I've recently started experimenting with the GPIO side of things. I'm new to electronics in general, although I do computer programming regularly. I have a ...
1
vote
1answer
90 views

Sixfab LTE IOT HAT throwing continuous AT Command

I was working on getting my new Raspberry Pi HAT that I have received and tried the simple example just to see if it is working fine. I have not been able to send a text message to my mobile phone. I ...
0
votes
2answers
87 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 ...
0
votes
1answer
53 views

How to run cylonjs in Raspberry-pi

I am trying to run cylon framework. I installed it using these instructions. Now I am trying to execute this sample LED blinking program. var Cylon = require("cylon"); Cylon.robot({ connections: {...
0
votes
1answer
53 views

Is there a piece of hardware which enables hotplugging sensors to the breadboard?

The idea is the following: I have a Raspberry PI connected to a breadboard. To this breadboard, I would like to connect (digital and analog) sensors and actuators while the PI is running. Or remove ...
1
vote
0answers
68 views

raspberry pi3 + fingerprint

I'm looking for a way to connect fingerprint scanner with raspberry pi3 using python. I'd like to use only gpio or hat (not usb) interface. I'm searching for a while without figured out, so I've ...
-1
votes
1answer
58 views

Segmentation fault error. Trying to loop a python program [closed]

I'm using AT commands to send data over http, but the problem is that sometimes the program has an error and wont run again until I reboot and the GSM. Im using a crontab and also running the file as ...
1
vote
1answer
21 views

RC522 modules stop working when more than 2 are connected

So, here's a synopsis of what I am trying to do. I want to put 3 RC522 readers side by side inside of a book, facing the cover, that will be constantly on, using a Rpi zero W. When an RFID chip gets ...
4
votes
2answers
15k views

How to trigger GPIO event using an active infrared sensor

Trying to get an active infrared sensor to trigger an event on a GPIO pin. I'm using python and the RPi.GPIO library on an RPi model B. Some background info, not sure how relevant it is, but I'm a ...
1
vote
1answer
72 views

Raspberry Pi 3 B+ was connected to NRF24L01 in the following manner as in diagram but Raspberry pie not working after that why? [duplicate]

I connected VCC to 3.3V and GND to 5V of raspberry pie mistakenly. Now raspberry is only showing red light on and no green light blinking. What might be the probable reason. Is there any solution so ...
-1
votes
1answer
136 views

Want to close garage door if it's been open for X minutes

I've followed a youtube tutorial on configuring a rPi with a magnetic reed switch and relay switch to allow for my garage door to be opened and closed via Homekit on my iPhone. It works great. The ...
1
vote
1answer
282 views

Why is PIR motion Sensor always on?

I'm trying to make an alarm system but the motion sensor is always on as soon as the script is run. I've posted a question about a different problem i was having with this project so it'll confusing ...
1
vote
1answer
245 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
3answers
118 views

How to stop LEDs blinking when button is pressed

I've got 4 LEDs, a buzzer and a button. There's an add_event_detect to switch the LEDs and buzzer on and off. The callback methods works find when the outputs are just on continuously until another ...
0
votes
1answer
137 views

What is this servo to Pi connector?

I'm trying to connect this servo to my RPi3 with as little wire as possible. What is this red, black, green wire called that allows me to connect a servo to my Pi?
0
votes
2answers
217 views

Reading only 0 from ADC using RPi SPI

Everytime I try to read analog channel 0 from ADC, it only prints 0. I am confused why. I shorted MISO and MOSI on my RPi to check SPI send/receive and it was working. But if I test it after properly ...
0
votes
1answer
22 views

Corrupted image file when using win32 [closed]

What things make the file is corrupted and not readable as an image file?! if the sd card is read-only, this prevent that I able to take a copy from it??!