Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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.

641 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
0
votes
1answer
32 views

Pigpio on callback get value

I currently have some code that I found that constantly outputs a value from a digital caliper. However, I want to modify this so that it is inside a function that can return that is returned from ...
0
votes
0answers
201 views

Alsa Lib PyAudio error on Raspberry Pi 3b+

I was looking at an old question that gave advice for fixing these errors: ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown ...
0
votes
0answers
20 views

Looking for suggestions digital price cards

Hello fellow raspberry pi users I am looking for suggestions in getting a raspberry pi 3 to create digital pricing for our locations. The idea is to have it pull the price for products from a google ...
0
votes
0answers
32 views

Run curses based python script on start up [raspbian stretch]

I'm trying to auto start a curses based python script on startup of my RPi 3+ (running on raspbian stretch) What I did so far. I've got a python script demo1.py, import curses ...
0
votes
0answers
15 views

Has anyone used spidev library with python 3?

I am currently trying to interface a RPI 3B+ with a flash memory chip using SPI communication. do anyone have a good resource for using SPI communication with memory? What language should I use. I ...
0
votes
0answers
38 views

script works if I run it once, if I run it in a while loop the Pi freezes

I have this python code that on motion detected send images via email and record videos locally (note the commented line): from gpiozero import MotionSensor from picamera import PiCamera from time ...
0
votes
0answers
31 views

Binding PiCamera stream to GstWidget

Well, today I began to program in Python and I'm doing a graphical app with PyGtk in Anjuta. My first objective is to get the stream of the PiCamera in a window. But I'm getting problems to manage the ...
0
votes
0answers
17 views

Gpio state manipulation if subroccess is finished?

I have my raspberry pi 3 running a python script that manipulates some strings and according to that they sometimes pipped to minimodem. How can i be sure that the pipped subprocess is finished so I ...
0
votes
0answers
32 views

Read VW Cluster Adapter Over GPIO

So, i'm trying to develop a new cluster using my Pi. I've built the entire thing using a WiFi OBD-II Adapter & Python. Then I hit a stumpling block, OBD cannot read things like Indicators/Cruise ...
0
votes
1answer
35 views

How to trigger a capture using Picamera when a particular event occurs (for eg, whenever a specific object appears in front of the camera)

I want to trigger an image capture every time a tyre of a set of moving vehicles appears just in front of the picamera. Is there any way to get this done automatically every time a tyre appears in ...
0
votes
0answers
25 views

Unable to call .Py on Raspberry Pi using Plink

I am designing a .bat file that uses Plink to execute python files located on a Raspberry Pi. Ideally a user will click on this bat file to execute python code on the Raspberry Pi without having to do ...
0
votes
0answers
33 views

Error mounting system-managed device /dev/sdb1

I'm making a zip file with Python, but the process is interrupted. dev/sdb1 is already mounted but this error: Error mounting system-managed device /dev/sdb1: Command-line `mount "/home/pi/hrc2"' ...
0
votes
0answers
22 views

is there a way to minimise the effect of the Pi on the Sense HAT's temperature sensor?

Is there a way to minimise the effect of the Pi on the Sense HAT's temperature sensor? I cannot seem to reduce it from mid to high 30s deg. C. Or do I really need a sensor that is external to the ...
0
votes
1answer
57 views

Having a sound clip play and be looped as long as the button is pressed down and stops as soon as it is released

I am able to have the script running when I have the code set to pygame.mixer.music.play but if I do pygame.mixer.music.play(loops=-1) I get an error stating CallbackSetToNone: The ...
0
votes
0answers
77 views

Input/output error using Python ADS1115, and a Raspberry Pi

I am trying to read an analog signal using ADS1115 and a raspberry pi. Sometimes it reads and some time result into error. Following is the code snippet response = {} adc = Adafruit_ADS1x15.ADS1115(...
0
votes
0answers
125 views

Execute Python-Script on MotionEyeOS

I've recently created a Card with MotionEyeOS for the Raspberry Pi. I've tested motioneyeos already on DietPi and the normal Raspbian, but it didnt worked with the original Raspberry Pi-Camera. In a ...
0
votes
1answer
66 views

I think I fried my Raspberry Pi, but I'm not sure

I was making connections from my Raspberry Pi to a relay module. While I was running some sample code, I noticed that after I had terminated the program I was still getting a high CPU usage (around 60%...
0
votes
2answers
291 views

How to wire a Raspberry Pi to a 16 channel relay module? It won't work

A am using working on a project that requires a camera analyzing some images and activating the appropriate GPIOs to control a relay board. I currently have a touchscreen display, a Raspberry Pi Cam ...
0
votes
0answers
46 views

Sending data between PC and Raspberry Pi

I have been trying to send data from my Windows PC to my Raspberry Pi 3 for a python controlled speaker project. I am using TCP sockets which I don't know much about. Client code (PC): import ...
0
votes
0answers
42 views

If I get Anaconda for Raspbian, how will it affect the existing Python installations?

In Raspian, I got Python 2(IDLE) and Python 3(IDLE) already installed. I'm more used to working with Anaconda with all its included packages. I'm just not clear if I install Anaconda, will I get an ...
0
votes
0answers
27 views

Cannot turn web streaming into a function

I'm working on a project with my Raspberry Pi 0 and a camera. I'm writing my code in Python using the PiCamera module. This file handles setting up the camera and Starting Web streaming. I had no clue ...
0
votes
0answers
118 views

selenium.common.exceptions.WebDriverException: Message: connection refused

I ran a program with selenium from selenium import webdriver driver = webdriver.Firefox() driver.get('http://www.google.com') and this error accured Traceback (most recent call last): File "/...
0
votes
0answers
30 views

No available Audio Device after switch from NOOBS to Raspbian Stretch

my program uses Pygame to play sounds. I used Noobs before and my program worked fine in Thonny. Now, i switched to Raspbian Full Stretch and now I get the error No available Audio Device. I already ...
0
votes
1answer
37 views

Pi 3 B+ sudden audio failure

A few months ago I bought a RasPi 3 B+ to act as an overglorified doorbell using reed switches to tell the Pi to play a custom MP3 with the "Playsound" Module into the Company's PA system. It worked ...
0
votes
0answers
17 views

Which screen size in Pygame for an 3.5 inch LCD?

i try to fill out my whole LCD screen in Pygame with the best sharp resolution possible. So there is a difference between computer screen and the LCD. My LCD has resolution is 480×320. So choosing ...
0
votes
0answers
23 views

Need help on how to apply arcade kit commands in Python code

I'm using Python on my Raspberry Pi to code some games for my high school finals project, and I want to play them with a arcade kit (Game DIY Arcade Set Kits Replacement Parts USB Encoder to PC ...
0
votes
0answers
53 views

Cant upgrade Raspbian neither run Python

I am trying to upgrade my Raspberry Pi 3 B+: $ uname -a Linux plexmediaserver-pi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux But I am getting this weird error: pi@...
0
votes
0answers
67 views

Can't send UDP packets

I am trying to send a 4-digit number, that is a result of two HC-SR04 sensors'measured distance, through UDP and according to almost every command and wireshark on my computer, the Raspberry isn't ...
0
votes
1answer
384 views

How to send and read a string from Raspberry pi to Arduino via serial interface?

I was trying to send and receive data between Raspberry pi and Arduino UNO. I'm able to send and receive a string from Arduino to Pi using Serial.println. I spent hours searching a better tutorial or ...
0
votes
0answers
18 views

How to send data across usb0 to use in pygame?

So i have a pi3b+ and a zero hooked up to a tft ili9341 display. I can run pygame on boot and it works fine. I have also started using python sockets and successfully sent data (my wlan0 ip) from my ...
0
votes
0answers
28 views

Python program crashed on RPI compute. syslog contains message “INFO: task python3:724 blocked for more than 120 seconds.”

I am working on a project with a PI compute module set up on a custom PCB. The project has to reliably run ideally indefinitely while logging sensor data and writing video and audio to a usb when the ...
0
votes
0answers
26 views

RPlidar could not be launch

I am now doing a project using RPLidar in ubuntu 16.04. However, I am facing some problem with running the RPLidar. I have checked that my userid is inside the dialout group. The below code is what I ...
0
votes
2answers
715 views

How to install Numpy in Anaconda on Raspberry Pi 3B with Raspbian Stretch OS?

My goal is to use Numpy inside of Anaconda on the Raspberry Pi 3B. I downloaded Anaconda by following the instructions: https://stackoverflow.com/questions/49170125/cannot-install-anaconda-in-...
0
votes
0answers
16 views

How to prevent the automatic execution of script in IDLE?

I have a python script which I can work on with nano and start without problems via SSH. Opening the with IDLE in the GUI on the raspberry opens a terminal prompt and the script is executed after a ...
0
votes
0answers
102 views

Read data from RPLidar and getting “Wrong body size”

I'm trying to read response from a Slamtech RPLidar connected to my Raspberry PI 3 via USB and I'm getting the following error: Traceback (most recent call last): File "app.py", line 70, in main ...
0
votes
0answers
91 views

Segmentation Fault when running script with Python3

I have an application which should running on Python3 with Kivy and Postgresql. I had my Python3 installed according to the guide from this blog below: Install Python3 but I realize the Python 3.7 ...
0
votes
0answers
66 views

How to run a servo motor if a particular condition is satisfied

I have a script of python which is about object detection once a particular class is identified the servo motor should work Iam using object detection using tensorflow and opencv , basically scripts ...
0
votes
1answer
206 views

Xbee-API python

I'm trying to use my Raspberry Pi B+ as a gateway so others sensors, also with xbee, can send data and get a few kind of commands by it. The problem is that i can only read the data with the simplest ...
0
votes
0answers
35 views

Is it possible to read android tag via RFID-RC522

So, I googled for two days and didn't get correct answer. Is it possible to read NDEF data from Android phone via RFID-RC522? I've tried to use couple of libs to solve this issue. Also I've tried to ...
0
votes
0answers
38 views

Which language is best for Raspberry Pi Apps for better GUI and Firebase

I want to develop Raspberry Pi app which requires lots of REST API calling, GPIO controls and very best GUI. I have done research on following. Running C#.net or VB.NET apps in Raspbian OS using Mono....
0
votes
1answer
45 views

Wireless doorbell using gpiod

Good Morning, I have a non issue that I am just curious how its working. So I have a wireless doorbell that I built. It works using the gpiod and remote gpio. So I have a chime unit that I built with ...
0
votes
0answers
43 views

Connect 3 Raspberry pi using i2c

I'm trying to use i2c to exchange messages between 3 raspberry pi, all of them must receive a message do something and then send a response. Raspberry as an I2C SLAVE From here I came up with a ...
0
votes
2answers
112 views

File transfer between raspberry pis via GPIO pins

I'm trying to send image(3MB) captured by one pi to another pi, external WIFI or setting up one pi as AP is not possible due to strict regulations, all I can use are the two wires. Currently I'm ...
0
votes
0answers
90 views

MQ135 Sensor - Output ppm

So I am making a Mq135 sensor and the wiring can be found on: circuit.io/app?components=9443,200000,398790 It isn't shown but the AO is connected to channel0 via the breadboard the code is : #!/usr/...
0
votes
1answer
53 views

measuring phase difference in 3 phase power

For my ceramics oven I had 3 phase power installed. But power consumption according to the meter is way higher than the nominal 7KW the oven consumes. A friend told me that if the phase (or sinus) is ...
0
votes
0answers
242 views

illegal instruction when importing opencv in python 3.5

illegal instruction when importing opencv into python compiled opencv3 for python 3 by using these commands $ cd ~/opencv-3.3.0/ $ mkdir build $ cd build $ cmake -D CMAKE_BUILD_TYPE=RELEASE \ -D ...
0
votes
1answer
347 views

Raspberry Pi error when connecting to Firebase

When I tried from firebase import firebase running in the Python 3 (IDLE) and Thonny Python IDE, it gives an error likes this at the first line: Traceback (most recent call last): File "/home/pi/...
0
votes
0answers
72 views

My Raspberry Pi Flask server stops responding

I have a Raspberry Pi 3. On my Raspberry Pi I have a Python script that initializes a Flask server, the Python script returns some basic JSON. The Python script is initiated on boot using process ...
0
votes
0answers
813 views

Installing dlib on raspberry pi3

I've been trying to install dlib on my raspberry pi 3 since past 2 days, but every time end up with a frozen screen. The pi is running on the latest raspbian and and everything seems like up-to-date, ...
0
votes
1answer
384 views

Connecting 4 HX711 to one Raspberry Pi

I have four individual scales that are each connected to a HX711, those HX711s are each connected to the Raspberry Pi. I'm a beginner in python as well as this Rasberry Pi. how do i properly code this ...