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
2 answers
21 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
0 answers
18 views

How can I analyze the video streaming from a Raspberry Pi Camera Module 3 on a Raspberry Pi 4 using Python, preferably? [closed]

I have a Raspberry Pi 4B and Camera Module 3, which I want to use for analyzing activities on a factory floor. Currently, I can only record videos and take images using this setup. I am interested in ...
Skywalker's user avatar
  • 111
0 votes
0 answers
16 views

Weather Station with Python Integration for Raspberry Pi Zero 2W and Remote Data Access [closed]

I'm on the hunt for a weather station that can send data to an rpi zero 2 w, ideally wirelessly. Here are the key aspects I'm looking for in this weather station: The weather station should be ...
Jake's user avatar
  • 9
1 vote
0 answers
28 views

Why is my I2C bus flooded with messages?

I have a Rasberry Pi 4 connected to a Teensy LC (similar to arduino) with an I2C bus. The bus has been working properly with other code, so I believe the connection probably isn't the problem. I am ...
Phi's user avatar
  • 11
0 votes
0 answers
18 views

Gpredict and Hamlib's rotctld problem. AZ & EL reads error message in Rotator controll section

I'm trying to build an automatic tracking system to track CubeSats with my Raspberry Pi 4B using GitHub Python code to emulate the Yaesu GS-232B and Gpredict via TCP 4533 to control a future Yaesu ...
ed190's user avatar
  • 1
2 votes
1 answer
46 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
21 views

pymodbus issue in in raspberry pi 4B

Please note that i am initialising my coding as below import pymodbus import serial from pymodbus.pdu import ModbusRequest from pymodbus.client.sync import ModbusSerialClient as ModbusClient #...
Brian's user avatar
  • 1
0 votes
0 answers
18 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
35 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
-1 votes
0 answers
55 views

Raspberry Pi 4 with Relay. Monitor blacks out when switch turns on

I have a Raspberry Pi 4, a 5V 4-Channel Relay Module, a 5V power supply (for Pi), a water pump, and a separate 5V power supply (for water pump). The circuit is set up as follows: For additional ...
Yusuf Khan's user avatar
0 votes
1 answer
38 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
61 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
60 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
53 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
45 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
98 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
0 votes
1 answer
46 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
26 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
0 answers
25 views

Audio popping/crackling when playing via Python - Raspberry Pi 4

Currently I have a pair of speakers connected to my Raspberry Pi 4 via the 3.5mm jack. The speakers are powered by USB, but I'm using a wall adapter to power them rather than using the Pi to power ...
fancyshark's user avatar
0 votes
1 answer
36 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
28 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
79 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
29 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
1 answer
34 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
94 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
  • 698
1 vote
1 answer
26 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
  • 698
0 votes
0 answers
54 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
145 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
  • 698
0 votes
0 answers
45 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
44 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
  • 11
0 votes
0 answers
29 views

How to modify Pi Camera sensor size?

I have an Arducam 5MP autofocus camera (OV5647), which I believe is almost identical to the Pi Camera V1, but with a motorized lens for focusing. https://www.arducam.com/product/raspberry-pi-camera-...
F16Falcon's user avatar
  • 101
0 votes
1 answer
206 views

Picamera2 raw capture limited to 15 FPS

I have a Pi 4 with the High Quality Camera. I'm trying to capture raw frames with Picamera2 using the camera's 2028x1520 2x2 binning mode. I'm using camera.sensor_modes[2], which says it has a maximum ...
LostXOR's user avatar
  • 111
0 votes
0 answers
158 views

Python serial communication and run minicom command?

Right now I am working on RPI 4, and connect UWB sensor to RPI through USB port To run sensor, I need to type in terminal minicom -D /dev/ttyAMC0 mincom will pop out. Then, I need to press enter ...
Jiyong Kwag's user avatar
0 votes
2 answers
66 views

SPI clock is not switching on RPi

I need to use SPI for a project I'm working on with a Raspberry PI, but the little bit of test code I wrote doesn't seem to work. #test program for spi import spidev import RPi.GPIO as GPIO from time ...
AMacDonald's user avatar
0 votes
1 answer
39 views

Read Location from SIM868 while using as PPP(Modem Mode) on Raspberry

I trying to get device location using linked sim868 shield on Raspberry 3A+. State: I have got successfully get device location with AT+ commands via UART protocol using Python. State: I have got ...
yasintuncel's user avatar
0 votes
0 answers
43 views

Raspberry Pi HQ Camera: Capture NEF or DNG?

I'm making a raw capture tool for raspberry pi and the official HQ camera. I can't seem to get RAW DNG or TIFF images, whatever I do. Here's my current code: from picamera import PiCamera print('...
N3RDIUM's user avatar
  • 113
0 votes
0 answers
18 views

Problem Using Python CAN with Pi Can 2 Hat

I hope to find some answers here regarding a program of mine that doesnt seem to work! It is a modified version from https://rb.gy/blrhk . I am using the RPi in conjunction with an arduno uno with a ...
Paul Boutsiadis's user avatar
0 votes
0 answers
28 views

Audio output not working with cli

I am using Raspberry pi OS with raspberry pi 4. I have an application which uses playsound with python to play an audio file created by gTTS library. I am using a usb sound card card 2 which has a ...
NINJA's user avatar
  • 1
0 votes
0 answers
27 views

How can I keep a VNC session running when not connected to it?

I'm running a scraping bot with selenium, and to get results as stable as possible I'm running a chrome instance from a VNC desktop and then attaching selenium to it ; it's not headless and allows me ...
ouai's user avatar
  • 1
0 votes
0 answers
36 views

web page show GPIO pin status (on or off) automatically

How do I read a raspberry pi GPIO pin value and say show a red or green button on a web page reflecting the pin's current status, and have this automatically update when the GPIO pin's state changes?
smclaugh5's user avatar
1 vote
3 answers
107 views

errors trying to import numpy on rasperry Pi 4 B

I am using the most recent version of Rasperry Pi's OS on a Pi 4 model B. Apparently the version of python that comes with the OS is 3.9. I'm not sure if Numpy comes with it or that I installed it ...
sumabeach's user avatar
0 votes
1 answer
116 views

Selenium on raspberry pi zero 2w

I've been trying to run selenium webdriver on raspberry OS. Basically what I did: pip3 install selenium sudo apk-get install chromium-chromedriver And run this script: from selenium import webdriver ...
sadxd's user avatar
  • 1
0 votes
0 answers
29 views

Unable To Make MicroServo99 SG90 spin with raspberry pi

I am having an issue with my raspberry pi and making it spin a motor with python. I am currently using a battery connected to a PCA9685 16-Channel 12-bit PWM driver which connects my motor on channel ...
TheCrazyCreeper's user avatar
0 votes
0 answers
25 views

Tkinter based UI in yocto has only one font size

I have a python 3 app with a TKInter interface. Very simple UI, there are 4 frames each with a headline (big text) and a status (small text). It works well on my Ubuntu 22.04 desktop. fr = Frame(root, ...
foreverska's user avatar
0 votes
1 answer
84 views

can't send spi message: Invalid argument

I'm using the SPI library SPI-Py with MFRC522 RFID Library. I'm getting this error when I run REad.py. This issue is related to the SPI-Py library can't send spi message: Invalid argument I have ...
niranjan's user avatar
0 votes
0 answers
54 views

Need help with Raspberry Pi camera - mmal error

Hello Raspberry Pi community, I'm reaching out for assistance with a recurring error related to the Raspberry Pi camera module. so it showing this error: ###############################################...
ms pi's user avatar
  • 1
0 votes
0 answers
59 views

Stepper motor control with RPi 3B+

I want to control 2 stepper motors with RPI. I wrote a loop with HIGH, LOW and delay. When I increase the speed the waveform changes and the driver(Rtelligent R86) stops the motor (NEMA 34). The ...
Ray Saben's user avatar
0 votes
0 answers
62 views

i2c LCD Backlight

I have an LCD display that has a backlight (since when I plug it in it lights up). However, using the code below I cant get it to turn on. Any help would be greatly appreciated import smbus import ...
Amanda_Sterling's user avatar
1 vote
0 answers
89 views

How do I run a python script that polls for user input on boot?

I'm reasonably familiar with software, and wanted to help my friend with their cosplay project, which was using this RGB matrix and toggling between different images using this mini three-key keyboard....
Calvin Godfrey's user avatar
1 vote
1 answer
78 views

Can't play song on startup using Python and rc.local

I have a python app called main.py, that runs upon startup using rc.local. During this app's runtime, it runs an external bash script 'play.sh' that runs vlc to play a song. The code in the 'play.sh' ...
Dave Listman's user avatar

1
2 3 4 5
64