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
8
votes
14answers
46k views

PiCamera not Working

For starting the camera I am doing >>> import picamera >>> camera = picamera.PiCamera() mmal: mmal_vc_component_enable: failed to enable compononent : ENOSPC Traceback (most ...
8
votes
3answers
665 views

How does init get to know about power events?

I have a Pi Model B Rev 2.0 (I think) and I intend to use it for a Home Automation system. As I have a prepayment meter on my electricity supply I occasionally run out of electrons to go around my ...
6
votes
3answers
10k views

YOLO or SSD on raspberry pi

I've run yolov2 on my Raspberry Pi 3 but I got 1 frame each 13s (which is pretty bad for live object detection). I've also tried an SSD but the results were terrible too. Is there anything I could do ...
6
votes
2answers
2k views

Impossible to scan RFID tags using libnfc, PN532, and RPi3

I recently bought this NFC/RFID reader PN532 module V3 I want to use it with my raspberry pi 3. I have install and configured the library libnfc. The PN532 is connected with I2C. I have well enabled ...
5
votes
1answer
9k views

Activate virtualenv & start script on boot - RPi

I am trying to start a python script that exists in a virtualenv from bootup on my RPi. From reading this post and the RPi rc.local post I know that I will have to add something like this to /etc/rc....
5
votes
3answers
9k views

How to Run pigpiod on boot

In order to use pigpio Module in Python (remote GPIO for Raspberry Pi ), pigpiod has to be loaded to memory on each RPi. what is the right way to to it ? during Ubuntu's boot or a part of Python's ...
4
votes
2answers
3k views

Raspberry Pi camera doesn't work only displays red light

When I run my code, I get this error: No data received from sensor. Check all connections, including the Sunny one on the camera board The red light on the camera module glows, but doesn't ...
4
votes
1answer
9k views

Custom White Balancing with picamera

I need a method to set the White Balance of the raspberry pi camera by "teaching it". Such as it is in DSLR cameras, I'd like to show a white picture to the camera and say "OK, this is white, now ...
4
votes
1answer
4k views

Zbar Installation

I'm attempting to install zbar on my raspberry pi. I built the source by entering: ./configure make make install I don't get any errors or warnings from any of the above commands. After the install ...
4
votes
4answers
13k views

How do I download the Python libraries without a direct internet connection on my Pi?

I live in the sticks and don't have a direct internet connection on my Pi. I need to download the Python libraries and move them locally offline. How can I download them from somewhere I do have an ...
3
votes
1answer
1k views

Launch Python script from Cron in foreground

I have developed a Python script that I would like to run at every boot of the Pi. The script in question is one that I do not want to run in the background. It will be controlling the display of ...
3
votes
3answers
7k views

Multiple Callbacks from GPIO interrupt

I created a quick program that uses the GPIO library to create an interrupt with a callback that is initiated when a (pink) button is pressed. It works, but when the button is pressed and then ...
3
votes
1answer
1k views

How to cross-compile OpenCV and copy python bindings?

I want to install dlib and OpenCV on Raspberry Pi 2. As you know, if I try to compile those on the Pi directly, then a) It takes a lot of time (3-4 hours for dlib and then 2 for OpenCV) and b) It is ...
3
votes
1answer
595 views

Is there a way to read the pullup status of a GPIO pin in python with, or if not, without pigpio?

I've discovered pigpio and am starting to learn to use it with Python. I thought I would use it to "discover" the pullup status of a pin before setting it, but while mode has both .set_mode() and ....
3
votes
4answers
407 views

Raspberry Pi run commands on boot

I thought that running commands on raspberry pi on boot was the easiest thing in my project. But it seems that it is complex enough not to work. I've searched a lot on the internet on a simple ...
3
votes
1answer
4k views

Reading serial data from Arduino

I have am working on a project where I'm trying to get a Raspberry Pi to play some sounds when triggered by button presses on an Arduino. The command is sent to Raspberry Pi through serial. I used ...
3
votes
2answers
6k views

PIL.Image from picamera.capture()

I want to get an image from the pi camera module and use the pillow imaging library to modify the image. The way I have been doing it up to now is to take a picture with the camera and then open that ...
2
votes
2answers
10k views

Python script does not continue after os.system command

First post and also first time experimenting with a PI & Python. I have a pi-3 model B with the 7" touchscreen and PIR sensor. My goal is to have it set up so that it constantly displays the ...
2
votes
2answers
9k views

Get USB address

I have a FTDI USB-Serial (UART) IC connected to my Raspberry Pi. When I type lsusb I can see all my USB buses: Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID ...
2
votes
2answers
2k views

Python script does not run when called by service

I have written a python program that continuously parses my current IP and emails it to me if it changes that I want to begin running as soon as the computer boots up: /home/pi/sendIP.py#note that ...
2
votes
1answer
6k views

How to initialize an ESC with Python code [duplicate]

I can't make my brushless motor move; it kepps on beeping. I have connected it to an electronic speed control (ESC) and am trying to signal the ESC from the GPIO pins of Raspberry pi B+. How do I ...
2
votes
1answer
1k views

KeyboardInterrupt Handling with picamera

So I have a python program in which I'm using the picamera library to shoot pictures and record video. I'm using my program for scientific purposes and my goal is keep each picture as close to the ...
2
votes
1answer
205 views

outb() equivalent in Python for GPIO

I am a very beginner on programming and raspberry usage, tho I think I learn fast. I am trying to convert an old program (not mine) that was written for Linux on C++ for communication with a printer ...
2
votes
1answer
341 views

Is there a way to enable VNC on my Pi with python?

I am creating a system and I want to make it as quick and painless to deploy as possible. I also need people who are unfamiliar with RPi to deploy it. So I am creating an installer that can handle ...
2
votes
3answers
14k views

How can I use a LCD display with a I2C adapter?

I'd like to try to communicate to a 16x2 LCD display, however whole docs I found assume I should connect the whole pin-out however I got some kind of I2C adapter from mjkdz.com which makes a 4 pin ...
2
votes
1answer
3k views

ADS1256 Python Libraries

So the other day I got myself a Waveshare High Precision AD/DA Expansion Board for my Pi-3. The ADC on the board is an ADS1256, and I am having trouble finding code libraries to use with it. ...
1
vote
3answers
983 views

how to make radio wave with pi2

As pi2 have processing power of 900MHz it can generate upto 250Mhz radio frequency. I have run fm_transmitter on pi2 it was working but only with one song(star_wars.wav) and code was in c++. Does ...
1
vote
1answer
5k views

Start/stop Fan at certain time

I have connected a fan to my raspberry pi with a transistor that sits on pin 5 ( GPIO 5 ).' I followed an online "guide" to make it. I would like to make a script that makes it run during the day, ...
1
vote
2answers
4k views

spidev.xfer2 in python gives IOError: [Errno 22] Invalid argument

I am currently trying to follow this tutorial. I keep running into errors for the RPi part. I have received several error related to SPI. I removed SPI from my blacklist and followed the instructions ...
1
vote
1answer
1k views

smbus/I2C sensor returns fixed data

I am attempting to use a sensor in conjunction with a raspberry pi smbus. When I try and read a specific byte of data, it returns 181. No matter what byte you tell it to read it returns 181, ...
1
vote
2answers
6k views

Capturing serial number of 2 USB RFID Reader in python (PI+2 RFID (Mifire RFID))

I've tried several programs to capture the serial number of 2 USB RFID Reader. I use 2 Mifire RFID (named RFID A & RFID B) and they connected to my Raspberry Pi. I want the Raspberry Pi ...
1
vote
1answer
4k views

How to set a permission to call a Python script from PHP?

I connected an Arduino Nano via USB to my Raspberry PI3. The Arduino is programmed to send (via serial) 16 bytes of information every 500 milliseconds. In this RPi3 I have Python, Apache2 and PHP5 ...
1
vote
1answer
3k views

How do I write my temperature data to Windows Azure's Sqldatabase?

I'm new to Raspberry PI and need help on this part as I need to write my temperature data to Windows Azure's Sqldatabase. import smbus import time import datetime #SMBus(0) - Raspberry Pi Model A #...
1
vote
2answers
2k views

How to run python script on pi without logging in everytime

I want my pi to run a python script on it everytime I plug it into any power source. My pi collects data from MSP430x and upload it on a cloud server. I want to keep it running all the time and I can'...
1
vote
1answer
3k views

turn screen on and off with motion sensor

I'm working on a project which will use a PIR motion sensor to turn on a connected HDMI monitor when there's someone in the room, and turn it off when they leave. I'm new to Linux, but not to Python. ...
1
vote
3answers
3k views

Can I copy paste the SD card and use all developed programs?

I have used the NOOBs image and installed Raspbian distribution. I have another Pi with several scripts and programs I want to recreate to the new Pi. Can I do a simple copy of all documents from ...
0
votes
1answer
273 views

trying to run 6 USB cameras simultaneously on a single Raspberry Pi 3B+ with add-on 4 port USB hub with external power

We are trying to simultaneously run 6 cameras on a Raspberry Pi 3B+ with an add-on 4 port USB hub that has an external power supply. The cameras are set at 15 FPS with a colour image size of 640 X 480....
0
votes
2answers
3k views

How should I properly communicate 2 Raspberry Pi via UART?

I'm testing serial communication with Python pyserial module. I try to communicate some strings between two Raspberry Pi's ... I tested transmitter and receiver code at same device connecting it's ...
0
votes
1answer
5k views

QtPy5 on Raspbian, getting ImportError: cannot import name QtCore

I need to be able to use the latest WebKit that includes WebRTC support How do I install Qt5+QtPy5 on Raspbian? What I have tried so far... Installed Qt5 on RPi2 - PASS Native build Qt5 on RPi2 ...
0
votes
2answers
733 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
5k views

Installing Kivy on Raspberry Pi 3 and making it work with Python 3.4

(This may be a duplicate of an unanswered question at How do I Install Kivy for python 3.4 on my raspberry? Is that possible? , but I'd like to add some details to this.) I have followed the default ...
0
votes
3answers
1k views

Why can't I connect to my Raspberry Pi through SSH on my PC or a phone app?

I tried to SSH into my Pi using PuTTY, but I got an error: Network Error: Connection timed out I have checked my router, noted that the device is indeed connected to the network, I was able to use ...
0
votes
1answer
1k views

Using a switch, not push button, to play mp3s

I'm trying to setup a switch on a breakout board which, upon flicking the switch, will allow me to play a short mp3, then loop a second mp3 until I switch it off. When I do so, I want it to play a ...
0
votes
2answers
2k views

Fastest Hardware Interrupt software?

I'm wiring my Raspberry pi to a USdigital encoder , especifically this model "H6BM-1000-500-IE-S-H" , it has 1000 signals per revolution , I've followed the tutorial on http://raspi.tv/2013/how-to-...
0
votes
1answer
253 views

GPIO outputs not changing on specific GPIO ports

I'm using a Rpi B rev2 and I'm having problems changing the output of ports 2,3,4,5,6 (BCM). All the other ports work perfectly. I searched for documentation and I see the only thing that sets these ...
8
votes
1answer
51k views

Using python with bluetooth to communicate

I'm trying to write a simple program to communicate between the RPi and a bluetooth cellphone. I went with this tutorial: Bluetooth Python tutorial for RPi and was able to connect to the phone and ...
5
votes
2answers
15k views

Controlling a fan on a relay with python

I have a Raspberry pi Model B revision 2 and I've set up a mini 5v fan on a relay switch which i want to control with python now. I will be running a crontab every hour to check the temperature of the ...
5
votes
2answers
8k views

Upgrade from Python 2.7 to 3.3,x

How do I uninstall Python 2.7 and install the latest Python 3.3.x? Tried using "upgrade" but it didn't solve my problem.
5
votes
3answers
4k views

Display IP Address on Character Based LCD

I need to know the IP address of my raspberry pi. I need to do this with a Character LCD display. So here's what I have done so far. I can display text on a HD44780 based 16x2 LCD connected to my ...
5
votes
1answer
1k views

Does the Raspberry Pi support I2C multi-master configurations?

We are using Raspberry Pi 2 single board computers for test automation (they run our feature test against an actual DUT). Our Device Under Test (DUT) uses I2C multi-master mode to communicate with its ...