We’re rewarding the question askers & reputations are being recalculated! Read more.

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.

653 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
996 views

Python controlling OMXPlayer, DVI and HDMI causes issues in sub process

I hope anyone can help. I have built a Python script that uses a triggering action to start playing a video of a door opening. When triggered, it should start playing the video of a door opening, and ...
1
vote
0answers
298 views

Optical mouse camera conect to RPi3 via serial port

I try to read the optical mouse sensor IC in the RPi3 via the serial port. The idea is base on this tutorial but in my case I have the ADNS-5020 sensor. I set enable_uart=1 in /boot/config.txt and I ...
1
vote
0answers
26 views

recording 2 videos of 2 different pictures

I'm using raspberry pi with python and I'm trying to record a video of : regular video stream a picture from that stream that showes a circle identification (using hough transform ) cv2.circle =...
1
vote
0answers
382 views

Digital Camera - view webcam (not pi camera) and capture image on button click inside a browser - preferrabily php

I am a newbie to Raspberry pi Digital Camera - view webcam (not pi camera) and capture image on button click inside a browser - in php I am trying to write a browser based image capture software ...
1
vote
0answers
97 views

Why was my last AT command routine is not viewed in the output?

As I was using pigpio ,so that I can use the GPIO pins as UART or bit banging the serial. I am using a SIM900 gsm module. Here is the code: import pigpio import time import sys TX=23 RX=18 baudrate=...
1
vote
0answers
579 views

With RPi 3 cannot write to I2C

I have an Adafruit RPI3 running Raspbian version = "8 jessie". I connected a CO2 sensor via I2c and the sensor properly responds to i2cdetect -y 1 with 0x68 and 0x69. I believe these are read and ...
1
vote
1answer
352 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 ...
1
vote
0answers
620 views

Optimization of picamera frame decoding for opencv processing

I am useing next code for frame capture: from picamera import PiCamera import utils res = (1600,1600) camera = PiCamera(resolution = res) camera.resolution = res camera.raw_format = 'rgb' camera....
1
vote
0answers
656 views

executing terminal command from python takes very long time

I'm running the following python code: import os day='09' month='08' year='2016' hours='14' minutes='30' seconds='00' dt="sudo date -s '" + day + " " + month + " " + year + " " + hours + ":" + ...
1
vote
0answers
1k views

How to rotate motion's output

I've made a pan/tilt device with a raspberry pi 3 and I'm looking for a way to flip the stream when the camera tilts past 90 degrees. I'm using mjpg-streamer with motion, but wondering if streaming ...
1
vote
1answer
5k views

Red LED on the Camera is not turning off?

The red LED on my Pi Camera is not turning off. Does this mean the camera is still on even after the camera.stop_preview() command is executed? def setup_camera(): camera = picamera.PiCamera() ...
1
vote
0answers
161 views

Help with except ValueError:

So here it goes. I've been trying for the last few days to figure out how to properly use exceptions, specifically the ValueError. I've researched it over and over again, but am still struggling to ...
1
vote
0answers
300 views

Using three SPI channels with wiring pi?

I was wondering if there is a way to use three different channels for SPI through the wiring pi library. I mean I know that a chip/slave/channel select pin can be any pin capable of sending a high or ...
1
vote
0answers
184 views

Optimizing the code that controls 4-DC Motors using Python Dictionary Comprehension

I have connected 4 DC motors (each two with L298 H-Bridge IC), now it's time to get them worked using a Python script running on Raspberry Pi B+. I'll include my code, and I'm totally new that means ...
1
vote
0answers
165 views

Connecting angular encoder to an INTERRUPT to count cycles

I'm building a Robotic Car, the 4 DC Motors are working perfectly. I need to know the speed of its moving using an Encoder. Encoder that I use: has two edges (transmitter & receiver) and a ...
1
vote
0answers
1k views

Push button + LED + sound

sorry i'm new to this and it might sound dumb, but I have to achieve the following task: You have three push buttons. Each button is connected to a pin. When the switch is pressed, an LED which is ...
1
vote
0answers
1k views

pip can not install pillow into virtualenv

I tried to install pillow inside a virtualenv under the interpreter: $VIRTUAL_ENV/bin/python3.4 I used the command: pip install pillow and got the following error: Traceback (most recent call ...
1
vote
3answers
303 views

How to display gpsd.utc using paint or similar method

I am receiving reliable gps data from my Adafruit gps sensor. I would like to to show the gpsd.utc data across the screen so that it appears like a regular clock. I have the following code which shows ...
1
vote
0answers
3k views

RFID RC522 Stops reading data after reading data continuously

I'm trying to make RFID RC522 work with my Raspberry Pi 3 B+. I use the library MFRC522, and the the sensor can read data most of the times. However if I just put the card on the sensor it will stop ...
1
vote
0answers
54 views

How to implement an echo-service over bluetooth smart

I'm trying to find examples of how to implement a service over bluetooth smart (ble). I would prefer a python implementation. The step i'm most interested in is the bindning between ble and the ...
1
vote
0answers
70 views

Python Image Slicer install failing on Ubuntu Mate

I've got a raspberry pi 2 running ubuntu mate. It comes pre loaded with python. I attempted to install image_slicer module using pip install image_slicer however I recieve this error dialogue: ...
1
vote
0answers
404 views

Compression at Beginning of h264 Clip

I'm using a pi zero and the v2.1 camera to record a series of video clips over a certain duration with pauses in between. The issue is that at the beginning of each clip there's a noticeable increase ...
1
vote
1answer
523 views

sudo pip install packagename not working

sudo pip install packagename not working... I am not able to install python package using pip.
1
vote
0answers
917 views

Python vlc bindings & raspberry pi HW acceleration

I managed to install vlc on raspberry pi 2 with hardware acceleration as described here: https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=59814&sid=65d833a90f1ee134cb57523599e1c8aa and ...
1
vote
0answers
78 views

GPIO unexpected behaviour after 10 hours of running python script

I have a python script running as a service on Raspbian Jessie that watches for a button being pressed and lights an LED when it is done. Initially everything works as designed, however I have found ...
1
vote
1answer
838 views

py-spidev and ADNS3080

I have been trying a lot to deal with the flow-motion sensor but I couldn't arrive to a clear result. It might be I can't understand the procedure.. I'm using cs1 on raspberry Defining the spi by ...
1
vote
1answer
2k views

Issues with Kivy on Raspberry Pi 3 with 3.5 in Touchscreen

I followed every guide I could find on installing Kivy to Raspberry Pi. My touchscreen works totally fine. Trying to launch various Kivy demos will result in what seems to be a partial launch, but ...
1
vote
0answers
747 views

Rpi2 image on a Rpi3: Module spi-bcm2708 not found

I was using a RPi2 with an RFID-RC522 Board. Now I bougth an new RPi3 because of the included WLAN. I am trying to use the same image I use with my RPi2 in my RPi3 now. But I encounter a very ...
1
vote
0answers
245 views

Using Raspberry Pi 2 B with Pan Tilt and OpenCV 3.0.0 for the 1st Time

I am very new to Raspberry Pi, and This is my first time using it. I have read a lot from the documentation on the official website, and I really got great things. After that I installed OpenCV 3 with ...
1
vote
0answers
175 views

Jasper on RaspberryPi2 not starting

I tried using the jasper on RPI2 and followed the github for my installation and configuration. I am getting a following error which i could not solve. please help me out. < ***********************...
1
vote
0answers
513 views

starting and ending a script with a buttonpress

I'm trying to integrate a button into a simple alarm project of mine but am having trouble activating/deactivating the alarm with a button press. Using Raspberry Pi 2 - Raspbian Jessie My wiring is ...
1
vote
0answers
3k views

Setting up raspberry pi for bluetooth low energy (bluez, bluepy)

I am trying to set up a brand-new Raspberry Pi for bluetooth communication using bluez and bluepy tools. This Raspberry Pi is brand-new and running NOOBS. My terminal history is the following (these ...
1
vote
0answers
231 views

Blinking LED - start and stop

This is my first post here so HELLO and sorry if I'm posting in the wrong place. Do you know a simple bit of Python that will set a LED blinking indefinitely until it's told to stop? Control will be ...
1
vote
0answers
738 views

Open a URL in Epiphany Web Browser from Python Script

So I am trying to open a URL in Epiphany [ let's say for example http://www.google.com ] from a python script. My python script is as follows: import os string = "DISPLAY=:0 xdg-open http://www....
1
vote
0answers
476 views

Unmount USB Camera

I'm working in a Python app with opencv and a USB camera. Sometimes the camera driver throws an exception: OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cvtColor, file /home/pi/opencv-2....
1
vote
0answers
624 views

Can't connect to raspberry pi 2 over bluetooth with MIT App Inventor

I have a raspberry pi 2 with a bluetooth USB Dongle, and i've been trying for hours to connect it with an app I created on app inventor. The app is simple, just sending a string, and i've tried to ...
1
vote
0answers
159 views

I have followed the Adafruit Tutorial for using the LED matrix Backpack But Get “No module named Image” error

I have followed the instructions here: https://learn.adafruit.com/led-backpack-displays-on-raspberry-pi-and-beaglebone-black/usage They have not worked and when I try to run the test python script I ...
1
vote
0answers
117 views

How to programmatically determine the name of a connected HDD?

I'm hoping this is a very simple issue with a simple solution. I have a raspberry pi and an external hard drive that I am writing data to. I would like to know if there is a way in python, to ...
1
vote
0answers
98 views

Installing python-blosc on arch

It appears that python-blosc is supposed to work on the pi, but on my rpi2 running arch, after cloning the git repo and running python setup.py install, I'm getting the output below. Anyone else have ...
1
vote
0answers
455 views

ERROR - A transport exception occured

I'm trying to get my Pi to automatically test the internet speed using the speedtest-cli When I run the command through the terminal itself, it works just fine however, I want to run it off my phone ...
1
vote
0answers
465 views

Connect Adafruit Ultimate GPS Logger Shield and Raspberry Pi 2 B

I'm trying to connect Adafruit Ultimate GPS Logger Shield with Raspberry Pi 2 B, and it still not working. I tried to connect: Gnd, Rx, Tx, 5v. And it have signal at FIX leds. I also setup some ...
1
vote
0answers
2k views

How to start a Python app from the Windows 10 IoT remote Powershell terminal?

I have deployed and successfully run a Python app from VS2015 on my Raspberry Pi Win 10 IoT, however, I cannot figure out how to start the Python app when remoted in to the computer via Powershell. I ...
1
vote
0answers
542 views

Y value of image obtained using Picamera Python documentation fluctuates wildly

I have been working with picamera python analysis class a bit lately. What I am using is here to get a YUV array, and then perform some simple analysis on it. When I try to isolate the Y page of the ...
1
vote
0answers
428 views

Control the inclinometer with RS232 or UART

I have bought an inclinometer today to try some things. Inclinometer has two communication port; RS232 and UART. Which one should I select? Actually I tried both but none of them worked. I have ...
1
vote
0answers
1k views

Connecting multiple devices with UART

So, I have the following components: Gertbot SparqEE Shield My aim is to connect these to a Raspberry Pi Model B+, so that they can work together. There are no issues when I connect these ...
1
vote
0answers
247 views

Launching a python script in IDLE3 works but in terminal I get an error on a ConfigParser

I've created a Python program for my raspberry PI with Raspbian. When I run it using IDLE3 (my program has been created with Python 3.2), it works fine. As I'd like to run this python script at ...
1
vote
1answer
416 views

Access the display from a python app running as a service

Problem: The code below can't access the display when running as a service. I have my raspi hooked up to a touch screen monitor in the kitchen and I've attached a Passive Infrared sensor to the GPIO ...
1
vote
0answers
98 views

2 scripts need every frame from NOIR camera board at same time

I have two opencv2/Python scripts running at the same time on the same Raspberry PI. A streaming server script based on this, that outputs a live camera feed to the web a motion detection script, ...
1
vote
0answers
1k 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' ...
1
vote
0answers
534 views

IRW does not show any thing

I want to use an infrared remote control. I'm using an infrared diode tsop38238. first I disabled the device tree because mode2 did not work at the beginning. After disabling I recorded my remote ...