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
0
votes
0answers
673 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
483 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
1answer
707 views

Running a python simple script at startup/boot [duplicate]

Can anyone please help me to run a simple python script at start up? (for eg. let the script print hello) please explain me step by step,,,starting from basic steps! I tried many examples using ...
0
votes
4answers
3k views

How To Start Learning Python For Raspberry Pi? [closed]

I have old version of Raspberry Pi (Revision B) and now I am planning to create a robot with it. However, I don't know python at all. I want to learn python but haven't found any tutorial that teaches ...
0
votes
0answers
495 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
1answer
759 views

GPIO Connections

I would like to use raspberry pi for measurement of Temperature,Humidity,Motion, soil moisture & distance. I would like to add three led indicators. I'll be using following sensors 1) DHT-11 ...
0
votes
2answers
422 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 ...
0
votes
2answers
3k views

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

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
0answers
797 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
558 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
2k 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
1answer
214 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 rpi'...
0
votes
1answer
2k views

Delay running of python script on boot until desktop is finished

I tried simply editing the autostart file to run a Python script on boot, but it runs with errors, I assume becasue the desktop hasn't completed. Can someone tell me how I would launch a script with a ...
0
votes
0answers
517 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
1answer
220 views

How does Raspbian depend on Python2.x?

I've written a Python3.x code on a PC (win 7) in order to read out temperature data from an external measurement unit (using basically pyserial & Matplotlib). I want to port this program on a ...
0
votes
0answers
370 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
697 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
3k views

Problem reading text file using Python ftplib on Raspberry Pi [closed]

I have been trying to read a simple two line text file from a remote server using ftplib. The simple script shown below works fine from my Ubuntu laptop but will not work from my Raspberry Pi's. #! /...
0
votes
0answers
31 views

How do I run my PiGlow [duplicate]

After following the steps on this page. I did everything correctly and when I try to run the test.py file it says this: Traceback (most recent call last) : File "test.py" , line 9, in <...
0
votes
1answer
266 views

Pi Glow programming [duplicate]

After following the steps on this page https://github.com/Boeeerb/PiGlow. I did everything correctly and when i try to run the test.py file it says this. Traceback (most recent call last) : File "...
0
votes
1answer
275 views

Display board using raspberry pi

I have to make a display board using raspberry pi. The display board will be showing some sort of counter and 1920x1080 32 inch LCD screen will be used for display. Thus I have decided to use pygame ...
0
votes
2answers
424 views

Pygame screen resolution

I creating a data logger program in Python for a customer. I use pygame for displaying status and temperature. We plan to using a car display on the composite video output. The display will have ...
0
votes
1answer
2k views

Web Interface to Control Robot Arm attached to Raspberry Pi - HOWTO?

I'm currently working on a project to hook up a robotic arm & webcam to my Raspberry Pi and control said arm through a web inteface. I believe the technical work here involves: Connecting the ...
0
votes
1answer
541 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
204 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
2answers
331 views

How to find available space and free space if low [closed]

I need to programmatically be able to see how much space is left on the SD card and if it is low delete some files. I'm not sure how to go about getting the value of the SD card space and then saving ...
0
votes
1answer
127 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
2answers
2k views

Host a website on the raspberry pi to display local sensor data [closed]

I have been enlisted by the local engineering club (as a programmer myself) to help with their hydroponics project. Basically they are needing help accessing the Pi remotely and this is as much as i ...
0
votes
1answer
269 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
549 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
388 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
2answers
815 views

Some Kivy apps not running in Raspberry Pi - Python

Currently I have a Raspberry Pi 1 Rev2 model B and a Raspberry Pi 3, I'm developing an app that could check dynamic values from several screens, I'm using a 7inch LCD Screen to look the graphics ...
0
votes
1answer
705 views

How can I download and install Numpy and Pandapower? [duplicate]

How can I Download and install numpy and pandapower on the RASPBIAN JESSIE LITE Minimal image based on Debian Jessie? the one without the GUI. And how can I download and install Pip and miniconda on ...
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
810 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
2answers
2k views

play audio stream when bluetooth connects

I have a Raspberry Pi Zero W and want it to use as an Internet Radio. So I wrote a Python script that connects to my bluetooth speaker and starts a stream. Everything works fine, but i always need to ...
0
votes
3answers
2k views

How to control a python script over a local web server?

I am starting a project on my raspberry pi in which I am trying to control a servo hat (pimoroni pan tilt) from a web server. How can I host a Lan website from the pi, then control parts of a python ...
0
votes
1answer
88 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
247 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 ...
0
votes
1answer
711 views

Gstreamer player dont play

I've made basic gstreamer player: import threading import gst import gobject class BasicPlayer(threading.Thread): def __init__(self, musiclist): threading.Thread.__init__(self) ...
0
votes
3answers
4k views

how to use two rfid rc522 nfc tag reader with a raspberry pi?

I am currently using a rfid rc522 nfc tag reader with raspberry pi using the MFRC522-python code. In my project I need to collect data from two rfid rc522 cards at the same time, rc522 are located at ...
0
votes
1answer
6k 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 ...
0
votes
2answers
1k views

pylirc returns none all the time

I'm trying to write simple IR receiver code using pylirc in python but the function Pylirc.nextcode(1) always returns None! I ran a test and everything is good, the terminal and the shell in python ...
-1
votes
2answers
492 views

RASPBERRY PI Error Python GUI : “no display name and no $DISPLAY environment variable”

Hi guys I want to create a basic GUI with TKinter. This is my code from tkinter import* import tkinter.font win =Tk() win.title("Test") myFont = tkinter.font.Font( family = 'Helvetica', size = 12, ...
-1
votes
2answers
98 views

I don't know where to start [closed]

I am completely new to Raspberry Pi and have started from basically no knowledge. My end goal is to make a synth or drum machine. My problem is that I attempt to start learning something like how to ...
-1
votes
1answer
3k views

How do In open IDLE?

I want to make the whac-a-block on Minecraft Pi. It says I need to use IDLE, but I don't know how to get to it. Please help.
-1
votes
2answers
458 views

Control motors and servos simultaneously (Python)

I have a Raspberry Pi 2B+ and some knowledge of Python. I need to control a DC motor, two servos and a LED simultaneously. The requirements are: Must control two servos, a LED and at least 1 DC ...
-1
votes
1answer
439 views

Unable to capture faces “y is not defined”

I tried removing gray[y:y+h,x:x+w] in imwrite line and the code works amazing but as soon as I add this [y:y+h,x:x+w] it says: y is not defined. I just don't understand how can this error message!!! ...