Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
33 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
54 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
52 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
32 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
53 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
44 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
181 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
86 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
552 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
137 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
0 votes
2 answers
232 views

BME280 sensor: OSError [Errno 5]

I recently bought a Raspberry Pi 4B along with a BME280 T/P/humidity sensor. I use the bme280 and smbus2 Python libraries to interface with the sensor. For a while it worked pretty well, but yesterday ...
MPA's user avatar
  • 103
0 votes
2 answers
100 views

Automatic execution of a Python script using a Raspberry Pi 4

Im programming on a Raspberry Pi 4 and trying to make a python script start automatically, when powering on. The python script is working and has no errors. I tried to insert a starting command in /....
En99's user avatar
  • 13
0 votes
1 answer
216 views

How to selectively read Mifare blocks with an NFC reader?

I want to use a RPi combined with a RC522 NFC reader to make a Mifare card-based authentication system(1). I am struggling with the capacity to read selected blocks of data on the NFC card. I have ...
WoJ's user avatar
  • 543
1 vote
1 answer
186 views

controlling a continuous servo in both directions

I'm using a Fitec FS90R continuous servo with my Raspberry Pi Zero, and trying to make it turn slowly in either direction (it's controlling a small turntable with a display on it). My test script is ...
Lenny's user avatar
  • 11
0 votes
0 answers
11 views

pymodus unknown message

I am using Pymodbus in Raspberry Pi for data acquisition from Modbus rtu (RS485) sensors. Other sensors worked perfectly fine so coding is ok. However one particular sensors is giving me this message ...
Brian's user avatar
  • 1
0 votes
1 answer
318 views

Connecting Two SPI LCD to raspberry pi GPIO pins

I am doing my NEA project right now and I have a problem using 2 TFT LCD. Here are more details about the LCD 2.8" LCD SPI, Driver: ili9341 with touch version 1.2, this a picture of it: I have ...
Mohamed Ahmed's user avatar
0 votes
1 answer
118 views

PWM output frequency incorrect

I am trying to create an accurate PWM output using a raspberry pi, model 4b, and hope you can help. At this stage I am wanting to; change the Duty cycle and frequency, run the code, and see these ...
Ben's user avatar
  • 11
0 votes
0 answers
27 views

Issue with running multiple processes on a single webcam with Raspberry Pi 4

I have a Python program that utilizes threading to run multiple processes on a single webcam. The code works perfectly fine on my laptop, where it can run different processes simultaneously on one ...
JazzSlign's user avatar
1 vote
1 answer
26 views

Sending UDM message from Raspberry via SIM900a GPRS module in python. 1nce provider

I'm trying to send a UDP message via GPRS service from Raspberry but nothing happens. Here is my code. Any advice? Sorry, but this is my first question on StackOverflow. Thanks import time import ...
diego n's user avatar
  • 11
0 votes
1 answer
149 views

Where does Pico micropython print go with main.py?

If you load a main.py file onto the Pico with micropython firmware running, it will run on startup. I can tell that this is working because I observe GPIO outputs changing, etc. However, I'm not sure ...
alex's user avatar
  • 21
0 votes
2 answers
2k views

How to solve segmentation fault error on raspberry pi 4

I am currently trying to use yolov8 to perform object detection on the raspberry pi 4. I have installed ultralytics and other necessary packages but whenever i run the code on the terminal it says &...
Eme Obioh's user avatar
1 vote
1 answer
69 views

How to put Raspberry Pi into shutdown by keypress/hold?

I am running latest retropie on a rpi3b+. I am also using retrogame to map GPIO pins the keyboard keys to arcade buttons. What I would like to do is run the sudo shutdown command if a designated key (...
user76595's user avatar
  • 181
0 votes
1 answer
613 views

Failed to add edge detection - Raspberry Pi 4 GPIO

I am trying to run a LoRa receiver using python from time import sleep from SX127x.LoRa import * from SX127x.board_config import BOARD BOARD.setup() class LoRaRcvCont(LoRa): def __init__(self, ...
Guilherme Gomes Zucco's user avatar
1 vote
1 answer
294 views

Adding a WiFi network with Python over bluetooth

I'm working on a project where a mobile app can find and pair with a headless raspberry pi running Pi OS (Debian Buster Port) over bluetooth, send it an ssid and password and it'll create and hop on ...
bsautner's user avatar
  • 228
-1 votes
1 answer
56 views

Why My Spi Connection Is Not Getting started?

Hello Guys I Am New To Embedded & Rasberry PI. So In Order To Understand SPI Connection I Made An PI-PI SPI Setup PS. I am Using Two Rasbrry Pi Model 4 B with Raspi OS & i did the followings ...
Its_MEDev's user avatar
0 votes
0 answers
590 views

Bleak/Python: BLE filtered scan with timeout, and getting AD data

My task is to scan for x seconds for a BLE device with a specific name or service UUID, then get the RSSI value for returned device(s). Bleak seems to be the best option as far as I can see. I've been ...
ExMarksTheSpot's user avatar
0 votes
1 answer
882 views

Camera Module 3 / PiCamera not working on Ubuntu Raspberry Pi

I have a Raspberry pi 4B with Ubuntu, and I’m trying to use my camera module 3 with python (I’ve tested the code with Raspberry Pi OS, so I know it’s right) using PiCamera and in a virtual environment ...
Flamethrower's user avatar
0 votes
1 answer
977 views

Python PIP not working after upgrade

How do I fix this? I was trying to upgrade my Python to 3.10.2 which works fine. However, pip is throwing errors. These are the steps I followed to upgrade: #Downloaded new version and Extracted ...
CornDevil's user avatar
2 votes
1 answer
398 views

How to create open network for Raspberry Pi Pico using micropython?

I seem so close to getting it working but every route I take just doesn't seem to work. I'm trying to make an access point from my Raspberry Pi Pico with no password. SOUNDS SIMPLE DOESN'T IT. Here's ...
Josh_heritage's user avatar
0 votes
0 answers
81 views

Raspberry Pi 4B - VLC player - Pir Sensor - Camera

I'm starting to know Python, so you can say I'm a newby. For Halloween I'm working with a Python script for a Scare. The idea is to show a nice picture (a paused video) on a tv screen and when motion ...
Wessie's user avatar
  • 1
0 votes
0 answers
64 views

wired connection between raspberry pi and android app

I am reading Can data with Pcan, and I am transferring my Can data to my Raspberry Pi 4. With this code import can import serial # CAN bus setup can_bus = can.interface.Bus(bustype="pcan", ...
Alper's user avatar
  • 1
0 votes
2 answers
440 views

server stuck at socket.accept()

I am trying to establish the connection between my pc (windows11) and rpi 4 (buster v10). I have set rpi as an access point so that it has a fixed ip address, for example, 192.168.20.1 and connected ...
masami's user avatar
  • 1
0 votes
0 answers
72 views

Reading Durations of signal train

I am receiving a signal train of alternate high low pulses and trying to read it on Raspberry Pi Zero W. I have enabled the one wire pin(GPIO-4) and used that pin to read the pulses. I am reading the ...
John Mist's user avatar
0 votes
2 answers
109 views

Why does this GPIO button click run twice if I remove the print statement?

I run this script when the Raspberry Pi boots. When a key is pressed (GPIO 19) the interrupt function gets called. If I remove the print("BUTTON PRESSED") statement on line 10, the interrupt ...
Raed's user avatar
  • 105
1 vote
0 answers
103 views

Desktop Weather Display using Pi-pico-w

I'm trying to replicate this (https://mustardcorner.com/desktop-weather) project but I'm trying to use the Pico w instead of the Pizero w he was using. But the code obviously does not work on the Pico,...
Jesse gudgeon's user avatar
0 votes
0 answers
108 views

I am trying to print "Hello World" 15 times from my Raspberry Pi Pico to a text file on my windows desktop via serial communication

Here is my code: Main.py (PICO code) import time for i in range(15): print("Hello World") time.sleep(1) Windows Desktop Python Code import serial port = "COM5" ser = ...
HEL's user avatar
  • 1
0 votes
1 answer
180 views

How can I monitoring permanently a sepeaker device and always it plays i measure the sound decibels peaks using python

I found this code below and apparently it could solve my problem but how can I modify to observe the speaker device rather than mic? And also appears to me that audioop lib is deprecated in pynthon 3....
wmendes's user avatar
-1 votes
1 answer
130 views

Multiprocessing to speed up data acquisition for I2C devices

Here's my situation: I have four FDC1004 devices that I want to have connected to an array of 64 electrodes through four ADG1206 16:1 multiplexers. Each device is slaved to a pi4 using separate I2C ...
Dallon Penney's user avatar
0 votes
0 answers
40 views

IR Remote POWER event when using EVDEV library

I have a python script that handles IR remote events using the EVDEV library. The problem I have is that the when debugging the KEY_POWER event code, it completely powers down the PI. Ideally, I want ...
Dave's user avatar
  • 101
0 votes
1 answer
105 views

Open CV threading to get frames

I am working on a project for which I need run 3 threads in python. 1 for getting frames and the other 2 for proccessing them. I don't know how to pass variables between threads (I want to pass frames ...
Overclocker.py's user avatar
0 votes
0 answers
29 views

DS18B20 not detected on Raspberry Pi [duplicate]

In ls /sys/bus/w1/devices/ I only have w1_bus_master1 I have added w1-gpio and w1-therm in /etc/modules I have also added dtoverlay=w1-gpio in /boot/config.txt I am not sure what is wrong. The RP 4 ...
Alex's user avatar
  • 1
0 votes
1 answer
108 views

did I fry Raspi I2C pins?

So I wanted to test a sensor I have on the pi, the sensor has on-board level switchers supports both 5V and 3.3V with a 10k pull-up resistor for both SCL/SDA, Mistakenly I wired the Vin into the 5V ...
Zak's user avatar
  • 11
0 votes
0 answers
58 views

How can I make some videos in the GUI that was designed using qt5 run in a loop?

I have some videos in a GUI that plays when certain conditions are met. The problem I have is that I am unable to make the videos start again after they end. Here is the code for the UI: import os ...
Shamooooot's user avatar
0 votes
3 answers
834 views

How can I run at boot or autostart an app with GUI?

I have a python script with a GUI that was designed with qt5, the script runs fine whenever I run it through the terminal or Thonny IDE. But no matter how much I tried, after trying many guides, ...
Shamooooot's user avatar
2 votes
1 answer
140 views

Where does the normal terminal output go to when a script is started by init.d?

I've a Python script which runs OK manually. I've started it on boot init.d. It runs, but exits. Can you tell me where the normal terminal output goes in this case? There's debug output I've sent to ...
KDM's user avatar
  • 718
1 vote
1 answer
41 views

Using init.d to Start Script Driving Hardware PWM

I'm using init.d to start a Python script on boot. The script employs hardware PWM. When I run the Python manually as the pi user, it works fine. When I start the script manually, calling the daemon ...
KDM's user avatar
  • 718
0 votes
0 answers
144 views

How would I connect and control this linear actuator to my raspberry pi 4 b+

So I have 2 questions for you guys, girls, or whatever you may be, this is the actuator I am planing on buying: https://www.robotshop.com/products/kitronik-linear-actuator-micro-servo-kit?...
Anthony Kercher's user avatar
1 vote
2 answers
1k views

How to set Hardware PWM Pins

I need a fairly deterministic PWM duty cycle. I don't believe it's rocket science to use hardware PWM. Numerous sources tell us that we can modify /boot/config.txt by adding dtoverlay=pwm-2chan which ...
KDM's user avatar
  • 718
0 votes
0 answers
102 views

photogrammetry solutions for raspberry pi 4

Question: What open source and automatable software solutions for photogrammetry with Raspberry Pi 4 are available? What are their features, strengths, and weaknesses? I am not averse to using ...
Dizzixx's user avatar
  • 101
0 votes
0 answers
79 views

Raspberry Pi Pico accurate sunrise time

Is there a way to access or calculate sunrise and sunset times according to latitude and longitude with a raspberry pi pico ? I can do it with my raspberry pi 3b+ and astral but astral doesnt seem to ...
Coder's user avatar
  • 19

1
2
3 4 5
66