Questions tagged [python]

Python is a general-purpose, dynamically typed, object-oriented high-level programming language. Interpreters for versions 3.x and 2.x come installed on the Raspberry Pi's most popular operating system distributions.

Filter by
Sorted by
Tagged with
0
votes
1answer
18k views

How do I get weight sensor's data to Raspberry Pi (HX711 Load cell)?

Can someone please give me the Python code to get the weight from a HX711 load cell into the Raspberry Pi? Also, can you please let me know if you used an I2C or SPI protocol?
0
votes
0answers
207 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
2answers
2k views

How to drive two stepper motors simultaneously

I am using a raspberry pi model B to drive one stepper motor with the L293D chip and python. Now I would like to control two stepper motors simultaneously with two different L293D chips and python. I ...
0
votes
1answer
661 views

PiCamera Multiple Video File Recording H264

I want to know if it's possible to record four H264 video files with PiCamera with a specific frame ? For example, I am recording 10 seconds of video at 4 fps. So normally, I will get a video file of ...
0
votes
1answer
585 views

Monitor data sent to 74HC595

I'm new to Python and Raspberry Pi, so please bear with me. I would like to intercept the bytes of data being sent to a 74HC595 switch register. GPIO pin 23 on my RPi is connected to the data pin of ...
0
votes
1answer
127 views

how to control 12v 600ma motor using raspberry pi [duplicate]

I have a 12v 600ma motor. I want to control it with the raspberry pi gpio pins. How to draw that much of current from raspberry pi gpio pins to drive that motor. Please suggest me any cicuit ...
0
votes
0answers
6k views

import _tkinter # If this fails your Python may not be configured for Tk

I'm with problem with compile this file in Python, I tried to use Python 2 ou 3, but it persist with this error. When o type python3.4 ServoMotor.py it returns me # python3.4 ServoMotor.py ...
0
votes
1answer
965 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
0answers
127 views

Raspberry pi 2 encoding problems which not occur in Mac OS X?

I'm Korean and had made Korean-web crawling program using Python3. I checked that it runs on OSX. And I tried to port this program to my Raspberry pi 2 (Linux raspberrypi 4.1.16-v7+) (Actually, I ...
0
votes
1answer
683 views

ultrasonic sensor stops after giving some reading when running in thread on tornado websocket python

I am using Ultrasonic sensor to get reading and am using python program for getting reading. And am using Raspberry pi for this. when am running python program independently its giving me reading ...
0
votes
1answer
599 views

Raspberry Pi B+ (LCD-display 16x2)

I'm new to Raspberry Pi and I'm trying to get a hang of the GPIO and all that. I bought a LCD-display 16x2 with 4 buttons (http://tinyurl.com/p4kjc3z). I bought this one because it fits the first ...
0
votes
0answers
2k views

Getting error while running Raspberry Pi Camera

I am using a Raspberry Pi along with the camera module to build a spy camera standalone device, (just for learning). I ran this code on my Raspberry Pi which gave the following error: initialising, ...
0
votes
0answers
1k views

Python Raspberry flow sensor

I just started programming in Python and I have a little problem. I want to create a simple application based on YF-S201 (flow sensor) and DS18B20 (1wire thermometer). My problem is in the "loop". ...
0
votes
1answer
599 views

GPIO interference input [duplicate]

I was trying to get my PIR sensor working but I got really strange readings. I unplugged everything from the breadboard, including the motion sensor but I still got a signal to the GPIO pin. After ...
0
votes
4answers
5k views

cannot install python-dev

I have tried to do a sudo apt-get install python-dev however I get this, Reading package lists... Done Building dependency tree Reading state information... Done Package python-dev is not available, ...
0
votes
0answers
2k views

Serial communication on Raspberry Pi - can send data, but cannot read data

I'm using Raspberry Pi 2 to realize RS232 communication between raspberry and my laptop. It seems that my Raspberry Pi can send data, but it can get nothing from my laptop. The following information ...
0
votes
0answers
1k views

Best way to access GPIO through a nodejs script - without root

I'm building a web dashboard for a temperature sensor. The page is served by node.js, and the sensor connected to GPIO is accessed by a Python script, which is run by node.js. Relevant code: var ...
0
votes
0answers
444 views

GPIO.setup not working

I've installed Ubuntu on my Raspberry Pi 2. I'm trying to run a script (mostly copied) #!/usr/bin/env python import RPi.GPIO as GPIO print("Test 1") GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(True) ...
0
votes
2answers
5k views

calling Python script with GPIO module over apache2 web server

I have test.py file, and it contains GPIO module commands: #!/usr/bin/python import RPi.GPIO as G import time G.setmode(G.BCM) G.setup(18, G.OUT) G.output(18, True) time.sleep(3) G.output(18,...
0
votes
1answer
3k views

Pulling GPIO pin to ground [duplicate]

I am trying to use a Pi for a remote power switch for a computer. The way the computer's power switch is configured is that it has a "Power" lead which is 3.3v, and a ground. to turn the computer on, ...
0
votes
0answers
742 views

Controlling brushless motor with ESC and Raspberry Pi b+

I'm trying to build a quadcopter and I have one ESC, one brushless motor and one Raspberry Pi B+. I find many tutorials on internet to see how to connect these components but it doesn't work. I'm ...
0
votes
1answer
78 views

How to make IO Error: Decoder jpeg go away?

I found a solution here but it seems to only work with python 2.7 and I need it for python 3.2. Also how do I uninstall a library?
0
votes
4answers
1k views

boot up rasbian into gui program, no interaction

I have a project I want to do, and I got an SPI touch screen (tontec 3.5") for it. I want to start up into some sort of GUI application. I only have roughly 950mb left on my micro SD (8gb, install ...
0
votes
0answers
198 views

Python Subprocess Error

I am trying to call this command: avconv -i '/opt/music/Smooth Criminal.mp3' -ac 1 -ar 22050 -b 352k -f wav - | /opt/pifm/bin/pifm - 98.3 with my own paths. In the terminal it works like a charm but ...
0
votes
1answer
713 views

Apache server control Python script

I have a temperature sensor on my Raspberry Pi 2, I read the data with a python script. My question is how do I run that script on the Apache server (with a push of a button). Specifically how do I ...
0
votes
1answer
547 views

“Segmentation fault” error when using Gstreamer on Raspbian

I installed Gsreamer on Raspbian with apt-get install gstreamer1.0 . when I want run my Gstreamer application(writen with pyqt4) On Raspbian, I get "Segmentation fault" error. I should say when I run ...
0
votes
1answer
237 views

How to hide PWM.add_channel_pulse(dma_channel, gpio, start, width) output?

I use RPIO.PWM to control servos. All the time, the PWM.add_channel_pulse(dma_channel, gpio, start, width) method is called, text about the change is displayed (see image). I know there is a way (&...
0
votes
0answers
63 views

How to auto start a script in Raspbian [duplicate]

Hi I am trying to autostart a python script . I have edited the rc.local file to add the file location before exit 0.. sudo python /home/pi/myscript.py & The myscript.py has executable ...
0
votes
1answer
1k 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 ...
0
votes
1answer
3k views

pure python mjpeg streaming?

I tried the mjpegStreamServer from here but it doesn't seems to work... First of all, most times, after run it throws errors: — Exception in thread Thread-1: Traceback (most recent call last): File ...
0
votes
0answers
71 views

Using python on raspberry for leds sometimes not working

I am using python to turn leds on and off in a little project (raspbian) but I don't know why sometimes the leds turn on and sometimes they don't. You can find the code below, could you please tell ...
0
votes
1answer
2k views

Need help creating a python script to access an HTU21D

I have a Raspberry PI 2 and I am having a hard time getting any scripts that work to read the HTU21D-F. This the errors I am getting. Traceback (most recent call last): File "...
0
votes
1answer
2k views

Raspberry pi with python speech_recognition having error

I have a raspberry pi model B, running speech_recognition 4.1 and pyaudio 0.2.8, and I am using a Logitech usb mincrophone. When I try and start speech recognition using with sr.Microphone() as source:...
0
votes
1answer
2k views

Raspberry Pi RFID interfacing

I am trying to interface my raspberry pi to a RFID reader, to make an library management system. I have brought a RFID reader whose data sheet can be found here. I have found a python program which ...
0
votes
1answer
5k views

Auto Start a .py file with LXTerminal [duplicate]

I want to start a .py file after booting with LXTerminal. I'm using raspbian OS I try these steps: I edited sudo nano /etc/xdg/lxsession/LXDE-pi/autostart with @lxterminal and this is open ...
0
votes
1answer
478 views

Python as web server cgi and request response cycle

I am new to python and I am trying to design a mobile app with a web server on a raspberry pi. I decided to write the server code using python because I want to control some pins and write on the ...
0
votes
0answers
83 views

Singular access to the NOIR board from a server and a motion script

I am using the raspberry pi NOIR board to supply a Python motion detection script. This "motion detection script" uses opencv2 to grab, modify and detect motion. I wanted to extend the motion ...
0
votes
2answers
104 views

Extend my project to multiple remote Pis

My project is a home security system. Until now everything is embedded on one device. But I would like to use multiple Pi's, for example RFID reader on different spots without the need of cables. The ...
0
votes
0answers
613 views

WiringPi and CGI in Python

I want to be able to toggle a GPIO pin from from a web browser. I've found this forum topic (http://tiny.cc/d1eixx) and even the though code seems fine, it doesn't toggle the pin: #!/usr/bin/python ...
0
votes
0answers
960 views

Sending text on android phone commanded by Raspberry pi USB, WITHOUT internet

I simply want the Raspberry Pi to instruct a mobile Android phone to send a text SMS. The preferred connection to the Pi is via USB. I do not have an internet connection in this configuration. I have ...
0
votes
1answer
2k views

Understanding the library from MCP3002 ADC chip

can somebody explain to me about this mcp3002 library used in analog to digital conversion?? It has some connection to my first question here. # botbook_mcp3002.py - read analog values from mcp3002 # ...
0
votes
0answers
3k views

UHF RFID Reader with Raspberry Pi

I have a RFID Reader like the one posted on this link: http://www.ebay.com/itm/EPC-Gen2-UHF-Integrative-5-7-Meters-Long-Range-RFID-Reader-with-free-SDK-/171473207602 It has RS232, RS485 and Weigand ...
0
votes
0answers
666 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
0answers
2k views

Does this show PyAudio is unusable with RaspberryPi's built-in audio?

When using PyAudio with the RaspberryPi's built-in audio snd_bcm2835, we get this strange behaviour: python test.py # ... after 10 or 15 seconds the sound is stuttering! This problem doesn'...
0
votes
0answers
466 views

ImportError: No module named HT16K33

When I am importing a library (specifically Adafruit_LED_Backpack using Python3) I get the error ImportError: No module named HT16K33 How do I install that library? EDIT: when using Python 2.7, the ...
0
votes
1answer
692 views

Running a python simple script at startup/boot [duplicate]

Can anyone please help me to run a simple python script at start up? (for eg. let the script print hello) please explain me step by step,,,starting from basic steps! I tried many examples using ...
0
votes
4answers
3k views

How To Start Learning Python For Raspberry Pi? [closed]

I have old version of Raspberry Pi (Revision B) and now I am planning to create a robot with it. However, I don't know python at all. I want to learn python but haven't found any tutorial that teaches ...
0
votes
0answers
494 views

Web based IR/RF device control over long range

I am trying to implement a Building Automation System where I would like to implement web-based or mobile based control of all ir/rf based devices like tv,a/c,sound system, etc. The PI will be placed ...
0
votes
1answer
758 views

GPIO Connections

I would like to use raspberry pi for measurement of Temperature,Humidity,Motion, soil moisture & distance. I would like to add three led indicators. I'll be using following sensors 1) DHT-11 ...
0
votes
2answers
421 views

sleep() affecting only one certain output

the topic name might seem a bit chaotic, but I'm struggling to describe in one line what I mean. I want to create a python script that plays different sounds when certain button is pressed. So far I ...