The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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.

643 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
489 views

Python serial script prevents android connection

The python script below connects via "rfcomm0" to the "Bluefruit EZ-link module" on the "Arduino Uno" but prevents the bluetooth connection from my android app. If I change the script to use "/dev/...
1
vote
0answers
438 views

controlling 12 V RGB LED strip with raspberry pi

We are trying to control a RGB led strip with a 12 V power supply. The servoblaster does not work. Can you please suggest some other software we can use?
1
vote
0answers
469 views

LIRC with Raspberry PI , problems

I am trying to get my SONY CRS60A IR remote to work with LIRC and raspberry pi 2. Here is the setup : That is what my setup looks like. When I run mode2 -d /dev/lirc0 , I am able to read the ...
1
vote
0answers
347 views

I2C PIC18F2520 and PI

I am having a big problem to communicate a PI with PIC using I2C. When I try to use another PIC as master everything works fine, no problem. But swtich to PI I cant get it to work. To start my both ...
1
vote
0answers
693 views

Reset Pi Noir Camera

I have developed a system (Raspbian / Python) with detects someone's presence through a PIR sensor and records a 15' video with a Pi NoIR camera. This is command I call to record the video: Popen(["...
1
vote
0answers
1k views

Getting a Runtime warning and a Traceback warning

First of all let me introduce the problem. I am busy working on a HC SR04 + servo combination to measure the distance in certain angles. But lately some weird errors are coming up. The script( which i ...
1
vote
1answer
2k views

Raspberry pi sound level

I had this project of smoke detection.. so the smoke detector when it detects smoke will output a sound with a volume of 80dB, How can I measure dB using the raspberry pi and a USB microphone?
1
vote
0answers
392 views

PySerial not responding after 10 seconds of inactivity

I've got the JY-MCU Bluetooth module connected to the hardware serial port on my Raspberry Pi. It seems to be working except for one thing: when there is no communication for about 10 seconds or more, ...
1
vote
0answers
117 views

GPIO problems, when run infinitely goes to the right

I'm trying to get a controller to move right, preferably one space, using GPIO. I'm not quite sure what I'm doing wrong but whenever I run the script it moves to the right but it never stops. I don't ...
1
vote
0answers
662 views

Send SMS using Pi

I have a project, and I would like to send SMS message from Pi to my number phone, when I run it the command says: cannot send message: Process exited with a non-zero status I used SMS gateways to ...
1
vote
0answers
514 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 to ...
1
vote
0answers
1k 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. #!/usr/bin/...
1
vote
0answers
574 views

opencv and cv2.so/libcv2.so setup for python

I installed opencv 2.4.8 on my raspberry-pi. But i am not able to locate cv2.so /libcv2.so so that whenever i import i get error as cv2 not found. Is there a way to download theese packages to use in ...
1
vote
0answers
109 views

how can I export 'Motion - Conversion Specifiers' to use it in a python program? Raspberry Pi

I'm using motion in a Raspberry Pi and need export the coordinates of the center of the moving object (the %K and %L) because I want to use it in a python program. But I can't even make the ...
1
vote
0answers
3k views

Raspberry Pi RetroPie GPIO Shutdown

I'm trying to make an arcade cabinet with my Raspberry Pi and I want to make a physical shutdown button for it. I can do this with the GPIO, I even wrote a python script to do it: import RPi.GPIO as ...
1
vote
0answers
469 views

Execute shell & python scripts from commands sent via POP

I have my pi set up to text my phone (XXXXXXXX@vtext.com) through a google account when the CPU reaches or exceeds 45 degrees Celsius. I would like to be able to message back to the account and have ...
1
vote
0answers
1k views

Slow frame rate when playing video in Pygame

I've been doing some project on playing the videos and could use the button to change the movies selection. I ended up using pygame but the things are when the video has the resolution more than ...
1
vote
0answers
944 views

how to install cx_oracle python db driver?

I need to install cx_oracle on my pi but I couldn't find arm-specific version or sources. Any ideas how to do it?
1
vote
1answer
2k views

Cloning RFID tags with Raspberry Pi 3 and RC522?

I've looked around a lot now and can barely find any information on how to clone RFID tags with the Raspberry Pi, I've seen plenty of content on how to do it using an Arduino but I would really rather ...
1
vote
1answer
1k views

Python 3.4 opencv import error

I've tried the installation of opencv 3 for Python 3+ on the Raspberry Pi. After importing the opencv using import cv2 on Python shell it gives me this error: ImportError: dynamic module does not ...
1
vote
1answer
536 views

Playing jukebox style MP3 s by GPIO , how does the code/directories work?

Having followed the adafruit "overview playing music with buttons raspberry pi" I thought I knew it all but then I wanted to play random files and then to scroll through the files and play them by ...
1
vote
1answer
360 views

How can i make a GPIO F5 Button

I have a GPIO button triggering an os.system("sudo reboot") command. How can I change the reboot command to send F5 to the active window (web kiosk).
0
votes
1answer
11 views

Installing netcdf4 on raspberry 3b+

I am trying to install NetCDF4 on Rp 3B+. This is the command I used: sudo pip3 install netcdf4 But the error message is: Collecting netcdf4 Using cached https://files.pythonhosted.org/packages/...
0
votes
0answers
15 views

bind event from evdev to GUI wxpython

I have buttons and joystick as in the image below and I am reading events from these inputs on raspbian with the evdev library, I am also running a GUI using wxpython. My question is how can I bind ...
0
votes
0answers
6 views

Pi Camera v2 Capture Photo without warm-up

I want to a project that capture some photos at a time. After taking photos i will send theese pictures to a windows platform to encoding. I saw so many examples about taking photos but i every code ...
0
votes
0answers
24 views

Python app scheduler issue on Raspberry pi, i got error like this “python[2132]: WARNING:apscheduler.scheduler:Execution of job”

I an using Raspberry PI zero W and connected 5 sensors to getting reading from sensors. i used services for start the sensors scripts and i installed python apscheduler for time sequence. Sometime ...
0
votes
2answers
26 views

Callback parameters to GPIO.add_event_detect?

I have a button object that when pressed needs to perform something, and for this I'd need to get a property of the button. I'd like it to work like: ... GPIO.add_event_detect(button, GPIO.RISING, ...
0
votes
0answers
51 views

Selenium won't run on my raspberry pi 3 Model B+

Today I recieved my Raspberry pi 3 Model B+. I downloaded NOOBS and installed it on my raspberry pi. However, I cannot run a selenium browser on it. I have tried to install iceweasel but it says that ...
0
votes
0answers
55 views

Can't use microphone with speech recognition

I'm developing a voice assistant program with python and speech recognition. On windows everything is ok and it works. But on linux i got errors.I'm running raspbian buster on pi 4. here is the code ...
0
votes
1answer
52 views

Raspberrypi unable to read 2000 ppm encoder

I am using a DC motor attached with a 2000 ppm incremental encoder. I am using RPI to count the number of ticks, my code works fine but I am not able to calculate all the 2000 ticks. Any help would be ...
0
votes
1answer
51 views

Problem with i2c communication between arduino and raspberrypi

I have connected Rpi with Arduino using i2c communication. Pin Configuration: Rpi ---- Arduino Mega SDA SDA SCL SCL GND GND I also have an encoder attached to Rpi. Encoder `------ Rpi 5V 5V Gnd Gnd ...
0
votes
0answers
63 views

Random crash after several hours

sorry for the next error) I'm working on a project with my rpi, which just test on a student website if a teacher is absent, or if a lesson is moved. Actually, the rpi crash totally randomly : after 7-...
0
votes
0answers
26 views

How can I release all camera instances of a RPi in Python?

I'm trying to make a camera application with my Raspberry Pi that should launch on RPi startup. The program itself works fine. My problem is I'm getting the error picamera.exc.PiCameraMMALError: ...
0
votes
0answers
27 views

Combining potentiometers to register as buttons

Does anyone know how I could use 2 potentiometers (1 for vertical axis, other for horizontal) and combine them to register as buttons? I want to make a shifter for sim racing and I want to combine 2 ...
0
votes
1answer
72 views

RPi4B PCA9685 PWM Controlling Servo Problem

I have this RPi3 that I am running a bunch codes on it. It is communicating with a server and also I have python supervisor running on it. Now I am trying to set up the same system on RPi4. For some ...
0
votes
1answer
114 views

Can't use my Raspberry Pi 3 B+ for I2C in high speed mode

I've been trying to use a Raspberry Pi 3 B+ to get data from an accelerometer, namely an ADXL 357, via I2C but the problem is that the data rate is about 200 Hz or even less. I tried to set the ...
0
votes
0answers
24 views

Internet slowing down at specific time in the morning

I am using a RaspberryPi 3B as a server to run a Telegram bot (using node) and I began to notice that after some time the bot takes ages to reply; so I downloaded speedtest-cli and setup a python ...
0
votes
0answers
33 views

Python socket.accept not getting connections?

I run the same Python program on Raspberry and Windows laptop to listen to a blood pressure device over peer2peer UTP cable (no router). import socket s = socket.socket(socket.AF_INET, socket....
0
votes
0answers
26 views

Oled Display doesn't work properly

Im using my Raspberry Pi zero W For an project with an Oled display and i can't get it to work properly I Installed Adafruit and tried the examples. It didn't work and i tried an other example but ...
0
votes
0answers
14 views

Rpi become frozen with python loop script after few cycles

It is a bit hard to show and ask to review entire code, so please let me describe it. I am using Rpi as serial-controller with python script but the python script become frozen.(technically I have to ...
0
votes
0answers
202 views

Run program on raspbian buster LXDE startup

I know this question has been asked before, but the methods referenced are not working for me. Currently I have done this: sudo nano /etc/xdg/lxsession/LXDE-pi/autostart and added the line @python3 /...
0
votes
0answers
23 views

MQTT and Rapsberry PI

When I connect to a newly installed Mosquitto client from my Windows machine it works fine See the python command below : >>> import paho.mqtt.client as mqtt #import the client1 >>&...
0
votes
2answers
54 views

Configure Raspberry pi to run my application before GUI Desktop

I have created an application through Python that has library dependencies on Qt4, pyqt4, pyqtgraph etc. This application is based on Raspberry Pi, I have developed and finished it on the platform. I ...
0
votes
2answers
47 views

Ending a camera video stream in Python / threading

I’m very new to Python and have been struggling with the code for a wildlife camera project on the Pi. I’ve managed to get the PIR sensor and automatic camera capture working, but I’d like to have a ...
0
votes
0answers
20 views

NoIR camera - Photo and and video frame size looks different

I'm trying to create a feature matching script using NoIR camera. What I'm doing is take a picture using and compare it with the real time video feed. Everything works fine but the the live video ...
0
votes
0answers
43 views

picamera web streaming and image capture

I am a total python novice so please bear with me... I have combined a couple of the picamera advanced recipes to try and web-stream and take pictures simultaneously. everything works correctly, ...
0
votes
1answer
33 views

2 Motors functioning unevenly - right motor gets more power than the left

I'm trying to execute this piece of code to run 2 motors on my robot. The code is really simple it's just repetitive. For some reason that I can't figure out, the motors run unevenly. Here is the ...
0
votes
0answers
39 views

Is there a way to loop through GPIO pins and a database in python

I have built a set of musical stairs using raspberry pi, motion sensors and python, and a web app to change the instrument using PHP. The python connects to a mysql database storing the instrument ...
0
votes
0answers
23 views

Python, pygame.mixer, wait for track to end

A little stuck on the last part of this code. I want a random track to play until the end when a switch is switched. I would like the track to play no matter how many times the switch is switched ...
0
votes
0answers
26 views

Interrupt triggers without button pressed what can i do?

I have two buttons: a red and a green one and i want to measure how often each one gets pressed and i want to write into a csv file. The problem is even without me pressing the buttons the pi gets ...