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.

learn more… | top users | synonyms

11
votes
3answers
3k views

Can I use Raspberry Pi in commercial production?

I am 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 ...
1
vote
1answer
24 views

GPIO - RuntimeWarning: This channel already in use, continuing anyway

I was trying to run a motor using the Pi. It was working fine before when I was executing using a Python script. Later I installed WiringPi and tried to execute the GPIO using shell script and it ...
0
votes
1answer
24 views

GPIO HW PWM @ 143Hz and 20-80% duty cycle, with WiringPi's gpio utility

I've tried to find the solution from other threads but they all seem to miss the point to a certain degree, usually going into kHz and MHz, or into the SW GPIO territory that I don't need. I have a ...
1
vote
0answers
6 views

Running Deamon Involving GPIO on Pi [migrated]

I have a deamon that monitors various things using the GPIO ports. I have used python to write the code for this using the RPi.GPIO module. I would like to ensure that the deamon is always running, ...
0
votes
1answer
49 views

Cannot get ultrasonic sensor HC-SR04 to work(maybe I broke it with wrong wiring?)

I am trying to measure distance with HC-SR04 and Raspberry Pi A+ using Python on Raspbian. So here is how it is connected: VCC - to the 5V Out from L289N motor driver GND - to GND on the L298N motor ...
1
vote
1answer
32 views

Using I2c port as standart GPIO

When I try to use I2c1 SDA pin (GPIO 2 BCM number) via GpioController::OpenPin() func, it compiles OK but it throws an exception HRESULT:0x80070490 Element not found. How should I use I2c pins as any ...
0
votes
1answer
18 views

AdaFruit PiPlate(LCD+Keys) + PWM port + DS18B20 temp sensor

I would like to know if it is possible to use at the same time, the Adafruit LCD+Keys + the PWM port(to control a MOSFET) + one temperature sensor (DS18B20) and its oneWire protocol? I was concerned ...
-1
votes
0answers
35 views

Control speed of a fan with the Raspberry

I've a fan(a 24V, but when working I would like to adapt this to a bigger one on 230V) which I want to control with the Raspberry Pi(v2). I know that I could use a relay, but I would like to be able ...
0
votes
1answer
82 views

Raspberry Pi 2, PIR project, all pins always get GPIO.HIGH value

I folowing this tutorial https://bhavyanshu.me/tutorials/raspberrypi-to-detect-movement-using-pir-motion-sensor-hc-sr501/11/21/2014/ and a little bit simplified my code. #!/usr/bin/env python # ...
1
vote
2answers
32 views

Issue with python subprocess

I'm having some trouble with some code I'm working on. It should be obvious as to what it does in the code. Here is the python code I have: import RPi.GPIO as gpio import subprocess ...
0
votes
1answer
46 views

using GPIO Reading from 4 inputs give me non accurate output

I am trying to read from 4 inputs to get an integer value but when I test my code the actual value does not match the expected My Code: import RPi.GPIO as GPIO import os, time i=0 ...
-1
votes
2answers
89 views

Plug a 5V fan to GPIO 1 and 2

Regarding to the following picture, I understand that I can plug a 5V Fan by plugging it in between pins 1 and 2? This is right? (+ on 1 and - on 2?) My need : Plug a 5V fan to run all the time ...
3
votes
1answer
112 views

Importing RPi.GPIO

I am just writing some code for a Raspberry Pi robotics project. Since I don't have a Pi set up as a workstation, I am using a Google Drive notepad to do write it in, which recognises Python syntax ...
1
vote
1answer
36 views

RPLCD libary not working

I connected my 20x4 LCD module to Raspberry Pi like this: When I try to use code from RaspberyPi-Spy it works but RPLCD doesn't. This is how I initialize my LCD in 20x4.py (RPLCD test code) lcd ...
0
votes
1answer
60 views

How to use E18-D50NK on a Raspberry Pi?

I have one question . I want to try out a sensor called E18-D50NK, which is a infrared proximity sensor, for obstacle avoidance. More details and information about this sensor can be found here : ...
3
votes
2answers
104 views

Why are some GPIO pins HIGH when the Raspbeery Pi boots up

I have an easy circuit wired up, with a LED connected to pin 18 on the BOARD reference. I run a simple program to put pin 18 to HIGH, which turns the LED on, and then a couple of seconds later, I set ...
0
votes
1answer
67 views

How to query GPIO's value?

I am using raspberry pi B+ board. I have joined up an infrared sensor to GPIO 12. I want to use python to query this value, but I am getting "none" instead of a value. This is the code I am using: ...
0
votes
0answers
10 views

Can I use a Display-o-tron and a ENER314 Raspberry Pi RF-Transmitter board on the same pins at the same time? [duplicate]

I have both boards and I want to write a program to display info on the display-o-tron and control the Pimote Raspberry Pi RF-Transmitter board. links to both boards here ...
0
votes
0answers
14 views

Raspberry Pi 2 Model B Switches/Door Contact Switches [duplicate]

I am new to the Raspberry Pi and I was wondering how I would connect door contact switches (or any kind of switch) to the pins on my Raspberry Pi. I have a Raspberry Pi 2, Model B. The purpose of this ...
0
votes
1answer
185 views

Stuck with the “No access to /dev/mem. Try running as root!”

I have been searching, and still can't find an answer that will work. I've tried the chmod, chown, visudo, wrapper script -> main script options, and I still cannot manipulate the GPIO pins from a ...
0
votes
1answer
96 views

GPIO.cleanup() on RPi2

To make a long story short I am trying to read frequency on the RPi2's GPIO pins. The goal eventually would be to use this frequency signal to control a PyGame platformer that I have created. However ...
1
vote
0answers
114 views

kernel Disabling IRQ #49

I am using the RPi_GPIO library in a python shell to read a raw wireless signal using the wait_for_edge() function in a loop like so: while True: GPIO.wait_for_edge(26, GPIO.RISING) print 'R' ...
2
votes
0answers
252 views

Raspberry Pi 2, Windows 10 IoT Core, 433Mhz Transciever

Anyone had any success receiving RF signals with any circuit board transceiver (like NRF24L01, RF1100SE, CC1101, etc) on a rPi2 with Windows 10 IoT Core? I had this working fine on rPi/python, but ...
0
votes
2answers
92 views

How to connect Relay module to a Power Strip Outlet

I am sure somewhere a tutorial for this exists and I am just fool enough not being able to find it. So what I have done is: I have a 4 channel relay module I have connected the relay module with my ...
1
vote
0answers
51 views

GPIO superuser problem [closed]

I have an analog to digital convertor (mcp3008) hooked up to the spi ports. I'm running a python script that reads the digital input and prints it as an integer number to the screen. I want to take ...
4
votes
1answer
194 views

RPi.GPIO under Python 3

Raspberry Pi2 B, standard Raspbian. Using RPi.GPIO, V3 installed as: sudo apt-get install python-rpi.gpio python3-rpi.gpio On line import RPi.GPIO I get ImportError: ...
1
vote
1answer
33 views

designing a traffic controller based on traffic flow and it runs on infinite loop

I'm designing a flow rate based traffic controller on raspberry pi using buttons as traffic simulators. the problem i'm facing is that the maximum value gets selected at first and there can be no ...
0
votes
0answers
29 views

Return from a gpio event

Finally I was able to fix this with a program that uses gpio.add_event_detect, but when I get the audio file I need to send it to another function and get text that that function return. This is my ...
0
votes
0answers
22 views

How “security” is addressed when connecting pi with wireless transmitter and wireless switch

(I'm new here please forgive me if asking this question is not in line with the etiquette) Michael described how to control 433MHz receiver with Pi However, these Elro receivers require the pairing ...
1
vote
1answer
39 views

The Current in mA at 3.3 V When Using the Internal Pull-up Resistors

I'm using RPi.GPIO in Python 3. If I do GPIO.setup(24, GPIO.OUT, pull_up_down=GPIO.PUD_DOWN) GPIO.output(24, 1) will then a current flow internally from the pin to ground even if it is not ...
0
votes
0answers
55 views

Gpio state can't be changed when connected to a DC motor or led

I am using the pi4j library to control the gpios on the raspberry pi B, but I ran in the following problem: when I start a pi4j example like ControlGpioExample.java then the led(with resistor 220 ohm) ...
0
votes
1answer
59 views

Rpi GPIO 40 warning channel is busy

When I try to toggle the Raspi pin no 40 using the code it gives me message RuntimeWarning : The channel is already in use, continuing anways and asks to disable warnings. Even after doing ...
0
votes
1answer
216 views

How to initialize an ESC with python code [duplicate]

Hello everyone I am a newbie to this,but i have a really important issue.I cant make my brushless motor move,it kepps on beeping. I have connected it to an ESC and is trying to signal the ESC from the ...
0
votes
1answer
53 views

GPIO Input fluctuating between high and low when no input is received

I've got a fairly simple circuit that I've made where a motion detector is connected to a Raspberry Pi B+ GPIO by way of a fairly long ~30ft stretch of wire. The detector is being powered by a 9V ...
1
vote
2answers
52 views

When i set the GPIO pin as output in my python cgi script, after that line my browser does not execute the cgi script. Why?

import RPi.GPIO as GPIO GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(False) GPIO.setup(18, GPIO.OUT) print "<h1> line 4 </h1>" The above does not print line 4 in client's browser
0
votes
2answers
266 views

Python taking pictures with raspberry pi camera

I have written this code to take a picture when it detects motion however when I run the code it prints 'picture taken' but does not save the picture. I know my camera works as I tested it in LX ...
1
vote
1answer
162 views

Change GPIO pin mode to ALT with Python RPi.GPIO

I usually use RPi.GPIO module like this to set up the GPIO pins: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP) GPIO.setup(17, GPIO.IN, ...
0
votes
1answer
158 views

GPIO not working after installing the webiopi

I was doing programs with LED's and the GPIO after I installed the Webiopi to access it from the internet it didnt work anymore, I tried installing the latest version of Python and the rpg.gpio and ...
1
vote
1answer
324 views

How to shutdown GPIO elegantly when using kill to stop Python script running in the background?

I'm using GPIO in a Python script, and I've wrapped my code in a try... except block so that GPIO is exited elegantly if I need to abort the script: GPIO.setup(17, GPIO.OUT) # Configure GPIO so that ...
1
vote
1answer
120 views

Problem when trying to get a DC motor to run using the L298N H-Bridge?

My setup is as follows: Using this motor controller board, I have one DC motor (I'm new to electronics, so I'm not sure when I say it's rated at 1.5V, because one 1.5V AA battery on its own makes it ...
0
votes
4answers
336 views

How to blink LEDs on/off continually, while continuing execution of a script?

I've connected red and green leds via GPIO and I can successfully switch them on/off using RPi.GPIO - now I'd like to: start an led blinking on/off every 1 second have the script continue its ...
2
votes
3answers
330 views

How to connect 7-segment 4-digits display with Pi?

I would like to connect such a 7-segment 4-digits display (with common anode) to the Raspberry Pi: What's the simplest way to do it with Python for example? Do I need the RPi.GPIO package? Is there ...
0
votes
0answers
91 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
2answers
93 views

How to change the default baudrate of raspberry pi's serial port?

Iam getting junk values that is being read by rpi's serial port. Rpi is reading data through its serial port from a zigbee which is connected to the ttyAMA0 of rpi. In the python program, i've ...
2
votes
1answer
96 views

How do I get Python to recognize that it is running on a Raspberry Pi

I just purchased a Pi 2, and everytime I use "Import RPi.GPIO" in Python it returns an error that says RPi.GPIO can only be run on a Raspberry Pi, but I am running it on a Pi. I tried apt-get update ...
0
votes
0answers
203 views

Different “Adafruit 16x2 Character LCD + Keypad for Raspberry Pi” Python Libraries & Sunfounder plate

I have the SunFounder I2C interface 16x2 LCD Pi Plate with KeyPad with RGB LED for Raspberry Pi plate (this model available at Amazon (sorry I have only the german link - the picture is showing the ...
0
votes
0answers
9 views

Installing PS3 controller with RPi [duplicate]

Hi I have been trying to install and work a PS3 controller with my raspberry pi. I want to use it as a joystick to control 2 motors which are speed regulated using ESCs. I have followed various ...
0
votes
2answers
127 views

What happens if I try to read an analog pin's value?

I know there is a simple circuit you can make to be able to read an analog pin but what if I don't know if my device's pin is giving me analog or digital? If I try to read from that pin anyway am I ...
0
votes
1answer
93 views

gpio get value of pin

I'm trying to get the value of a single pin from an rc receiver (receiver info at bottom). What's the correct way to read the value coming in? Here's my existing code: import RPi.GPIO as GPIO ...
-1
votes
2answers
237 views

GPIO is not working, 5V working, 3.3 V working, Raspberry Pi B+

I am the RPi B+ user. Feeling confused about the GPIO. GPIO isn't working. I tried checking it with multimeter by connecting the pin 21 to the gnd, not work. And then i tried the 5 v and 3.3 v, it ...