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
7 views

wiring Raspberry and piezo sensors and reading analog inputs from python

I want to read analog inputs from piezo sensors like these on Raspberry using python, which ADC do you advise me with 8 or more channels and how to wire and program it to get digital values?
0
votes
0answers
25 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 ...
2
votes
2answers
124 views

Is there any built in LED connected with GPIO pin?

In Arduino a built in LED is attached with number 13 Digital pin. Is there any LED like Arduino in Raspberry Pi,which I can use to test my code?
0
votes
1answer
23 views

Help need with python script for PiCamera

I am working with the Raspberry Pi camera and need some help regarding the python script. I need to capture a set of 5 images continuously every 5 minutes interval until I want it to stop. This set of ...
0
votes
1answer
42 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
40 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 ...
-1
votes
0answers
9 views

the error messages:NameError: name 'QPusButton' is not defined [duplicate]

import turtle import sys from PyQt5.QtCore import* from PyQt5.QtGui import* from PyQt5.QtWebEngineWidgets import* from PyQt5.QtWidgets import* class TurtleControl(QWidget): def __init__(self,...
0
votes
2answers
37 views

Communicate with GPIO HIGH/LOW between 2 PIs

I have 2 raspberry PIs 1x PI3 and 1x PIZero with camera attached. I want to set up a system to have a output GPIO pin on the PI3 and a input pin on the pizero connect so that when I set the PI3 pin ...
0
votes
0answers
13 views

Display next up google calendar event (Python) [closed]

Hi I would like to somehow print in python what my next up or upcoming google calendar event(s) are. I have never worked with API's before and I am new to python. Do you know what API / Library I ...
0
votes
0answers
46 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
17 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: ...
1
vote
1answer
28 views

Cannot install pandas on Raspberry Pi

I have been trying to install pandas for a week now. Read pretty much every thread I could find but nothing seems to work. I keep getting a ton of import and dpkg errors every time. Everything is up ...
0
votes
1answer
25 views

Running script after reboot does not work

I have a simple script will runs a loop that reads off temp data in the console from a sensor and then writes it to a file. I would like to make sure that this script starts running right after my pi ...
0
votes
2answers
29 views

Ultrasonic Sensor + omxplayer block CPU

Thanks to the community i create a scrip that check status of 3 ultrasonic sensors and depending on the status omxplayer will play a movie or other. Problem is that after few while and video loops CPU ...
0
votes
1answer
36 views

RPi.GPIO “flush” interrupts

Intro It seems to me that when one adds and event detection, then removes it and the adds it again, something strange happen: 1) an event is removed to the "detection list"; 2) the event happens; 3) ...
1
vote
1answer
77 views

GPIO pin (BCM 12) acts differently on PI3 and PI4

The following code is running on PI3 and is working perfectly fine. I try to provide a short description of what the code does. In this code I first set the BCM 12 as the pin of interest for my sensor ...
0
votes
0answers
26 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
20 views

spidev sanity check not working

ArchARM on Raspberry Pi 3, spidev installed from AUR. I'm trying to control a Waveshare device via SPI, and can't get SPI to work from Python. The most basic sanity test I can think of is failing: ...
0
votes
1answer
54 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 ...
-1
votes
1answer
61 views

Response to a incoming call using python script

I am trying to implement a system using Raspberry-pi and SIM-800 modules. Now I can see incoming calls from my python script, but it can not parse data. import serial serialport = serial.Serial("/...
2
votes
1answer
66 views

Moving from Raspberry Pi to another platform?

Lets say that I develop my highly complicated LED diode project on Raspberry Pi 3 B+ in Python. Now I don't want to use my RPi for this project becouse it is expensive and I want to move with next one,...
0
votes
1answer
20 views

Use Raspberry Pi 3 with its camera module to live stream and also store that video on cloud

I have a Raspberry Pi 3 and camera module, I want to use that camera and live stream our internet and also store that video on cloud in chunks of specific time period (like store videos of 1 hour ...
0
votes
1answer
61 views

Can't use my raspberry pi 3 B+ in high speed mode

I've been trying to use a Raspberry Pi 3 B+ to get data from an accelerometer, namely 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
25 views

python error free(): invalid pointer exit code: 6 status: 1 [closed]

I am using python 3 with mu to work with a memory chip, and about half way through my code I'm getting a strange error. what does the error code " free(): invalid pointer " mean? exit code:6 status: 1....
1
vote
0answers
34 views

Why does writing to I2C is too slow in Python comparing to C? [closed]

I am trying to find out why the same code in Python works 25 times slower than C even if I use CDLL, when I try to write into I2C. Below I will describe all the details what I am doing step by step. ...
0
votes
0answers
23 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
31 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....
1
vote
1answer
54 views

Not able count Pulses Generated by PLC

I am using the below code to capture the pulses and count pulses for a specified interval but the output not as what i expected. For every pulse it is giving uncertain value. The pulse i want to ...
0
votes
0answers
23 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 ...
1
vote
1answer
23 views

Pandasql on Raspbian?

Has anyone successfully installed the Python pandasql package on their Raspberry Pi? sudo apt-get install pandasql Gives the following results: Reading package lists... Done Building dependency ...
1
vote
1answer
59 views

Nested Else issue. Very Basic

This is the code I am using to operate a relay to open my garage and the garage status is checked by a magnetic switch. However there is an issue with the logic can someone help me please as I am ...
0
votes
0answers
13 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 ...
-1
votes
0answers
22 views

How to avoid to create empty wave form in sending serial with pigpio

I am so frustrated with this problem, please help me if anyone knows whats happening here.. I am using pigpio in python 2.7/raspberry pi. the purpose is to control three devices over serial. It works ...
1
vote
0answers
20 views

I don't know why suddenly mjpg-streamer and webcam stop working

I have made a program that uses three webcams and three ultrasonic sensors using raspberry pi 3 and python 3. When each ultrasonic sensors detect stuff in front of them, webcam take a picture of it. ...
0
votes
2answers
22 views

Pigpio equivalent of GPIO's event_detected() function?

Is there an pigpio equivalent to GPIO's event_detected() function? I need something that is constantly watching for a button press. The code I currently have doesn't consistently detect it (python ...
0
votes
0answers
76 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
13 views

Can't read from serial0 using PySerial when python script starts at boot [duplicate]

I have a Python script that uses Pyserial, connects to '/dev/serial0' and reads from it in loop. The script works fine when starting it manually after the RPi is up. However, when I added the script'...
0
votes
0answers
21 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
47 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 ...
2
votes
1answer
73 views

Camera access in docker container is generating errors / locking

I am trying to build some machine vision software inside docker containers, it has worked previously, but now both devices are not able to access the camera. It seems to be a configuration/update ...
0
votes
2answers
38 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 ...
1
vote
1answer
62 views

Arecord: “main:828: device or resource busy” when run via systemd service, but works fine from CLI

I have a python script which, when a GPIO button is pressed, launches an arecord process. This records audio from a USB microphone (plughw:CARD=GS3,DEV=0) and pipes it to another program for ...
0
votes
2answers
37 views

RUN RC522 READ Python Script without SUDO [duplicate]

Im working with MFRC522-Python library, I READ the RFid Uid then I open a webbrowser with a specific URL composed by the uid of each card. The thing is in Raspbian Buster (RPI 3b+) cannot run Chrome-...
0
votes
0answers
19 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
29 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
31 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
35 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 ...
2
votes
1answer
37 views

Showing an image on screen attached to Pi via SSH

I am running a raspberry pi3b+ via ssh. There is a hyperpixel4 screen by Pimoroni attached to the Pi and it's working fine. I am trying to display an image on the screen attached to the Pi with a ...
0
votes
0answers
22 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
24 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 ...