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.

625 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
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
150 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
282 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
179 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
164 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
279 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
65 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
384 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
513 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
863 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
76 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
0answers
276 views

LED button doesn't work

I have tried connecting a LED with a button like this (from "Adventures in RPi"), but with the far end of the button plugged at G (instead of F). And I ran it with the following Python program (by ...
1
vote
1answer
798 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
742 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
242 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
173 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
497 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
223 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
727 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
444 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
591 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
153 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
109 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
92 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
439 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
463 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
713 views

Controlling brushless motor with ESC and Raspbery 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 ...
1
vote
0answers
509 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
420 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
996 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
239 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
384 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
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
528 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 ...
1
vote
1answer
403 views

Error when installing Flexget

Having some problems trying to install flexget. I get the following error when I run the command: pi@rpi:~$ sudo pip install flexget Requirement already satisfied (use --upgrade to upgrade): ...
1
vote
0answers
310 views

Webcam doesn't work on Raspberry Pi VIDIOC-QUERYMENU: Invalid Argument

So I wrote an image processing program in Python on my windows computer and it works fine there, but when I try to run it on the Raspberry Pi I get VIDIOC-QUERYMENU: Invalid Argument a bunch of times. ...
1
vote
0answers
1k views

Python attribute error with Raspberry Pi Camera

I have been coding a python 3 program which allows a user to easily take pictures with the raspberry pi camera. The program works up to the Camera_Capture method which takes the picture. When it is ...
1
vote
0answers
684 views

Midori change URL without new tab

I am trying to change the url of the midori browser after predefined intervals. import os import subprocess import time cmdline = ["midori", "-e", "Fullscreen", "-a","http://www.foo.bar"] p = ...
1
vote
0answers
1k views

Raspberry Pi stream video over RF

I would like to stream video from a Raspberry Pi over RF to another Raspberry Pi. Here are a few requirements: Range of at least 1KM (pretty much line of sight) I would also like to send some data ...
1
vote
0answers
592 views

pymodbus to read temp from device

I am trying to us pymodbus to read data from a temperature and pressure device, but it seems the output from my readings is always None. Here is my code import pymodbus import serial from pymodbus....
1
vote
0answers
462 views

Python serial script prevents android connection

The python script below connects via "rfcomm0" to the "Bluefruit EZ-link module" on the "Arduino Uno" but prevents the bluetooth connection from my android app. If I change the script to use "/dev/...
1
vote
0answers
427 views

controlling 12 V RGB LED strip with raspberry pi

We are trying to control a RGB led strip with a 12 V power supply. The servoblaster does not work. Can you please suggest some other software we can use?