Questions tagged [python-3]

Use this tag when referring to the Python 3 language. This can include discussions about specific features unique to the language or perhaps when referring to software that requires Python 3 in order to function. Note that general programming questions are often better suited to Stack Overflow; use this tag only where directly relevant to the Pi.

Filter by
Sorted by
Tagged with
0 votes
1 answer
17 views

SOLVED — Running Python script in /etc/rc.local as user with dependencies (file not found)

I have a small code that reads lines from a local text file (MyText.txt) and prints them to an OLED display SS1315 SPI with Raspi Zero headless. All is working fine from the command line and would ...
0 votes
0 answers
17 views

How to display out image data to HDMI LCD after some image processing on Raspberry Pi?

I am using RaspberryPi where I need to do some image processing on image data (receiving through USB from USB camera) and display it to HDMI LCD. how can I implement this as in python script on ...
0 votes
0 answers
16 views

Program stops running midway using OpenCv

Good evening. I wanted to track hand and body movements on my Raspberry Pi 2B (Debian 10 Buster), however, I keep getting this error in Thonny IDE: Backend terminated or disconnected. Use 'Stop/...
  • 1
0 votes
1 answer
23 views

Exposure time in PiCamera not working

I am trying to take a long exposure image (30 sec+) in python using a RPi HQ camera (https://raspberry.piaustralia.com.au/products/raspberry-pi-hq-camera and the PiCamera module). This is my code: ...
  • 1
0 votes
0 answers
24 views

raspistill taking long time to respond

I am trying to make a long exposure time lapse camera using a RPi HQ camera and RPi zero W, in python. The code for my camera is (for a 30 sec exposure time): import subprocess filename = str(input(&...
  • 1
0 votes
1 answer
22 views

'/dev/v4l-subdev1' node not created anymore for 16 MP Arducam with autofocus (IMX519 based) with Rpi 4B

/dev/v4l-subdev0 and /dev/v4l-subdev1 nodes used to be created before when booting up the Rpi with the ArduCam plugged in (via MIPI CSI-2 port). Now only /dev/v4l-subdev0 shows up, and I'm not sure ...
0 votes
1 answer
23 views

why GPIO does not work when executed from python shell but works from script

When I run this python script led.py it works. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) GPIO.setup(24,GPIO.OUT) print("LED on") GPIO.output(24,GPIO....
0 votes
0 answers
36 views

Replace a KeyboardInterrupt with a button press to stop a continuous recording

I am trying to use the following code to act as the recording module for a wedding guest phone, I plan to run this script from one that will sense when the handset is lifted, play a message, and then ...
0 votes
1 answer
36 views

Record audio whilst pressing a button in scipy

I am trying to make wedding guest answer phone for my sister. The basic idea of these things is you pick up the handset, hear a message from the host, leave you own, replace the handset, and the ...
0 votes
0 answers
19 views

WorldTimeApi client_ip

I am trying to use World Time Api to get the ip address assigned by my ISP. In Micro Python on an RPi Pico W my_ip = json["client_ip"] returns an ipv4 address and in Python3 on a RPi 4B it ...
0 votes
0 answers
26 views

Activate or disactivate GPIO with another computer (with python)

I am doing a project and I tried to use my raspberry pi's gpio with another computer. I want that my computer send to the raspberry pi a signal with wifi (my raspberry pi is a local server) to ...
0 votes
1 answer
44 views

Raspberry pi 4 is not booting with Disk image that is working on Raspberry pi2

I am new to this project. The project was developed in 2015 using Raspberry pi2 and a 7' touch display. The disk image works perfectly on Raspberry pi 2. I tried to flash the disk image to an SD card ...
  • 1
0 votes
0 answers
23 views

python3 Gtk & WebKit2 script taking too much CPU

I'm running Buster on a pi4 with 2GB of ram and a python3 script to load some web scripts and I noticed the CPU usage was 99%, I can't figure out why. import gi gi.require_version('Gtk', '3.0') gi....
  • 101
2 votes
0 answers
45 views

How can I get my python program that uses the requests library to run on boot via the crontab

I am working on creating a python script to retrieve data from a server using the requests library, and then display it on an adafruit led matrix using a raspberry pi. I have a program that functions ...
  • 21
0 votes
0 answers
37 views

why i can't run use command python3 but it work on thonny python

it work here but it get erro when i use commend. this erro that i get 192.168.247.109 - - [15/Jul/2022 19:46:59] "GET / HTTP/1.1" 200 - OpenCV Error: Assertion failed (!empty()) in ...
0 votes
1 answer
48 views

I2C communication on Raspberry Pi 3B using smbus2

I'm trying to connect my energy measurement IC with Raspberry Pi 3B using the I2C protocol. I'm using sudo i2cdetect -y 1 to detect the connected devices and it is correctly showing the address(7-bits)...
1 vote
0 answers
36 views

Why can’t I print to this thermal printer on this python print server?

I'm trying to run a python based print server, based on these instructions, and this code. I have the print server running on a Raspberry Pi Zero. I assume the print server is working correctly, as ...
  • 158
0 votes
0 answers
35 views

Raspberry Pi4- Dual HDMI -fbi

I am trying to display tkinter GUI on raspberry pi touch screen which is on hdmi0 and project the images using projector on hdmi1. But when I click the button to project image ie when I execute the ...
0 votes
0 answers
35 views

Python 2.7 and 3.x coexisting in harmony?

I'm on an RPi4 running the 64-bit version of Raspbian and want to have 2.7 and 3.x coexisting with NO problems. 3.x is part of the 64-bit Raspbian when installed. I just installed 2.7 (i.e., sudo apt ...
  • 131
0 votes
0 answers
81 views

Problems with three USB cameras using OpenCV

I am currently working on a project with a Raspberry PI 3 b+. The idea is to film a surface with 3 USB cameras to locate objects. To test if my setup works, I wanted to stream their content to three ...
0 votes
0 answers
119 views

Help! GSM/GPRS/GNSS HAT - SIM 868

have be struggling for a while with this bit of Python. I have not wrote this code it got installed with the the tracker from this website (https://medium.com/@onehitwonder/how-to-build-a-raspberry-pi-...
1 vote
0 answers
65 views

Problem with reading GPIO input value - photoeletric sensor

Good night! I've got some problems with GPIO input values in my code (Python). I'm using a Raspberry Pi model 3, and RPi.GPIO as GPIO module. I'm tring to get the signal values of a photoeletric ...
1 vote
0 answers
140 views

Need to take a screenshot headless

I have a weather station and take a screenshot of a webpage (windy.com) once an hour to integrate into my display which runs on a Pi 3 It was working perfectly until I had an SD card crash and had to ...
  • 11
2 votes
1 answer
191 views

Controlling stepper motor with Raspberry pi

I am building a sorting machine for a project where I want to sort the balls based on their color. For the actual sorting mechanism I am using a stepping motor (NEMA 17 with Driver DRV8825). I ...
0 votes
1 answer
195 views

reading two webcams in opencv

If I run this code on a PC with two webcams attached it runs fast (or fast enough) without any issues: import cv2 cap0 = cv2.VideoCapture(0) cap1 = cv2.VideoCapture(1) while True: ret0, img0 = ...
  • 51
0 votes
1 answer
52 views

Talking to MAX31865 from Raspberry Pi using Serial Peripheral Interface

I am trying to talk to the MAX31865 board from a Raspberry Pi over SPI but am not getting the results I'd expect. Can someone with more SPI experience take a look at my setup and point to what I may ...
0 votes
3 answers
261 views

Python script stops mysteriously after a few hours

The Problem I have a raspberry pi 3b+ running a python 3.7 script that is controlling an arduino. The arduino is reading values in from a few different sensors, and sending the data back to the python ...
0 votes
0 answers
74 views

How to controlling a mouse with a joystick and button using python, gpiozero

I am trying to use the GPIO pins from my raspy berry pi to control my mouse I have a joystick connected to these gpio pins pin 24 - mouse up pin 25 - mouse down pin 5 - mouse left pin 6 - mouse right ...
0 votes
1 answer
36 views

Why can't Pycharm find remote python3.9?

I am using pycharm for remote development with rpi3, when I try to run my code I get the error from pycharm that it can't find a file: (IGNORE the X) Error running 'test': Cannot run program "...
0 votes
0 answers
225 views

RPI USB Camera stops sending images, times out, and fails to work

TL;DR - My camera on my Pi stops working all together after an hour-ish. Any ideas why would be a big help. I'm running a camera on my RPI which times out after a while and even if I try to do a USB ...
  • 101
0 votes
2 answers
71 views

Cronjob Raspberry Pi not working

I am trying to use my raspi to host a discord bot that every morning publishes the food in my school. I have setup a bronjob with crontab -e but it's not working. Crontab lookis like this: 45 07 * 2-5 ...
0 votes
0 answers
21 views

Python IDLE behaves differently in Windows and Raspbian

I have an developed an application in windows. The application is used to read some data from the sensor, process it and display it in GUI. When the application is running the python shell is not ...
0 votes
1 answer
554 views

How to communicate between multiple Raspberry Pi using Python

I am looking to buy some Raspberry Pi computers to do various tasks. For example, maybe one could water a plant when requested. The part I am struggling to find help with is creating a server where a ...
1 vote
0 answers
90 views

librosa on a raspberry pi

I have a problem with librosa installation on raspberry pi. I followed the instructions from the comment @Austin from: Unable to pip install librosa in raspberry pi 3 model b+ (Raspbian stretch) I ...
  • 21
0 votes
2 answers
58 views

Using multiple LDRs and capacitors with Raspberry Pi 3B +

I am pairing an LDR with a capacitor to to make a light sensing project by returning the value of the variable COUNT when the capacitor is charged. But when i do this with 2 or more LDRs the values of ...
  • 1
0 votes
0 answers
207 views

ftd2xx python library doesn't work in raspberry pi

I have installed Raspberry Pi OS with desktop and recommended software(bullseye). I tried pip install ftd2xx. The installation was complete. I have used the library in windows and developed an program....
0 votes
0 answers
24 views

Intermittent problem with HQ camera

I am using PiCameraX to gather Bayer level images repeatedly using an HQ Camera. Every so often it fails in the following way, and I'm struggling to see what is wrong. The camera is working fine ...
  • 101
-1 votes
1 answer
70 views

Analog audio out when starting from /etc/rc.local

I am working on a python program that I am having some issues with. When the user presses a button a video starts playing. I need the audio to come from the analog jack. It works perfectly when I run ...
0 votes
1 answer
455 views

NameError: name 'I2C' is not defined (Raspberry Pi 4 Model B - Ubuntu 18.04 - adafruit_lidarlite)

I am getting an issue while trying to use the library "adafruit_circuitpython_lidarlite". Below are the details of my environment: 1- Distributor ID: Ubuntu (ubuntu-18.04.5-preinstalled-...
  • 101
0 votes
0 answers
22 views

InValid CAN packets Observed RPI 3B+

RPI 3B+ connected with HAT consisting of CAN Transceiver. CAN interface is enabled and configured and link is UP. I'm using bus.send(msg) and bus.recv() functions to transmit and receive can packets. ...
0 votes
0 answers
73 views

Microphone Recordings Differ Randomly using PyAudio on Pi 4

I have implemented an acoustic-based anomaly detector in a manufacturing environment (with a noisy background) using a Thronmax M8 USB Microphone (Link) connected to a Raspberry Pi 4. Here are details ...
0 votes
0 answers
257 views

Openpyxl Python Module Downloaded but Not Working

I have downloaded the Opexpyxl Module with sudo pip3 install openpyxl and it says Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Requirement already satisfied: openpyxl ...
2 votes
1 answer
1k views

Fullscreen GUI App on Raspbian startup

i'm working on a Simple DIY Home Control project Language is Python, and GUI is PyQT5 The project is just some ESPs connected to a main Raspberry Pi (3B+) controller The problem is that I'm trying to ...
0 votes
0 answers
49 views

Raspberry PI 4 SQL Database receiving old data

Im having a strange issue. I have always connected to a DB at the start, then querried as needed. However for some reason if I have my database connection outside my loop I am not reading in the ...
0 votes
1 answer
220 views

How to enable SPI and access RFID RC522 Chip on Alpine Linux

I've set up Alpine on a Raspberry Pi 3B in diskless mode and it runs exceptionally smooth. I've managed to address GPIO pins (e.g. to read from temperature sensors) without much effort. Now I'm trying ...
1 vote
1 answer
51 views

pigpio Not allowing simultaneous waveforms on separate GPIOs

I am trying to send a set of pulses equally spaced to 4 stepper motors drivers (on different GPIOs) at the same time. These pulses I am wanting to be around 10 microseconds in width so more precise ...
0 votes
0 answers
36 views

GPIO readout from Geiger Müller board is low when it clicks

I am using a RPI 3b and this board. I setup everything according to this guide. It's also my first RPI project so maybe I am missing something. The code I am running: import RPi.GPIO as GPIO GPIO....
  • 101
1 vote
2 answers
225 views

Thermal mini printer receipt adafruit printing gibberish

I have written a very simple program in python to print the text value in the mini thermal receipt printer adafruit. Code: # On a CircuitPython microcontroller: import board import busio import serial ...
  • 173
0 votes
0 answers
27 views

pause raspberry pi 4 taking input from MFRC522 while the video is playing

The cards have video file names written to them. When a card is placed on the MFRC522 sensor, the video is played. Now, I am unable to figure out how to stop or pause the raspberry PI from taking the ...
0 votes
1 answer
128 views

How to use multiple HC-SR04 distance sensors

For a project I need to use many distance sensors HC-SR04 using less pins possible of a Pi Zero W. I was able to do a test program in python3 with one sensor connected using gpiozero library and it ...

1
2 3 4 5
12