Python is a 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.

learn more… | top users | synonyms

1
vote
0answers
8 views

Determining position with motion detection - Camera Module

I currently am working on an art project that requires to know the position of a person within 3 columns. I have figured that I can achieve this result by motion detection by comparing one frame ...
0
votes
0answers
4 views

Error while running a Python GUI application using tkinter from command line

While running an python code for GUI from command line (command : sudo python SampleGUI.py), I get this error Traceback (most recent calls last): from tkinter import * ImportError: No module name ...
0
votes
0answers
18 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 ...
1
vote
1answer
53 views

How to get RPi to generate a triangle wave, then outputting a PWM signal

I want my Raspberry Pi B+ Model to generate a triangle wave and output a PWM signal from one of the GPIO pins, but I'm not sure how to go about doing this. All I want it to do is add some small length ...
0
votes
1answer
10 views

pyspi and file descriptors

Has anyone else noticed that py-spidev seems to leave a file descriptor open? When I run lsof -p 5833 I see that my program has 5 file descriptors open, which seems fine. When I run sudo lsof -p 5833 ...
0
votes
2answers
32 views

sleep() affecting only one certain output

the topic name might seem a bit chaotic, but I'm struggling to describe in one line what I mean. I want to create a python script that plays different sounds when certain button is pressed. So far I ...
1
vote
0answers
29 views

How to display black screen on raspberry pi

I am currently displaying an image on boot and when I press a button I want to show a black screen. My idea is to just load up a second black image in the background with qiv and then switch to it. My ...
0
votes
1answer
43 views

Interfacing with a Winbond W25Q64BV flash chip via SPI

I'm trying to interface with a Winbond W25Q64BV flash chip via SPI. I started off by testing it on Arduino (target is a Raspberry) as I found a few implementations before I got started. Most notably ...
0
votes
0answers
31 views

Not all arguments converted during string formatting Jasper

When I'm starting Jasper, I have a problem: Error Occured! Traceback: File "/home/pi/jasper/jasper.py", line 145, in app = Jasper() File "/home/pi/jasper/jasper.py", line ...
0
votes
0answers
11 views

Piface input pins as output with pifacecommon

I know it is possible to use the input pins on the piface as output pins. (src: https://projects.drogon.net/piface-abuse-using-inputs-as-outputs/) But how is this achieved using the pifacecommon ...
0
votes
0answers
20 views

Difference pifacedigitalio and wiringpi2 piface ouput pins

I would like to use a stepper motor connected to the piface with the wiringpi2 python module. I found some code online for testing stepper motors. import pifacedigitalio as pfio pfio.init() def ...
0
votes
1answer
37 views

Sending i2c commands from arduino to pi

The RPi and arduino are connected by I2C and the arduino sends coordinates to the RPi through the wire library. However, the RPi only receives and prints out 0 when it should print out the coordinate. ...
0
votes
0answers
11 views

Audio playback with Python: xcb_connection_has_error()

I'm a newbie to RasPi and Python, so please forgive me for asking a dump question :) I want to playback a wav file with Python 2.7.3 on my RaspberryPi B+ (model name: ARMv6-compatible processor rev 7 ...
0
votes
1answer
19 views

Installing python packages in the correct version [closed]

I've built python 3.4 from source and installed it. I also installed pip. When I try to install packages with 'pip3 install', it installs to python 3.2. How can I make pip install packages for python ...
0
votes
1answer
49 views

Good way to start python script at startup with automatic restart if it crashes?

I've edited my rc.local to start my python script when the Pi boots up (like here). How can it be done to restart the script automatically if it crashes? It would be best if a re-start would be ...
0
votes
1answer
29 views

sudo for part of a python script [closed]

I have a program that automatically calls the following script. The script works up to point x but needs root privileges to perform the code from this point on. Can I give the script sudo privileges ...
0
votes
0answers
65 views

Python script debugging error winscp

I'm using WINscp to SSH my PI, and am trying to debug a python script, but keep getting a popup window: Error executing custom command '"./!"' on file 'script_file.py'. 1) What does the mean? 2) ...
1
vote
2answers
65 views

USB Modem rebooting problem

I have a python program that sends text message using a USB modem, it works fine.. But sometimes when I reboot my device the program cant find the device, so I need unplug than plug back again to ...
2
votes
1answer
101 views

How do I stop a python script from running via a webpage?

So I have a a webpage that has buttons to run a script that controls a PIR sensor and an LED. How do I stop the script from running using a second button? Button 1 : Run sensor.py Button 2 : Stop ...
0
votes
1answer
75 views

Control dc motor using GPIO.PWM problem

I'm trying to make a small remote controlled car with the raspberry pi and attached two small dc motors to it, using the L239D chip. When testing without the remote control (which is a simple android ...
1
vote
1answer
27 views

Taking a video stream with io.bytesio() and accessing frames during recording time

I've been looking into using picamera and so far ive managed to capture a sequence of images and process them, but found the time it takes between frame captures is horrible(ish), so i turned to using ...
0
votes
0answers
36 views

Stand alone PI to boot as HMI device

I am planning to use Raspberry pi with a 3.5 touch screen as a "stand alone" HMI device to switch relays and also display ultra sonic level readings via an Adruino UNO (maybe switching over to a ...
0
votes
1answer
94 views

reading pin state whether it's input or output [RPi.GPIO]

Is it possible to read pin state (1 or 0) whether it's set as output or input without setting this with RPi.GPIO.setup(pin, GPIO.IN/GPIO.OUT)? I mean i can do this via command: gpio read 2 But ...
0
votes
0answers
41 views

Camera doesn't work with GPIO PIR Sensor

I am using a 3 pin PIR Sensor to detect motion (https://www.modmypi.com/pir-motion-sensor). This is connected to the GPIO pins. I also have the RPI Camera module attached to the Camera CSI. I would ...
1
vote
1answer
68 views

How to import Xbee to Python?

I would like to handle my xbee with raspberry pi via Python. I install xbee with this command: pip install xbee And I try to use this example code: #! /usr/bin/python # Import and init an XBee ...
0
votes
0answers
21 views

AUX Input through USB

I purchased this bit of hardware that will let me plug in an AUX cable to a USB. I am thinking that this will work (without drivers?) because I had a USB microphone that worked good. Anyway, I'm ...
1
vote
1answer
70 views

Python serial permission issue

I'm trying to connect my Arduino to my RPi through python and PySerial, and I'm using the following code: import serial ser = serial.Serial('/dev/serial/ttyACM0', 9600) and I was getting an issue ...
0
votes
1answer
47 views

Best way to report all GPIO Interrupts?

So I am trying to figure out the best way of reporting all GPIO pin interrupts. My plan is to capture the high and low interrupts and post that to a URL. I haven't found many resources except for ...
0
votes
0answers
50 views

Python Syntax Error Hello World

I hope this question is not too open for SE. I wanted to make my first steps with this guide I already found out how to run Idle3 via SSH and that print is now a function. So I wrote print("Hello ...
0
votes
1answer
85 views

Running Python script From php that create a thread and then kill it [closed]

I am a python newbie, very interested in raspberry pi and while I was crusading the code I had one idea, tried a lot of ways to make it but with no success. I'm using this python script to get data ...
0
votes
0answers
27 views

Errors out with no explanation when trying to run a blinking light function in python

I have created a python script to press a button and have my light blink but it isn't working when I transported the function to my main script and it errors out with no information so I don't know ...
0
votes
1answer
67 views

site-packages dir empty but OpenCV works…what the?

I used the following to install opencv sudo apt-get install libopencv-dev python-opencv I can "import cv2" fine, read images, manipulate them to my hearts content...everything works great! ...
0
votes
1answer
41 views

How do you make the raspberry pi ask you a question?

I want to make my raspberry pi ask me a question, but not with sound, with text. I learned how to do it a while ago, but I forgot.
0
votes
0answers
31 views

Piface input values

With Piface in the Python 3 shell, this runs fine, turning the output leds on and off: >>> import pifacedigitalio >>> pifacedigital = pifacedigitalio.PiFaceDigital() >>> ...
1
vote
0answers
41 views

Error running a simple python script at boot

I am attempting to create a button on my Retro Pie emulator case (A gutted NES), using the old reset switch, to exit out the of current game and go back to the menu. Then I realized it just required ...
0
votes
1answer
35 views

Defining PWM ports to be used on the GPIO

Now as i have noted in previous questions i understand the PWM area of the raspberry pi is the most saturated area, but my question lies in which ports can actually be allocated as a PWM output due to ...
0
votes
1answer
100 views

SIM900 to Raspberry

I've recently bought SIM900 with this module. Connected it to Raspberry Pi - GND, 5V, RX-TX, TX-RX. I'm using following code to test it (found on web): #! /usr/bin/env python import argparse from ...
4
votes
1answer
94 views

PWM Control on Raspberry PI

Alright so I understand this question is fairly saturated, but my use in pwm is for two differing pieces of hardware. (Sourced from: https://www.modmypi.com/blog/raspberry-pi-gpio-en-franais) From ...
0
votes
1answer
41 views

Raspberry Pi to shuffle music [closed]

I am inquiring whats the best way to go about using python to shuffle music on the raspberry pi what I would like to do is do this via user input to determine what song to play. Any help would be ...
3
votes
2answers
97 views

Python: Is there any way to get a list of IPs connected to a network

Is there any way to get a list of IPs connected to a network? I'm trying to build lots of networking tools so.
0
votes
1answer
47 views

So is there any C++ alternative for PiUi?

So actually i have a little project that require the Pi to communicate to a Smartphone (in this case android device) to transact data (sending and receiving command,etc) via any available connection ...
0
votes
2answers
95 views

How can I exit a while loop at any time during the loop?

I have a python program that loops through some GPIO commands. How can I break the loop at any time during the loop by pressing the Enter key. So far I have this... import sys import select import os ...
1
vote
1answer
49 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 ...
2
votes
2answers
71 views

From raspi to laptop python3 vb.net/c# [closed]

Hello im enquiring about using data from a raspb-pi via python to then access it in c# in visual studio for an impending app I will make, what is the best way to go about this. To extend atm I am ...
0
votes
1answer
43 views

Remote control application [closed]

I connected raspberry with my pc over wireless network. I can use ssh communication, and server installed on my raspberry with my pc's web browser. I need another solution to control my rpi (not ...
1
vote
2answers
115 views

can someone explain lambda functions? [closed]

I am reading the Python documentation, and learning python. I am on chapter 4.7.5. Lambda Expressions. I am having a tough time understanding how lambda functions are any different than any other ...
0
votes
0answers
96 views

crontab not starting command on reboot

I need a command to run at reboot. This command is called script.sh #!/bin/bash ibeacon scan | /home/pi/test.py This command pipes input to a python program I wrote called test.py. ...
0
votes
1answer
72 views

20x4 LCD with Python - Threading because of different update intervals

I've built a complete home automation system including a LCD display (2004), an internet radio and with 433 Mhz controlling. Unfortunatly I have a small problem with the lcd display. Everything ...
0
votes
1answer
63 views

Python script to conttrol GPIO

I have a very small python script to control GPIOs: pi@raspberrypi ~ $ sudo python gpio-test.py #!/usr/bin/env python try: from time import sleep import os import RPi.GPIO as GPIO ...
0
votes
1answer
215 views

pymodbus rtu rs-485 communication

I have this little device for communication and I can see the dongle after lsusb and it is attached to ttyUSB0 (output from dmesg). Since the module has its driver that is installed to Rpi I don't ...