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.

137 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
2k 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 ...
0
votes
0answers
2k 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
0answers
1k views

Failing to turn on a LED with GPIO Pins (Raspberry Pi 3 B V1.2)

I'm trying to play around with my RaspberryPi a bit and I'm failing miserably... ANY help ist highly appreciated! I'm on a brand new installation of Raspbian, after "apt-get update && apt-get ...
0
votes
0answers
332 views

ESC PWM Duty Cycle between 20 - 70

I've wired my ESC and my Motor and I'm able to spin it at different speeds, but it only works between 20 - 70 DutyCycle. How can I make it start spinning at 1 and max throttle at 100? I'm using ...
0
votes
0answers
273 views

Playing audio mess with GPIO.add_event_detect in Python

I have these lines of code running in Python on my Pi 3: os.system('mpg123 -q /usr/local/marbik/public/evilcave.mp3 &') GPIO.add_event_detect(17, GPIO.FALLING, callback=GPIO17Callback, bouncetime=...
0
votes
0answers
134 views

GPIO pin being set to input upon exiting program

I have this code: import RPi.GPIO as GPIO import time try: GPIO.setmode(GPIO.BOARD) GPIO.setup(3, GPIO.OUT) GPIO.setup(12, GPIO.OUT) GPIO.output(...
0
votes
0answers
304 views

RPi.GPIO is never reachable after upgrade to Python3

yesterday I run an install of Python3 on my Raspberry Pi 3. The preinstalled Python version was 2.7.1 If I run a scrip now, i reveive the following error message: import RPi.GPIO Traceback (most ...
0
votes
0answers
222 views

Unable to set GPIO.HIGH. GPIO.LOW

I am trying to control a relay with Pi3B. Whenever I run GPIO.setup(port, GPIO.OUT) my relay starts working, then any other command I try, eg. GPIO.output(port, GPIO.HIGH) or GPIO.output(port, GPIO....
0
votes
0answers
28 views

HDMI output is off once I connected my pi to an oscillscope

I connected the +5v and gnd of my raspberry pi to an oscilloscope. Once I did that, my screen gave me a blank screen as if it is not getting any output from HDMI of raspberry pi. I turned off/on the ...
0
votes
0answers
104 views

PIR sensor GPIO

[CIrcuit1By default PIR input pin(middle) is HIGH. When i run the below code, gp.input(27) always gives me value 1. My code: import RPi.GPIO as gp import time gp.setmode(gp.BCM) gp.setup(2, gp.OUT) ...
0
votes
2answers
628 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) ...
0
votes
0answers
226 views

Why after adding GPIO.cleanup to my code it still show the GPIO channel warning?

I wrote some python to blink a led. Without the GPIO.cleanup method, I had the following warning: "This channel is already in use, continuing anyway". Then I did tempo=1 import RPi.GPIO as GPIO ...
0
votes
1answer
1k views

Wiegand GPIO read not working all the time. Works most times but hangs on some reads

I'm extremely new to Python, I've been learning a bit over the last couple weeks. This is what I've managed to come up with. I'm pretty over the moon the code works most of the time but it doesnt work ...
0
votes
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 ...
0
votes
0answers
96 views

Fully Bit-Banged SPI

I would like to be able to run SPI over whatever GPIO pins are available on my Pi (2 and Zero mainly). Is there any decent full code example for SPI Read/Write using RPi.GPIO on arbitrary pins? Speed ...
0
votes
0answers
3k views

How to use two HC-SR04 Ultrasonic sensor modules with Raspberry Pi

I am doing a project with raspberry pi. In it, i use two ultrasonic sensors and two buzzers. When one sensor finds an obstacle, within 50 - 450cm range sensor will beep and print the distance to the ...
0
votes
0answers
2k views

PIL Module not found even though it is installed

I am able to run a program normally from the python IDLE, but unable to run the program as a sudo. (I need to work with the GPIOs, so I require to use sudo.) I get a error, that the PIL module is not ...
0
votes
1answer
4k views

Touch functionality on 3.5" LCD Touchscreen not working

I have loaded the Raspbian image onto my LCD Touchscreen for the Rasp Pi. However, the touch facility does not work. The display is there but no touch. Can anyone help? I am using the Waveshare 3.5" ...
0
votes
0answers
716 views

Raspberry Pi Frequency Calculator

I'm trying to make a simple program that calculates the frequency at a pin on the board. I'm using Python for the programming. I wrote two different programs and they gave the same (wrong!) results. I ...
0
votes
1answer
878 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
152 views

Weird behavior of Raspberry Pi GPIO ports

I am trying to manipulate the GPIO pins using python. I have used many examples from the web. However, I noticed weird behavior of GPIO ports. 1) If I make a port high, it becomes high momentarily ...
0
votes
1answer
69 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 ...
0
votes
1answer
365 views

Why is my GPIO not switching my attached relay?

I have a relay attached to a Raspberry Pi B+ GPIO via two wires, one wire is attached to physical pin 6, a ground pin, the other is attached to physical pin 15 (GPIO. 3, BCM 22, wPi 3). I have a 2 ...
-1
votes
1answer
27 views

input pin not working

I connected the 3v3 power pin to a switch and then to an IO pin set to input. when I turned on the switch, it works fine and I detect an input, but when I turned off the switch, it was going back and ...
-1
votes
1answer
41 views

Odd results when using RPi.GPIO's event_detected() function

I've recently been experimenting with RPi.GPIO's event_detected() function, to check if a button (connected to the gpio) has been presssed. However, for some reason events would randomly be detected. ...
-1
votes
1answer
616 views

function to wait for any of the buttons press

I'm working on a project that use four buttons to navigate in a menu. The root options of the menu have nested options etc. The buttons don't have hardware de-bouncing. My ultimate objective is to ...
-1
votes
1answer
2k views

Module not found Error

I am working on rasberry3 pi b+ model for my project and I did installed NOOBS zip file and stored in Micro SD card and put in SD slot on Rasberry Pi b+. When i'm compiling my python code for my ...
-1
votes
1answer
71 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 ...
-1
votes
1answer
246 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 ...
-1
votes
1answer
2k 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()...
-1
votes
1answer
81 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 ...
-1
votes
1answer
908 views

Frequent 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 ...
-1
votes
1answer
1k 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
votes
2answers
197 views

Traditional Light Switch Triggered by RPi?

Does anyone know of a light switch which can be controlled using the RPi and also manually. Assuming that the RPi sends a signal thru a relay which connects to the light switch. The switch will turn ...
-1
votes
1answer
192 views

GPIO modes without breaking serial

I am using and Adafruit BNO055 IMU and using their provided modules to read the data, i have been able to do so. However i want to be able to turn some of the GPIO pins to high as i want to control ...
-1
votes
1answer
373 views

webiopi simple 3 wheeled robot, not functioning

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; ...
-1
votes
2answers
450 views

RPIO Module installation

I've been trying to install the RPIO module onto my pi. so far, no luck because my pi is without internet at the moment (I only have internet on my laptop through mobile tethering). Does anybody know ...

1 2
3