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
268 views

How can I stop this script (date an time with I2C LCD)

I found this script to show date an time on this site: http://www.circuitbasics.com/raspberry-pi-i2c-lcd-set-up-and-programming/ Once is running how can be it stoped? I like the idea of showing the ...
0
votes
0answers
27 views

Running Arduino command on Raspberry Pi 3 [duplicate]

I am a mechanical engineering student who is currently doing my final year project. Basically I am trying to develop coding for the cornering movement for in pipe robots, but my problem now is that ...
0
votes
0answers
283 views

PocketSphinx - ALSA IOError: -9997 while trying to Decode Speech

I am trying to use Pocketsphinx for voice recognition. When I was trying to include it in python, using this file: #!/usr/bin/python from os import environ, path from pocketsphinx.pocketsphinx ...
0
votes
1answer
728 views

NoIR V2.1 camera auto white balancing

I have a Raspberry Pi NoIR V2.1 camera. I am working with the NIR (940 nm) LEDs and I saw that I was getting funny/weird colors, so I assumed that it is due to the white balancing, so I switched off ...
0
votes
0answers
347 views

How do I output power to GPIO pin?

I have GPIO to USB adaptor. There is a small light connected to the USB end. I have 4 TTL cables Red, Black, Green and White. By black cable is in pin 6 (ground), white in pin 8 and green in pin 10. I ...
0
votes
1answer
645 views

Sense Hat RGB Code

I am a new programmer, trying to learn python. I am using the sense hat to mess around with, I want to make it like rotate RGB colors. I am using the sense.set_pixel and passing in the x,y and r,g,b ...
0
votes
1answer
535 views

Use MCP23017 pin for read data

I just get an MCP23017 circuit and wired it to my raspberry pi like in datasheet. I am able to set pins for hight/low (tested with leds) using this code: import wiringpi as wiringpi from time import ...
0
votes
1answer
313 views

Setting up the Raspberry Pi as a client on a sever

I'm attempting to give my Raspberry Pi a static IP address on an ethernet network that I am controlling from a Windows machine. I want to be able to send my PI UDP packets directly from my server via ...
0
votes
0answers
435 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
272 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
823 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
618 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
4k 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
54 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
135 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
1answer
371 views

twitter api Twython Raspberry Pi error

I got an error in the twitter api Twython on my Raspberry Pi? ERROR: from .api import Twython from requests_oauthlib import 0Auth1, 0Auth2 ImportError: No module named requests_oauthlib
0
votes
0answers
559 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
1answer
303 views

No print output on raspberry IDLE

I've been trying to create a program that split few different section of my main OpenCV program to increase fps. The first thing i ever think of is the Pipe() function from my friend. I've tried this '...
0
votes
1answer
377 views

Save TTL pulse input time while recording video from Raspicam

I am recording video using Raspicam and saving the video buffer as well as timestamp for each frame using the following script: import io import time import datetime as dt from picamera import ...
0
votes
2answers
2k views

12v relay not turning off with usual gpio off comands but turning off with gpio.cleanup

I have SRD-12VDC-SL-C relay module which I want to control using raspberry pi but unfortunately, none of the gpio off commands are working. However GPIO.cleanup and turning pin to input is working to ...
0
votes
2answers
269 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
2answers
6k views

Install Python Module pyodbc on PI?

I am trying to connect to a MS SQL database and get some values over a Raspberry Pi. I have my Python script and it works well on windows, but i dont know how to install the 'pyodbc' module on the PI. ...
0
votes
1answer
560 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
1answer
988 views

How to stop python script that launches raspivid

I have the following line of code in a .py file raspivid -o - -t 0 -hf -w 640 -h 360 -fps 25 | cvlc -vvv stream:///dev/stdin --sout '#rtp{sdp=rtsp://:8554}' :demux=h264 When I execute videoscript....
0
votes
1answer
812 views

Can't import picamera

I've installed picamera with pip install picamera, but I can't import it. I get this error message instead: Traceback (most recent call last): File "<stdin>", line 1, in <module> File ...
0
votes
1answer
216 views

Rpi not catching all GPIO Inputs

I'm currently using a RPI2 b running linux to check for when a pulse is received from an arduino (3.3v). Something to note is that I'm also reading data from uart and writing it to a file at the same ...
0
votes
1answer
771 views

Keep terminal window on top

I have 2 scripts running once desktop loads both running a python script call them A & B script B looks for keypress so has to remain on top always. How can I boot both A & B but make ...
0
votes
2answers
2k 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
499 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
63 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
683 views

Python MCP23017 16 ch. I2C input loosing a bit

I bought a MCP23017 and doing some small test with it. I've made a simple Python script to make read_out of pin state. Can anyove explain to me, why i'm loosing a bit when GPIO_A7 is triggered? I've ...
0
votes
1answer
548 views

Running python scripts using autostart

How can I make my python scripts load and run one time once the desktop loads? I've put the python scripts into .sh files Ive edited autostart and called them using @lxterminal -e "./start.sh" @...
0
votes
1answer
1k views

IOError: [Errno -9981] Input overflowed

I'm getting an input overflow error using pyaudio with sample rate of 16000 and frame per buffer of 1024. I'm also using a USB microphone and a raspberry pi 3 (raspbian). I'm using pyaudio for ...
0
votes
2answers
262 views

Python on raspberry pi with proxy

I can config my Pi3 to connect to internet via proxy settings but I can not connect my python script to internet with socket lib Return result always fail Is there any lib can support this ? Note: I ...
0
votes
1answer
2k views

Control GPIO pin from multiple python scripts using RPi.GPIO

I have two python scripts to control an output pin in my RPi 3. The first is an interrupt service that scans a button, the second is triggered from the shell. I want to be able to run both ...
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
1answer
571 views

Latency in sound playback based on gpio trigger

I was following this guide to learn how to trigger sound with the GPIO input. What I learned is that there is some latency between the press of the button and the played sound. Is it possible to play ...
0
votes
1answer
133 views

Run a python script when start up and SSH not log in

I am new to programming and doing a simple academic project with Raspberry Pi, I have a script which will monitor the changes of database and output the change with 2 different color LED. I want it ...
0
votes
0answers
670 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
109 views

Start-up program stops working when not plugged into HDMI Rpi3

I have a raspberry pi 3 running an LED program on startup, so that when I plug it in, it can run my light program right away, without any input from a keyboard/mouse. Everything works as designed ...
0
votes
1answer
169 views

time.strftime working on windows but not on raspberry pi

I am working on a project that requires pyqtgraph library of python on raspberry pi. It functions well until I added a system time axis on my graphs. What also weird is that the script I am using ...
0
votes
1answer
127 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
233 views

Python GUI script at startup

In my current project with Rpi I am using two python scripts at the startup. One is the GUI script and the other one is the normal terminal script. It is actually a live graph update of various ...
0
votes
1answer
179 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 ...
0
votes
1answer
91 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
99 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
2k views

How to install mpi4py on for Python3 on Raspberry Pi after installing MPICH?

I have installed MPICH on my Pi. I am making a cluster. sudo apt-get install python-mpi4py installs mpi4py. However, it also install openmpi which conflicts with MPICH. So, I started from scratch ...
0
votes
1answer
382 views

How to make a switch program for GPIO-controlled multi-colour-LED's

I'm currently creating a program to make it possilble to control a multi-colour-LED with a python GUI. The GUI itself and everything else works fine, I'm just still having problems with creating a ...
0
votes
2answers
737 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
361 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 ...