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
1 answer
25 views

USB Python Script Issue Raspberry Pi OS

I'm encountering an issue where I'm trying to trigger a Python script in the background upon plugging in up to four USB devices, all with the same USB vendor and product IDs. To accomplish this, I've ...
Figaro's user avatar
  • 1
0 votes
0 answers
21 views

'make' command not working on my Raspberry Pi while compiling the SocketCAN driver

Problem: When running "make" command I am met with errors I've been trying to install a SocketCAN driver on my pi device so I can communicate with a USB CAN Adapter. I've been following ...
user162422's user avatar
0 votes
0 answers
8 views

Reading from MT6816 magnetic encoder with SPI connection using Python on Raspberry Pi 4

I am totally new to the field, don't really know what I'm doing and in need of help. I'm trying to read an absolute angle using an MT6816 14-bit magnetic encoder via SPI connection using Python on ...
Kannidhis's user avatar
0 votes
0 answers
15 views

Python - Way to interact with GUI by executing start - Raspian OS

I want to interact with the GUI of my display(Open an image every time I press a button that I have interfaced via GPIO) via a python script which is executed after bootup. (I have edited crontab file ...
harsh's user avatar
  • 1
0 votes
0 answers
18 views

Pi4 python OpenCV timeout

I have been having some issues with getting a video stream from my cameras on my Pi4B. I am running this on Python. I have been getting the error; VIDEOIO(V4L2:/dev/video0): select() timeout with the ...
Dwayne David Wallace's user avatar
0 votes
0 answers
21 views

Can't install RPLCD on rasberry Pi

I can't install module RPLCD on Python 3.11.2 I tryed "pip install RPLCD" = no command "pip", tryed "pip3 install RPLCD" - no results. I also tryed "apt install ...
Mikhail's user avatar
0 votes
0 answers
28 views

rc. local not working

I have an issue with opening Python script at startup. I have added python /home/serhii/Desktop/Packed/Hello.py & to rc.local and the script does not open. But, the command sudo pigpiod is working....
SPS's user avatar
  • 1
0 votes
0 answers
20 views

Problem when testing module DAC MCP4922 with Raspberry Pi

I'm encountering an issue while testing a custom-designed DAC module that utilizes an MCP4922 chip as its primary processor. The vendor provided C language test code for ESP32-S3, but I intend to test ...
Hien_lee's user avatar
0 votes
1 answer
20 views

ESC, BLDC control with pigpio: set_PWM_dutycycle or set_servo_pulsewidth, and other ESC questions

I am new to Raspberry Pis. I am using a Raspberry Pi 4. I am trying to control a BLDC motor from the BLHeli_32 ESC, using PWM signals output from GPIO pin 18. For this project, I need the motor to go ...
Tsz Kit Koon's user avatar
-1 votes
0 answers
17 views

Control the robot and show the Livestream in the same time

I want to show the Livestream behind the buttons without pressing "link to video feed" This is the html code: LIVE STREAMING - Surveillance Robot a { ...
Baraa Atouani's user avatar
0 votes
1 answer
55 views

import picamera2 module not found when run in script with python3.8

Why would it be that a module could be imported via command line, but not via script? As you can see below, I can import picamera2 in the first attempt via terminal, but when I'm running scripts the ...
MichaelC's user avatar
-2 votes
2 answers
33 views

How to stream video from the RPi to a web browser in realtime?

How to stream video from the RPi to a web browser in realtime? I need help please for my surveillance robot 😭🙏🏻
Baraa Atouani's user avatar
0 votes
1 answer
544 views

RPi.GPIO RuntimeError: Failed to add edge detection

I ran a python script on a Raspberrypi 4 on Raspbian Bookworm for a ups (uninterruptible power supply) quite a while. Since the latest update of bookworm the script fails. Since the script of the ups ...
uenz's user avatar
  • 19
0 votes
1 answer
42 views

"Most direct" way to display an image on Official Display from Python

I have a Raspberry Pi 4 connected to an Official 7' Touchscreen Display that I want to display some data on, ideally from a Python application. What is the "most direct" way to go from an ...
Scott's user avatar
  • 101
0 votes
0 answers
22 views

Slow tkinter app loading and choppy mouse

I have a raspberry pi 5 running a python app that uses a customtkinter UI and TCP client running on a thread along with some serial port IO on another thread. The app loads in around 15 seconds and ...
Ohbhatt's user avatar
0 votes
0 answers
18 views

GPIO not performing program operations

I'm working on tensorflow lite project with custom models. I'm making a conveyor belt to detect and remove defective items which are trained by me. My camera detects object but when it comes to make ...
namaaa's user avatar
  • 1
0 votes
0 answers
16 views

RPi 5 Code Does Not Work Without Root

I have a code. Because it is very long (2500 lines) I can not throw it here but here are the libraries: import sys import datetime import locale import serial import time import os import cv2 import ...
MEnsar55's user avatar
0 votes
1 answer
189 views

RPi 5 PyQt5 Install Error

I need to download PyQt5 for a project on my Raspberry Pi 5. I opened a Virtualenv and downloaded other libraries. But I got the following error when downloading PyQt5. Looking in indexes: https://...
MEnsar55's user avatar
1 vote
0 answers
37 views

Changed cameras, now it's not working

Following tutorials I got a basic first step program working with the Pi Camera Module 3. Then needed to switch cameras to the Arducam x519, and now it terminates itself at the first line. I followed ...
Derian Magness's user avatar
0 votes
1 answer
35 views

Writing bash script to reboot pi 10 times and log output

I have written a Python script and scheduled it to run @reboot using cronjob. Sometimes this script throws an exception sometimes it works perfectly. I want to write test scripts for this. Preferably, ...
Osama Khalid's user avatar
1 vote
0 answers
31 views

Using a camera and getting a big block of errors I don't understand

So far I've just been following tutorials to set up the camera to do more complex things later, but I always get this block of errors (below). I've tried googling the errors and haven't found anything ...
Derian Magness's user avatar
0 votes
2 answers
75 views

Run python script as systemd service

I'm trying to invoke a python script as a service AND send it's output to a logfile. I created the following file; /etc/systemd/system/rfsensor.service, with contents: [Unit] Description=rfsensor ...
NigelS's user avatar
  • 3
0 votes
1 answer
87 views

Why did my servo motor break when controlling it from a raspberry pi?

I was trying to control a Tower Pro SG-5010 servo motor using a Raspberry Pi 4, with the python code below, but after working for a minute or so, the servo started not turning for some of the commands,...
guest1253's user avatar
0 votes
0 answers
14 views

Best environment for interactive installation?

I'm gathering some hardware for a permanent interactive wall installation that will utilise Pi 4 and some touch sensors via GPIO. The Pi will be hooked up to a video projector and a speaker. The idea ...
ALx's user avatar
  • 101
0 votes
0 answers
28 views

LEDs in 8x8 matrix triggered in unexpected order

I have bought a pre-built 8x8 LED matrix powered by an ht16k33 and connected it to a Raspberry Pi 3b. I have created the following test program, which should turn on each of the LEDs of an 8x8 matrix ...
drewb's user avatar
  • 1
0 votes
0 answers
39 views

Timeout Issues in PySerial. Arduino randomly starts timing out

from get_connected_arduinos import get_arduinos serial_devices = [] def initialize(serial_device): print("initializing", serial_device) try: serial_device["serial"...
UnityBug's user avatar
0 votes
0 answers
27 views

I’m using Raspberry Pi 3B and having an error for running tflite

Here is the error Traceback (most recent call last): File "/home/pi/tflite1/TFLite_detection_webcam.py", line 122, in <module> with open(PATH_TO_LABELS, 'r') as f: ...
Erwin's user avatar
  • 1
0 votes
1 answer
167 views

Hosting a lavalink server and connecting to it at the same time fails

I am running a discord bot that requires voice commands in my Raspberry Pi 4, and installed OpenJDK 17.0.1 on it. I also used pyenv to install python 3.10 on the Pi, and set the version to be global. ...
LuckElixir's user avatar
-1 votes
1 answer
32 views

Python script started by crontab ends immediately

I'm trying to start a python script using crontab that runs in the background. I want to restart it every few hours, but for now I'm trying to test it every minute to make sure the crontab is working. ...
ad01's user avatar
  • 1
0 votes
2 answers
36 views

Cronjob not executing when raspberry pi reboots

The following is the Python script that I want to execute every time Raspberry Pi reboots. When I run this Python script directly from the terminal it works. Not only does IP gets stored in the file ...
Osama Khalid's user avatar
1 vote
0 answers
51 views

Transmit data from LoRa connected to Raspberry Pi

I am working on a project related to data transmission between nodes and a gateway. Currently, I am using 2 ESP32s and 1 Raspberry Pi 3B+ as nodes, and another Raspberry Pi 3B+ as the gateway. The ...
Hien_lee's user avatar
0 votes
0 answers
29 views

ALSA lib PyAudio Errors with ReSpeaker v2.0 USB Mic Array and Raspberry Pi 4B

I have been having problems using the pyaudio library to access raw audio data from the ReSpeaker Mic Array v2.0 microphones. The example script below is provided from the link above, and it's ...
Cole Sheyka's user avatar
1 vote
0 answers
109 views

Raspberry Pi 4B & ReSpeaker v2.0: PyAudio Errors and ALSA Configuration Issues

OS: Raspberry Pi OS (64 bit) - Debian Bookworm As a forewarning, I am a novice when it comes to IoT projects like this. My purpose is to implement my own custom python script which considers direction ...
Cole Sheyka's user avatar
0 votes
0 answers
54 views

Freezing in Raspberry Pi 3B+

I would like to inquire about the circumstances under which the Raspberry Pi 3B+ may experience freeze when connected to multiple devices via an Ethernet gateway (each of these devices having ...
Hien_lee's user avatar
0 votes
0 answers
115 views

How to enable a fastApi server on startup?

im looking for solution, how to edit some files to specify which bash file (it's called startupScript.sh) should start after booting the device. I'm using bash version, without GUI. But the script ...
M0nk3y's user avatar
  • 1
0 votes
1 answer
48 views

Delay on Raspi about 58 us and 100 us

Does anyone know how to make delay on raspberry pi until 58 us and 100 us? I am using raspberry pi 4B with python language. I want to make code for sending packet data (I will include my code). I'm ...
Naufal Yanu Kusdianto's user avatar
0 votes
1 answer
68 views

Autostart a Python UI to a DSI display

for a little project I have build a Python UI which should autostart on a Raspberry PI4 that has a DSI touch display connected to it. I'm currently running Raspbian on it but that can be changed if ...
Grogak's user avatar
  • 1
0 votes
1 answer
57 views

RPi GPS Hardware for project [closed]

I am thinking about a Rpi project that detects and triangulates radio signals with a directional Yagi Antenna, CMPS14 (to work out which compass direction the antenna is pointing) and a GPS to get ...
Al Grant's user avatar
  • 103
0 votes
0 answers
80 views

How to get TLS 1.3 support in Python3.4 on Raspbian Jessie?

I have some very old Pi 3Bs installed in the field that are running Raspbian Jessie and openssl version 1.0.1t. I believe Buster was the first to include TLS 1.3 and doing an upgrade from Jessie to ...
Pathead's user avatar
  • 283
0 votes
0 answers
27 views

how to start a tkinter GUI before the login window on raspberry pi4 b

I Have a raspberry pi 4B running using Debian GNU/Linux 12. I created an executable file as GUI. I want to start this GUI before the login window appear and when ever the user close it the login ...
georges's user avatar
0 votes
1 answer
32 views

How can I use a RPi interfacing with a Python program to count PWM pulses in the 0-40 khz range?

How can I use a RPi interfaced with a Python program to count PWM pulses in the 0-40 khz range? The Pi would not be generating the pulses. I don't see any similar questions. I am a total newbee to ...
MORTIMER SCHNERD's user avatar
0 votes
1 answer
52 views

Raspberry Pi Sound to Light

So, I am building a Dalek and instead of buying a hardware voice modulator, we have managed to use the Raspberry Pi to take sound from a USB Mic - apply a live sound effect and play the amended sound ...
Bill Harvey's user avatar
0 votes
1 answer
49 views

Splitting a long script out int multiple files

Is there a way to split out sections of a script into a separate files and use something like an include statement to bring that code back into the main script where it is used when running it? The ...
Bam's user avatar
  • 1
0 votes
0 answers
28 views

BlueDot Serial Bluetooth server for OBD

I am building an OBD Raspberry PI car dashboard and I've been struggling to get the adapter to connect and send info. I recently learned that the rfcomm support was dropped years ago by bluez and was ...
Soham's user avatar
  • 1
1 vote
2 answers
52 views

GPIO input pins high at 3V, and detect when ground is connected when I want it to detect when 3V is connected

This is on a Raspberry Pi Zero 2 W The physical pin 3 and 5 (gpio2 and gpio3) are the input pins I am using and for whatever reason, they are at default 3V and detect a change when they are connected ...
prestonferry's user avatar
0 votes
0 answers
35 views

OBD Raspberry Pi bluetooth and serial connections issues

So I've been trying to get my digital dashboard code working and I have to connect to the OBD plug to the Pi but ive run into a plethora of issues since then. The first time I did it, the OBD device ...
Soham's user avatar
  • 1
0 votes
1 answer
159 views

WS2812B LED strip problems

For starters, I'm using a generic 5 meter, 30 pixels/meter, 5V WS2812B LED strip. I've got a 5V/20A (100W) power supply as well. I'm using the adafruit-circuitpython-neopixel library, and my code I've ...
Devin Gardner's user avatar
0 votes
0 answers
72 views

RPi Zero as 4-pin-fan-controller: Faulty RPM readings on open collector with gpiozero

Introduction and Goal Disclaimer: I do not have profound but basic knowledge in electronics and hardware and my python is a bit rusty. For tl;dr, jump to the problem section below. Hello, I'm trying ...
ArmoredGoat's user avatar
0 votes
0 answers
475 views

Issue in installing mediapipe on Raspberry Pi 3B

I am trying to install mediapipe on my Raspberry Pi 3B running Raspbian GNU/Linux 12 (bookworm) on ARMv7 Processor rev 4 (v7l). I have created a virtual environment, venv and already installed opencv-...
Sanskar Omar's user avatar
0 votes
0 answers
114 views

ALSA issue with Raspberry Pi 4b and voice recognition

I get the following error, and it does not return the speech_recognition information: Expression 'GetExactSampleRate( hwParams, &defaultSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: ...
Vector776's user avatar

1
2 3 4 5
65