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.

691 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
0answers
473 views

Recording sound of 4 USB microphones connected to Raspberry Pi and calculate TDOA

For my project to locate a sound source, I need to calculate the Time Difference of Arrival (TDOA) of 4 microphones. I want to connect this 4 microphones with a powered USB Hub to my Raspberry Pi and ...
0
votes
0answers
323 views

Update Python Libraries directly on SD Card

I do not have an internet connection at my house, I can however connect to the internet where I work. Is it possible to install and update python libraries directly from my mac onto my SD card.
0
votes
1answer
920 views

Audio Processing Issues in PyAudio in RPi

Basically, I want to analyse the spectrum of the input audio stream to my Raspberry Pi. I have configured my Audio USB Adapter and ran sample tests on Play and Record. I am using PyAudio to take ...
0
votes
1answer
709 views

Using gpio from CLI to trigger a rising or falling event detection

I have a python system script with various functions. I have multiple buttons hooked up to the Pi and I am using this code: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(22, GPIO.IN, ...
0
votes
1answer
5k views

Active Long Range RFID system for Raspberry Pi 3

I have bought those cards: UHPPOTE 2.4Ghz RFID Active Card for Long Distance Range Reader Vehicle Parking System. I need to buy certain RFID readers to be able to read data from those cards and work ...
0
votes
0answers
56 views

Rpi lockout keyboard for x seconds Python

Ive made a python scrpit that detects keypress on numpad to run a function using getch (eliminates having script ontop all the time). I did find 2 examples one uses pyhooks (win32) and other uses /...
0
votes
0answers
140 views

Raspberry Pi 3 freezes after GUI Python program is minimised/closed

I am using the Raspberry Pi 3 alongwith its 7-inch screen. I have developed a software that shows real-time temperature on the screen alongwith some other functions. The software runs fine without ...
0
votes
0answers
652 views

Problem writing to log file by first run python script

At the first run python script nothing is written to the log file "cpu_temp.csv". When I run the second time then the data is written to the log file. The script is to extract the temperature from ...
0
votes
2answers
302 views

Pigpio belt speed encoder

I'm trying to read pulses from an encoder to measure belt speed. My encoder is 500 ppr. I have approx 2400 pulses per meter and I need to measure speeds upto 450 meters per minute. Can anyone help ...
0
votes
1answer
644 views

Understanding struct.unpack code

Hello great community of helpers! We new programmers greatly appreciate your continuous help. Thank You! Can you explain this 1 line of code below... - Or break it down into separate chunks. I ...
0
votes
3answers
3k views

Raspberry Streaming using VLC picamera python

I am trying to stream Raspberry Pi camera video using VLC. The code is as follows: import subprocess import picamera camera = picamera.PiCamera() camera.resolution = (640,480) cmdline = ['cvlc','-vvv'...
0
votes
1answer
524 views

Listen for certain keyboard input and insert to SQL Server DB

I have a USB NFC reader (acts as an emulated keyboard that types out the 10 digit ID number on the card when scanned). I want an app to listen for this input and when it sees 10 digits, I want it to ...
0
votes
2answers
66 views

how to identify if ultrasonic pin is removed from circuit using python code

this is the simple code to measure distance using ultrasoinic sensor attached to reapberry-pi and by writing python script-- import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) TRIG = 16 ...
0
votes
2answers
2k views

Kivy won't listen to “fulllscreen” setting

Working on a Raspberry Pi Model 3 B, running raspbian. Running Kivy v1.9.2-dev0 and Python v2.7.3 Trying out one of the Kivy examples but for some reason the application won't come up in "Windowed ...
0
votes
0answers
772 views

Inconsistency reading from /dev/mem in Python

I've posted a more generic version of this question on Stack Overflow, but since I've had no response I'm hoping someone over this side might have an idea. I've been working on a project in PHP which ...
0
votes
1answer
136 views

generated pulse with delay time before it generated

I want to generate about 16 square wave with delay time initial as the following figure .It mean each pulse generated must delay with a value of delay time before it generated with frequency about ...
0
votes
1answer
98 views

Piface Digital Master and PiFace Relay Plus Slave

I wish to control four state reconfigurable antennas in a propagation measurements using RPis at both ends of the propagation channel. The headless master RPi has a PiFace digital to control the start ...
0
votes
1answer
109 views

encoding problem: unable to find the match text only during reboot

I have a python file that is running ok if i run it in a terminal in raspberry pi. But if i set it to automatically run after it reboots (using crontab), the file runs ok until it reaches the line ...
0
votes
1answer
390 views

Access GPIO pins through a Flask + Apache/mod_wsgi

I get an internal server error when I import the gpio pins library in my simple __init__.py file. And the debugger doesn't show up. As I understand it, the server doesn't have the permission to ...
0
votes
2answers
861 views

How do I Install Kivy for python 3.4 on my raspberry? Is that possible?

The question is on the title XD How do I Install Kivy for python 3.4 on my raspberry? Is that possible? I tried using the https://kivy.org/docs/installation/installation-rpi.html guide but thats only ...
0
votes
1answer
432 views

/dev/ttyusb0 cannot be find while starting script on boot for raspberrry pi

(Currently using Raspbian Jessie latest) So currently I am trying to start a script that reads from the rf receiver and gathers the data and sends it over to the cloud... I am trying to start this ...
0
votes
2answers
383 views

Trying to interface with the serial port with a simple program

Hey I am trying to work with the serial port of my raspberry pi model 2B with a raspbian jesse OS. I have disabled the serial login shell over serial in the advanced options. I have enabled uart in ...
0
votes
0answers
664 views

PICamera - Custom output (start_recording())

I need access to full camera video resolution (1080p) and after searching found that recording (start_recording()) methods of PICamera is much better than capturing methods(capture_continues()) ...
0
votes
1answer
536 views

sudo pip install packagename not working

sudo pip install packagename not working... I am not able to install python package using pip.
0
votes
0answers
943 views

saving GPIO data to sqlite using python, retrieving dynamically using php

I am try to make a game for my son, it has 2 vibration sensors that represent Balls and Strikes (for baseball). When a sensor is hit I have a loop that adds a tick to either the strike or the ball. ...
0
votes
0answers
63 views

Python script runs in RPi 2 but not RPi 3

I used the code provided in this tutorial and successfully ran it on the RPi 2 but when I follow the same steps on the RPi 3 it won't work. The shell just says: >>>=====RESTART===== >>&...
0
votes
0answers
396 views

Most efficient way to play music with floppy drives

I've been wanting to use my RPi as a controller for a floppy drive symphony for a long time. However, progress is going very slowly because I keep running into issues. Whenever I try to use more than ...
0
votes
0answers
401 views

Performant way to dump DS18B20 data to Mongo

I've worked with DS18B20 sensors before and have written and used scripts to access their data and make it available to a webserver using Flask and javascript. Now however I'm looking for a way to ...
0
votes
1answer
20k 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
217 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
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
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
0answers
128 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
777 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
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
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
480 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
0answers
765 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
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
206 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
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
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
0answers
626 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
974 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
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
690 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'...