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
0
votes
1answer
683 views

ultrasonic sensor stops after giving some reading when running in thread on tornado websocket python

I am using Ultrasonic sensor to get reading and am using python program for getting reading. And am using Raspberry pi for this. when am running python program independently its giving me reading ...
0
votes
0answers
2k views

Getting error while running Raspberry Pi Camera

I am using a Raspberry Pi along with the camera module to build a spy camera standalone device, (just for learning). I ran this code on my Raspberry Pi which gave the following error: initialising, ...
0
votes
0answers
1k views

Python Raspberry flow sensor

I just started programming in Python and I have a little problem. I want to create a simple application based on YF-S201 (flow sensor) and DS18B20 (1wire thermometer). My problem is in the "loop". ...
0
votes
0answers
2k views

Serial communication on Raspberry Pi - can send data, but cannot read data

I'm using Raspberry Pi 2 to realize RS232 communication between raspberry and my laptop. It seems that my Raspberry Pi can send data, but it can get nothing from my laptop. The following information ...
0
votes
0answers
1k views

Best way to access GPIO through a nodejs script - without root

I'm building a web dashboard for a temperature sensor. The page is served by node.js, and the sensor connected to GPIO is accessed by a Python script, which is run by node.js. Relevant code: var ...
0
votes
0answers
444 views

GPIO.setup not working

I've installed Ubuntu on my Raspberry Pi 2. I'm trying to run a script (mostly copied) #!/usr/bin/env python import RPi.GPIO as GPIO print("Test 1") GPIO.setmode(GPIO.BOARD) GPIO.setwarnings(True) ...
0
votes
0answers
741 views

Controlling brushless motor with ESC and Raspberry 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 ...
0
votes
4answers
1k views

boot up rasbian into gui program, no interaction

I have a project I want to do, and I got an SPI touch screen (tontec 3.5") for it. I want to start up into some sort of GUI application. I only have roughly 950mb left on my micro SD (8gb, install ...
0
votes
0answers
198 views

Python Subprocess Error

I am trying to call this command: avconv -i '/opt/music/Smooth Criminal.mp3' -ac 1 -ar 22050 -b 352k -f wav - | /opt/pifm/bin/pifm - 98.3 with my own paths. In the terminal it works like a charm but ...
0
votes
1answer
3k views

pure python mjpeg streaming?

I tried the mjpegStreamServer from here but it doesn't seems to work... First of all, most times, after run it throws errors: — Exception in thread Thread-1: Traceback (most recent call last): File ...
0
votes
0answers
71 views

Using python on raspberry for leds sometimes not working

I am using python to turn leds on and off in a little project (raspbian) but I don't know why sometimes the leds turn on and sometimes they don't. You can find the code below, could you please tell ...
0
votes
0answers
83 views

Singular access to the NOIR board from a server and a motion script

I am using the raspberry pi NOIR board to supply a Python motion detection script. This "motion detection script" uses opencv2 to grab, modify and detect motion. I wanted to extend the motion ...
0
votes
0answers
613 views

WiringPi and CGI in Python

I want to be able to toggle a GPIO pin from from a web browser. I've found this forum topic (http://tiny.cc/d1eixx) and even the though code seems fine, it doesn't toggle the pin: #!/usr/bin/python ...
0
votes
0answers
960 views

Sending text on android phone commanded by Raspberry pi USB, WITHOUT internet

I simply want the Raspberry Pi to instruct a mobile Android phone to send a text SMS. The preferred connection to the Pi is via USB. I do not have an internet connection in this configuration. I have ...
0
votes
0answers
3k views

UHF RFID Reader with Raspberry Pi

I have a RFID Reader like the one posted on this link: http://www.ebay.com/itm/EPC-Gen2-UHF-Integrative-5-7-Meters-Long-Range-RFID-Reader-with-free-SDK-/171473207602 It has RS232, RS485 and Weigand ...
0
votes
0answers
666 views

Raspberry Pi Frequency Calculator

I'm trying to make a simple program that calculates the frequency at a pin on the board. I'm using Python for the programming. I wrote two different programs and they gave the same (wrong!) results. I ...
0
votes
0answers
2k views

Does this show PyAudio is unusable with RaspberryPi's built-in audio?

When using PyAudio with the RaspberryPi's built-in audio snd_bcm2835, we get this strange behaviour: python test.py # ... after 10 or 15 seconds the sound is stuttering! This problem doesn'...
0
votes
0answers
466 views

ImportError: No module named HT16K33

When I am importing a library (specifically Adafruit_LED_Backpack using Python3) I get the error ImportError: No module named HT16K33 How do I install that library? EDIT: when using Python 2.7, the ...
0
votes
0answers
494 views

Web based IR/RF device control over long range

I am trying to implement a Building Automation System where I would like to implement web-based or mobile based control of all ir/rf based devices like tv,a/c,sound system, etc. The PI will be placed ...
0
votes
0answers
744 views

Simple Buttons with GPIO, not working

I' following this tutorial to have two buttons working with my Pi. The code I have is the same: import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(23, GPIO.IN, pull_up_down = GPIO.PUD_DOWN) ...
0
votes
0answers
557 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
0answers
512 views

Pi and Python - Cannot connect to SSL from Pi - works on Win7

I am using Tikona Broadband ISP in Bangalore,India. The ISP need the user to login using a web proxy. This is how my Pi is connected: The ethernet from ISP lands on the router and the Pi is ...
0
votes
0answers
187 views

Opencv configuration issue

I have recently installed opencv 2.4.8 on my raspberry pi.When i check the version with pkg-config --modversion opencv 2.4.8 But in my python code when i import cv2 i am getting the error as no ...
0
votes
0answers
369 views

Raspbian crashing after servo.stop_servo()

I have a servo connected to my RPi and I try PWM.Servo's capabilities. The program below does what it should - but after execution it crashes system (it doesn't respond to any input, no animations, ...
0
votes
0answers
689 views

pygame.mixer on thread fails with “(pygame parachute) Segmentation Fault”

On the Raspberry Pi, I'm trying to play some sounds using pygame.mixer and am having a problem when playing them on any thread other than the main thread. For example, I have a keypad hooked up and ...
0
votes
1answer
537 views

ShiftBrite - running on Python

I was wondering if anyone can help me out with converting the example Shiftbrite Arduino code into Python so I can run it on my RPi. Here is the example code in question: int datapin = 10; // DI int ...
0
votes
2answers
62 views

I2C MPU9250 Gyro/Accelero/Magneto 9-DOF Sensor MicroPython Programming Problem

so I've recently set up my raspberry pi. Am following a tutorial for the MPU9250, from https://github.com/tuupola/micropython-mpu9250. I have did a install of the micropython-mpu9250, and tried the ...
0
votes
1answer
115 views

How to make a simple GUI?

I recently had follow this tutorial which basically is about making your raspberry pi send email notification every three seconds on the location of your device. The thing that is missing now is, I ...
0
votes
1answer
250 views

USB RS232 turn on/off beamer

I'm streaming a video to a beamer. But I want it too turn it off after office hours. I found /opt/vc/bin/tvservice -o and /opt/vc/bin/tvservice -p to turn off the screen. But that does not turn off ...
0
votes
1answer
495 views

Controlling High voltage devices with Raspberry Pi

Can I control high voltage (here 5V) to power a led lamp and a fan(both operating at 5v) from Raspberry Pi GPIO only using a transistor . Or should I isolate both the circuits using a relay or octo-...
0
votes
2answers
364 views

Control Raspberry Pi to control an Arduino over Apache

I want to control a Raspberry pi to control an arduino which is controlled by a webpage hosted by apache. I do not know how I would attempt this and if it is even possible. Can anyone please guide me ...
0
votes
1answer
2k views

I can't install anything with pip

Every package I try to install using pip, I get this error. I already updated the pip but even so doesn't work my pip version is 9.0.1 Exception: Traceback (most recent call last): File "/usr/...
0
votes
1answer
779 views

MPU6050: Two sensors receiving same data

I am using the Raspberry Pi 3 Model B to read in two MPU6050 sensors at the same time. I faced some initial problems in setting up everything but now I am able to read in data relatively fast. My ...
0
votes
1answer
82 views

I am trying to turn on a led using a switch in Raspberry pi. Now when I am trying to run it in python command shell it says: command not found

import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(17,GPIO.IN) input = GPIO.input(17) while True: if (GPIO.input(17)): print("Button Pressed") import time prev_input = 0 ...
0
votes
1answer
236 views

Is this normal for a pin diagnostic?

I'm trying to do the simple hello world of the pi world. I have been having problems actually turning pin 7 off. I tried moving my rib position in the socket (flipping the white side facing the sd ...
-1
votes
1answer
55 views

Creating a Day Counter

Does any one know the best way for me to make my PI count the days since an action was performed and display the value every day, I basically want my pi display to tell me how many days have passed ...
-1
votes
1answer
234 views

Unable to run python script on boot

I wrote a script for object detection and if I establish ssh connection to Raspberry Pi and run it from console, everything works fine. As I would like to start the script automatically on boot, I ...
-1
votes
2answers
671 views

How to run a python program from a bash script on startup?

I have a python script that is located at /etc/testscripts/WebServer. I call this usually from the command line by calling sudo python3.6 /etc/testscripts/WebServer. I have a bash script that looks ...
-1
votes
1answer
1k views

How to remove the kill prompt of a python script?

I have a python script that uses Tkinter, the quit button I have implemented pops up a prompt on the python shell after pressing it, which it didn't do on Windows when I wrote the code and tested it. ...
-1
votes
1answer
275 views

raspberrypi - on boot not running my infinite python script?

I have a Python script, which needs to run 24/7 to use GPIO high/low. So on boot i wanted it to run as below. But it never works to run python script on other hand it does create /tmp/test file? How ...
-1
votes
1answer
437 views

How could I use Wit.ai to get speech to text on my webpage running python script

I want the speech to be recorded by raspberry, send it to wit.ai and then get the response on my page(wich is actually the .py script and according to which I could run my conditions). Actually its ...
-1
votes
1answer
3k views

Reading all channels MCP3008

I have a problem with reading data from adc convertor MCP3008 10bit. I found a python script from adafruit that give data value from all channels (CHO TO CH7). I added a picture with my results and ...
-1
votes
1answer
167 views

Adafruit's LCD doesn't show text

I've just written small python script to operate adafruit's lcd with additional module. Almost every lcd's operation is handled by module. But when I try to print a message on screen or in console, ...
-1
votes
1answer
368 views

Use Pi 3 With Waveshare 3.5" and MFRC522

This message showed up when I was using MFRC522 along with Waveshare LCD 3.5"(A) on Raspberry Pi 3: python Read.py can't open device: No such file or directory Aborted I think it's because SPI is ...
-1
votes
1answer
2k views

Connecting to bluetooth speakers headlessly

Background: I have a Pi Zero that I want to send music to my bluetooth speakers. This works nicely when I have a monitor and can use bluetoothctl to pair and trust my speakers and the volume-adjuster'...
-1
votes
1answer
42 views

Newbie python issue

I'm trying to write some code to drive a Sense Hat ' I want to use an LED line to indicate the temperature, then scroll it up over time. The sense.set_pixels function expects a list of 64 RGB lists, ...
-1
votes
1answer
944 views

Will an automated scp script share files between Pis without Passwords?

I am planning on sending some files within an Ad-Hoc network of Pis. Build Raspberry Pi - 2 Model B Debian Wheezy 7.10/7.11 I am planning to run a cron job between the Pis in vicinity. Through ...
-1
votes
1answer
642 views

Error message every time I try to install applications

Error processing line 1 of /usr/lib/python2.7/dist-packages/gtk2-2.0-pysupport-compat.pth: Traceback (most recent call last): File "/usr/lib/python2.7/site.py", line 162, in addpackage if ...
-1
votes
1answer
145 views

can't work xx.py using crontab

I can send the value to domoticz but the problem is that it just changed when I use the command sudo python distance.py I have added * * * * * /usr/bin/python /home/pi/domoticz/scripts/...
-1
votes
1answer
193 views

Python Face Recognizer Error

I got this error during compilation.