Python is a general-purpose, high-level programming language that lets you work more quickly and integrate your systems more effectively. You can learn to use Python and see almost immediate gains in productivity and lower maintenance costs. Python interpreters, versions 3.x and 2.x, come installed ...

learn more… | top users | synonyms

0
votes
0answers
11 views

stop playing mp3 with raspberry [on hold]

I have this code : import pygame pygame.mixer.init() pygame.mixer.music.load("b.mp3") pygame.mixer.music.play() while pygame.mixer.music.get_busy() == True: continue I want to stop playing ...
0
votes
0answers
16 views

Detecting red contours

I am trying to detect the largest red contour my picamera captures. The following is the code from picamera.array import PiRGBArray from picamera import PiCamera import cv2 import numpy as np ...
0
votes
2answers
25 views

GPIO control relay with button

I'm wondering if it's possible to have my momentary button control a relay in Python whilst I'm holding the button down? Currently, I'm able to control the relay with a small python script, switching ...
0
votes
0answers
5 views

How do I make the PiGlow CPU Monitor work?

I have tried to follow the instructions as given on githubto make the PiGlow work. So far I had the Binary clock running, HOWEVER, I can't seem to get the CPU Monitor up and running by following ...
0
votes
0answers
17 views

Adafruit DC & Stepper motor HAT example code for control of movement

New to RPi and Python but learning fast. I am making a camera timelapse slider and having difficulty with the python script. Any help appreciated. I have: Adafruit DC & Stepper Motor HAT ...
0
votes
1answer
17 views

SyntaxError: can't assign to operator

I'm having trouble programming the logic of 2 PIR sensors to print a message in console whenever a user place both hands on the PIR sensors.I have managed to successfully attach the PIR sensors to the ...
0
votes
0answers
12 views

How to read photocell in Java (Pi4J)

I connected photocell to GPIO 23 (Pin 16) on my Raspberry Pi 3 Model B. It works with python code, but how I can read it in Java (PI4J)?
0
votes
0answers
14 views

OMXPlayer wrapper - run separated files in specific sequence

I'm using the omxplayer-wrapper to run video files from python script. How can I run files according to the pressed buttons? Example: I want play file "a.mp4" until Button1 was pressed. After Button1 ...
0
votes
0answers
8 views

Can't update python-six to latest version

I'm trying to install a python utility that seems to require python-six 1.9 (even though it was written in python 2.7 and that's what I'm running). But my package manager claims 1.8 is the latest ...
0
votes
2answers
37 views

Is pigpio wave generator suitable for Position PID?

Is pigpio wave generator suitable for PID applications (constantly changing its value , on PID update) It is a position PID for a stepper motor with a pulse train driver , it works , however the motor ...
0
votes
0answers
12 views

GPIO + PyQt: add_event_detect generates PyQt error

I have the following code: class MyWindowClass(QtGui.QMainWindow, form_class): def __init__(self, parent=None): GPIO.setmode(GPIO.BOARD) GPIO.setup(26,GPIO.IN) ...
-1
votes
0answers
33 views

how to send text message from raspberry pi using gsm module?

I am new to raspberry pi i am just trying to send text message from raspberry pi to some phone and i have gsm module sim900a. i want to know how to connect it to raspberry and give me python code to ...
0
votes
1answer
19 views

Auto run Python script with shell

Having an issue when running a particular script automatically. It requires root permission, uses bluetooth, and prints in a Python Shell. What I did: sudo nano etc/xdg/lxsession/LXDE-pi add ...
0
votes
1answer
35 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 ...
0
votes
0answers
10 views

Getting apache2 to run a python script using pyenv and discord.py [closed]

I'm running into problems getting my apache2 webserver to run a discord bot. I'm using discord.py and have python 3.5.1 installed with pyenv. Here is the error log apache generated: File ...
0
votes
1answer
34 views

Unix Domain Sockets: errno 111 Connection refused

RPi3, Raspian Jessie, Python 2.7. Hello all, I am struggling trying to do an IPC using Unix Domain Sockets. I had it working some months ago, but alas, I can't seem to put my hands on those images ...
0
votes
2answers
29 views

No methods for running python script on startup are working

I can not get my python file to start on startup. I've tried four different methods (below) and they all work in command line but none of them appear to run on start up. As an example, the file is ...
0
votes
1answer
26 views

TFT screen without X

I'm poised to buy a TFT touch screen for my Pi 2 or Pi 3. I have no desire to use the X Window interface (I believe this is what the stock Windowing interface is known as). Instead, I prefer the ...
0
votes
0answers
9 views

Bluetooth import for Python Raspberry Pi 3 v2 [duplicate]

I cannot get import bluetooth to work. I get this error when I run the script: Traceback (most recent call last): File "/home/pi/filename.py", line 1, in <module> import bluetooth ...
0
votes
0answers
15 views

Unable to read zigbee frame

I have connected one xbee(cordinator api) to computer and another xbee(Router api) to raspberry pi. On Rpi I've installed python xbee api and running the following python script to read data: ...
-1
votes
0answers
14 views

Rpi fitness band

Strange question, I'm looking for a fitness bracelet I can connect to my raspberry pi via Bluetooth. If possible using Python, I would like the device to be small with no screen but allow me access to ...
0
votes
3answers
56 views

Output of thermal_zone0

I am looking to get the output of thermal_zone0 (CPU temp) to display on my Sense-Hat. I now know how to print the temp thanks to @Joan but when i try the code below but i got Traceback (most recent ...
0
votes
1answer
49 views

Raspberry Pi 3 - omxplayer from python 2.7 - how to check if a video finished to play?

I want to know if it's possible to check in omxplayer that it's finished to play a video file. I use this code to start the omxplayer: os.system("omxplayer -b /home/pi/Videos/file.mp4") May be it ...
0
votes
0answers
14 views

Using RPIO library for gear motor control but doesn't work

Using Raspberry pi, I am trying to figure out how to control a gear motor with an ESC controller. I am using a 6-18 V gear motor as seen in this link: h which is being controlled by an esc controller ...
1
vote
1answer
22 views

Detect GPIO button press within time limit

I've got a photo booth program I'm working on that takes the photo of the user and displays it on the screen for 5-10 seconds. At the end of that 5-10 seconds, I'd like the booth to reset unless a ...
0
votes
1answer
29 views

Python Raspberry Pi Adding Functions

I have the below code for when motion is detected i call the camera and email functions. I tried adding the functions after printing Motion Detected but didnt work. Can someone help me where to add ...
1
vote
2answers
104 views

UART problems on my Pi3

I am trying to send and receive radio signals using my Raspberry, but I am already stuck at the first step :) My Radio module uses UART for communication but I have failed to set up my serial ...
0
votes
0answers
21 views

opencv image is black

I'm facing a problem where the image displayed by opencv and the image displayed by picamera are different. picamera displays an image as expected but opencv just displays black. any thoughts? code ...
0
votes
1answer
28 views

Answers to PWM and ESC

i connected my Rasp. to an ESC. I want to control it with this code: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(37, GPIO.OUT) servo = GPIO.PWM(37,60) servo.start(10) ...
-1
votes
1answer
23 views

There is a problem with my python source

i received a lot of help to the Raspberry Pi study for yours thank you so much!! :) but there is a problem to me. i hope as follow 1. The record run 2. If the vibration sensor is detected during ...
1
vote
2answers
38 views

Execute Python Script in Chrome

I started developing with the Raspberry Pi and it is so much fun! As a learning project I want to build a ticket system. So I bought some small LEDs and stuff to connect it and a 2D barcode scanner ...
0
votes
1answer
23 views

Can't decode barcode using Zbar

Installed Zbar with sudo apt-get install python-zbar. I'm trying to decode barcode using example povided with library: !/usr/bin/python from sys import argv import zbar # create a Processor proc = ...
0
votes
1answer
22 views

Use PHP to get callback from GPIO in

Is there a way to use PHP instead of python to detect callback from a GPIO pin? I see you can use shell_exec to execute a pin but not read output in real-time. An example is using a vibration sensor ...
1
vote
0answers
59 views

Emulate a Bluetooth Keyboard with a Raspberry Pi 3

Raspberry Pi 2 Model B (Raspbian Wheezy and bluez 4.99) Executes perfectly using a Bluetooth dongle. Raspberry Pi 3 Model B (Raspbian Jessie and bluez 4.99) Attempting to pair with Windows laptop ...
0
votes
0answers
45 views

Looking for sample python code driving stepper and servos with Adafruit boards

I am new to working with servos and steppers but experienced with linux and python. I am helping a friend with a project that involves controlling three servos and a stepper motor using both the ...
1
vote
1answer
52 views

SPI control of WS2801 LEDs, fails when using GPIO interrupts

I have three libraries (is library the right word?) that I'm using in my Python code: An Adafruit NeoPixels library, which comes from the rpi_281x library to control them via PWM, on GPIO pin 18. ...
0
votes
1answer
28 views

Problem with MQ2 Smoke Sensor

I am currently doing a Smoke Alarm System project using Python 3 and a Raspberry Pi. At the moment I am testing the MQ2 Smoke Sensor Code but when running it the smoke level always remains 0. With ...
0
votes
3answers
70 views

What is the mother-site for the Raspberry Pi?

I need a website that has many Raspberry Pi projects! In particular for electrical projects for kids, especially projects that will impress the kids. I will be mainly working with the GPIO pins.
0
votes
1answer
25 views

How to install python-mysql on Raspberry Pi?

I am trying to install python-mysqldb on Raspberry Pi 2. The sequence of commands I am using is as follows, sudo apt-get install python-dev libmysqlclient-dev build-essential python-dev Above runs ...
0
votes
1answer
10 views

Python : using data with both index and attributes [closed]

The code below was developed by many hours of trial and error as documentation does not seem to cover this. How can this be made to allow any number of data sets as data is read from a file? ...
1
vote
0answers
121 views

Using Python with Bluetooth on Raspberry Pi 3

Following this tutorial I successfully ran PiTooth on the RPi2MB (Wheezy). Following the same tutorial on the RPi3MB (Jessie) I get the following message "Could not configure bluetooth. Is bluetoothd ...
0
votes
1answer
29 views

Pi camera Runtime error: unable to shutdown and save

The code uses a toggle style button to return a value of on/off. The toggle seems to function great when returning print() but has trouble when fed camera code. preview.start_recording('video_%d', ...
3
votes
1answer
100 views

motion detection and recording video with webcam

I want to record a video with a webcam when a PIR sensor detect motion, I have the picamera library installed, can any one help, thank you? import RPi.GPIO as GPIO import time import picamera import ...
0
votes
1answer
30 views

IOError: [Errno 5] Input/output error Raspberry pi B+ model + Adafruit LCD + Keypad

I'm using Raspberry pi B+ model and Adafruit 16x2 character LCD plus keypad for raspberry pi https://learn.adafruit.com/adafruit-16x2-character-lcd-plus-keypad-for-raspberry-pi/usage I made all the ...
0
votes
0answers
38 views

Basketball sensor. avoid using time.sleep()

I am sorry for my bad English and i hope you guys understand what I'm saying. I am new to RPi and python and i would like some help to fix my code. I am creating a program that count basketball goals ...
0
votes
1answer
39 views

How would I make this python script keep running and not just stop after running once?

Im working on a game for my RPi3 B running raspbian, whenever I run this py script from the command line it runs once and stops, I would like it to stay open and keep running as it waits for a knock ...
0
votes
3answers
35 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
1answer
38 views

Problems with GPIO Edge Interrupts

I have the following circuit hooked up with a big button. Note: I am actually using a Pi Zero, not a Pi 2. I took some code from this example to run the following python script: #!/usr/bin/env ...
0
votes
1answer
29 views

SPI using SpiDev with LIS2DH sensor, need to send 2 repeated bytes in spi.xfer2 to get data valid back

class LIS2DH_Class(object): mySpi = 0 def __init__(self): self.spi = spidev.SpiDev() self.spi.open(0,0) self.spi.max_speed_hz = 10000000 #10 Mhz is max limit on LIS2DH SPI communication ...
0
votes
0answers
81 views

ble modules/libraries for python 2.7.9 on raspberry pi 3 for scanning beacons

I got the beacon result printed on linux (raspbian) terminal through command sudo python testblescan.py [source code: https://github.com/switchdoclabs/iBeacon-Scanner- ], but when I try to run the ...