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
0 answers
25 views

How to open website with Python with 'sudo' permission?

I am writing a Python script to run on Raspbian that opens a webpage using webbrowser.open() and also writes to the GPIO pins to control some external LEDs. The problem is that writing the GPIO pins ...
user avatar
0 votes
0 answers
9 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 ...
user avatar
-1 votes
0 answers
25 views

Running a parallel buzzer function

FIXED: I didn't know how global variables work, had to specify that "warning" is global in each function. I am making a camera that is looking for red objects and when one is detected, the ...
user avatar
0 votes
0 answers
32 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 ...
user avatar
  • 131
0 votes
0 answers
22 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 ...
user avatar
0 votes
0 answers
40 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-...
user avatar
1 vote
0 answers
62 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 ...
user avatar
1 vote
0 answers
51 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 ...
user avatar
  • 11
1 vote
1 answer
85 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 ...
user avatar
0 votes
1 answer
69 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 = ...
user avatar
  • 51
0 votes
1 answer
29 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 ...
user avatar
0 votes
3 answers
84 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 ...
user avatar
0 votes
0 answers
47 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 ...
user avatar
0 votes
1 answer
28 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 "...
user avatar
0 votes
0 answers
91 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 ...
user avatar
  • 101
0 votes
2 answers
50 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 ...
user avatar
0 votes
0 answers
19 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 ...
user avatar
0 votes
1 answer
125 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 ...
user avatar
1 vote
0 answers
60 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 ...
user avatar
  • 21
0 votes
2 answers
52 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 ...
user avatar
  • 1
0 votes
0 answers
108 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....
user avatar
0 votes
0 answers
20 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 ...
user avatar
  • 101
-1 votes
1 answer
47 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 ...
user avatar
0 votes
1 answer
298 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-...
user avatar
  • 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. ...
user avatar
0 votes
0 answers
45 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 ...
user avatar
0 votes
0 answers
150 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 ...
user avatar
0 votes
1 answer
437 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 ...
user avatar
0 votes
0 answers
30 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 ...
user avatar
0 votes
1 answer
159 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 ...
user avatar
1 vote
1 answer
40 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 ...
user avatar
0 votes
0 answers
31 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....
user avatar
  • 101
1 vote
2 answers
152 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 ...
user avatar
  • 163
0 votes
0 answers
24 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 ...
user avatar
0 votes
1 answer
105 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 ...
user avatar
0 votes
0 answers
27 views

Tkinter's 'create_text' inconsistent between raspberry pis

This one has me completely stumped, hoping someone can point me in the right direction! Here's my MRE of the issue: from tkinter import * root = Tk() w = 200 h = 200 c = Canvas(root, width=w, ...
user avatar
1 vote
0 answers
38 views

GPIO9 Input Always Active

Porting an application from a RPi 3 to an RPi 4 that requires several button inputs. All are working properly, except the button in GPIO9 (Pin 21) is always high/true. Guessing this has to do with SPI ...
user avatar
1 vote
3 answers
683 views

problems installing deepspeech on a pi 4

Ive been trying to get Mozillas deepspeech installed but i keep running in to the same problem. here is the terminal output pi@raspberrypi:~/dev/deepspeech $ pip install deepspeech Looking in indexes: ...
user avatar
1 vote
1 answer
965 views

Pi Camera 1.3 not detected despite v4l2-ctl listing it

Before you say that I haven't searched the internet, whenever I type "pi camera not detected" I literally don't see a single unclicked result. I am slowly breaking apart. PI 4 (8gb), V1.3 ...
user avatar
0 votes
0 answers
38 views

How to setup webserver?

Good day, I know this has been asked A LOT, but everything I've tried doesn't work at all. I've tried using Geany and python code to create the webserver as well as apache2, but neither of them work. ...
user avatar
  • 13
0 votes
1 answer
23 views

RF433 Rpi Serial cannot read signals in Python

I am running this code. import serial import time serialport = serial.Serial('/dev/serial0',baudrate=1200, timeout=3) t = "ttt" while True: serialport.flush() serialport.write(t....
user avatar
  • 121
0 votes
0 answers
74 views

Unable to open pycharm on raspberry pi 4

when i type ./pycharm.sh in terminal it throughs the following error: "Error occured during intialization of VM java/lang/ClassFormatError: Unknown constant tag 101 in class file java/lang/...
user avatar
  • 19
-1 votes
2 answers
481 views

How can I resolve this error? SSLError("Can't connect to HTTPS URL because the SSL module is not available.")

I can't figure this out. I've now researched and tried for hours but I can't solve this so hear me out. I have a Raspberry Pi 3 B+ and installed Raspbian OS on it. Raspbian came with Python2.X and ...
user avatar
  • 1
0 votes
0 answers
475 views

picamera: Incorrect buffer length error when resizing in picamera.capture

I am trying to use picamera to record and save a high resolution video, and capture low resolution images for processing using openCV. import picamera import picamera.array import cv2 import numpy as ...
user avatar
  • 1
0 votes
2 answers
187 views

Pyserial, Python3, and RPi not working together

I'm trying to get a TTY to USB converter hooked up with my Raspberry Pi. I'm using Pyserial to setup the connection and write data to the port in a script called pc_test.py. For some reason the script ...
user avatar
  • 3
0 votes
0 answers
53 views

Not Able to Change Volume with Cron (tried Python)

Alright, I've been trying this for several days and I'm just dying here... I am putting together a kiosk that should play video. I'm using a NUC with Raspberry Pi Desktop. Everything works but ...
user avatar
0 votes
1 answer
144 views

Raspberry Pi 4 b+ with SIM900A Module Error

I'm working on a project that includes send a SMS message. I have tried connecting my raspberry pi with sim900a. Having problems with communication with sim. I've tried using AT commands with minicom ...
user avatar
1 vote
1 answer
208 views

Raspberry Pi Zero W taking 38 seconds to boot, how can I speed it up?

I'm using Crontab to start a python file with the code: @reboot sleep 5 && Sudo python3 /home/pi/file.py The file uses the internet to retrieve some JSON data and display it on a screen ...
user avatar
  • 115
0 votes
0 answers
48 views

How to control door opener from raspberry pi?

I am trying to control a 6V DC door opener which requires 660 mA current supply. Since the Pi only tolerates a maximum of 5V without a relay. As per my research I need a solid-state relay with ...
user avatar
  • 1
5 votes
1 answer
153 views

raspberry pi 4 using SPI 4 & 5 at the same time causes kernel oops and crashes the whole system

intro i want to use multiple SPI busses at the same time. but when i use to use SPI 4 and SPI 5 at the same time it crashes the whole system it doesn't crash instantly sometimes it takes 10 seconds ...
user avatar
  • 51

1
2 3 4 5
12