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
0answers
321 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
912 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
707 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
1answer
389 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
650 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
343 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
435 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
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
2answers
7k 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
637 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
1k 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
882 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
222 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
907 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
3answers
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
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
734 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
557 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
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
653 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
0answers
767 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
118 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
135 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
255 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
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
385 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
1answer
3k 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
393 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
840 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
422 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
1answer
3k views

Run Program on boot [duplicate]

I want to run a program continuously on RPi but the problem is power off. Once it is turned off and then when I turn it ON i have to do all the process of login in and running the program again. What ...
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
648 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
47 views

How do I put these two python scripts together? [closed]

I am trying to write a script when motion is detected it will send me an email, can anyone help me put this script here enter import smtplib smtpUser = 'mygmail@gmail.com' smtpPass = 'mypassword'...
0
votes
1answer
644 views

pyame joystick button bounce

I'm building a pi robot. It uses a ps3 controller for input. When the X button is pressed, it takes a photo. For some reason, it takes around 5 shots at a time. Is there a way to bounce the input so ...
0
votes
1answer
535 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
1answer
300 views

Why can't I get input from /dev/ttyAMA0?

Here is my code: import serial ser = serial.Serial('/dev/ttyAMA0') x = 0 while x <= 30: ser.read(ser.inWaiting()) opc_data = ser.read() print opc_data x = x+1 When ...
0
votes
1answer
472 views

Adding Python functions to be called when motion is detected

The below code is meant to call the camera and email functions when motion is detected. I tried adding the functions after printing Motion Detected but didn't work. Where to add these functions? #!/...
0
votes
3answers
3k views

Launch python file and run continually at start up and reboot

I cannot seem to get any of the options out there to work. I am trying to auto start a py file when the Raspberry Pi boots up. I need it to stay open and running continuously as it detects knock ...
0
votes
0answers
940 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
390 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
1answer
294 views

Kiosk python app shutil.copyfile files empty on restart

I have a kiosk app written in python which is launched on startup (starting x server but not the window manager as I learnt about here), usbmount is installed to handle automatically mounting pen ...

1
48 49
50
51 52
54