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
16 views

Send data from FPGA to Raspberry Pi 4 B using USB and implement GUI in RPi to plot the data [closed]

I am new to Raspberry Pi as well as FPGA I have some data coming from ADC to be loaded into SDRAM of FPGA and then that data is to be send to Raspberry Pi 4 B over USB for plotting in the GUI created ...
0 votes
1 answer
17 views

Python requests is too slow with certain WI-FI connection

I'm working on a TTS app using AWS Polly in Raspberry PI 3 B+ and when I post a text using Python requests it take a long time receive the response, around 16-17 seconds. This happens only with a ...
  • 111
1 vote
0 answers
25 views

Tkinter GUI not starting on boot with ROS

I'm trying to launch a tkinter GUI I made that is used to read GPIO pins as well as some ROS topics. I'm using Buster 10 and ROS Melodic with Python 3.7. I am using Clearpath's robot_upstart package ...
  • 11
1 vote
1 answer
48 views

2 motors on L298N controlled with GPIO from Rpi3B .. python telling me channel already in use and motors not turning

I have adopted Electronics hub tutorial to run 2 motors from a L298N controlled by Rpi3B using GPIO. Why is my version of the code not working? I do understand that I could ignore the "channel ...
  • 13
0 votes
0 answers
19 views

LoRa HAT communication module don't send anything

I'm working now an long range communication system, and I need help. I can't use GSM, WIFI, etc. I test one LoRa Raspberry pi shield, and I bought this: link, and I have followed this tutorial. Ofc I ...
  • 1
2 votes
1 answer
32 views

Raspberry Pi 4 Python not finding installed libraries

I trying to connect an OpenCV OAK-D to an R Pi 4B. I've downloaded & installed all the requirements & installed the depthai library using pip To check its there, pip3 list | grep depthai ...
  • 147
1 vote
1 answer
50 views

How to get measured(analog/digital) output from 801s vibration sensor? [closed]

I have Rpi3B+, 801s vibration sensor and a ADC. I need the analog output to plot a graph for analysis. Basically I need to observe how vibration is affecting the other properties of the machine. ...
0 votes
2 answers
45 views

How to programically detect if display is plugged in to GPIO

I've attached an ePaper display to a GPIO bonnet/HAT and have set up cronjobs to run scripts that print data onto ePaper display. If I remove the HAT and display, then how to check if it's plugged in? ...
  • 11
1 vote
1 answer
189 views

(raspberrypi) ImportError: Unable to import required dependencies: numpy

I use raspberrypi 4 ; 32 bit, linux run python error occur: ImportError: Unable to import required dependencies: numpy Original error was: libcblas.so.3: cannot open shared object file: No such file ...
  • 133
1 vote
0 answers
56 views

(Raspberry Pi 4 and Python) Raspberry Camera mode raise picamera.exc.PiCameraMMALError and picamera.exc.PiCameraError

System: Raspberry Pi 4 model B, use external USB Logitech camera I'm follow the youtube tutorial but get picamera.exc.PiCameraMMALError andpicamera.exc.PiCameraError Relate discussion on other site ...
  • 133
1 vote
1 answer
499 views

Trouble using Tensorflow: SyntaxError

I'm trying to use the LSTM neural network found here on my Raspberry Pi 4 Model B https://machinelearningmastery.com/text-generation-lstm-recurrent-neural-networks-python-keras/ I have trouble running ...
  • 23
1 vote
1 answer
42 views

How to give Ownership to Pi from root to Mount_Folder

Here is my workflow and the issues I want to fix. First I mount the windows shared folder on Raspberry Pi. But in order to use that, I have to mount using sudo. sudo mount.cifs //<hostname or IP ...
1 vote
1 answer
58 views

Raspberry Pi spidev CLK working but no signal on MOSI

I have a Raspberry Pi Zero W that uses this LCD screen, including its touch interface using SPI0. What I am trying to achieve is to add another SPI device that uses SPI0. I am able to successfully ...
0 votes
0 answers
67 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
1 vote
1 answer
68 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: ...
  • 11
0 votes
0 answers
30 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(&...
  • 11
0 votes
1 answer
99 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
39 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
114 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
136 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
24 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
27 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
62 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
30 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
47 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 ...
  • 31
0 votes
0 answers
72 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
123 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
99 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
71 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
49 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 ...
  • 141
0 votes
0 answers
162 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
194 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
68 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
271 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
281 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
448 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
88 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
700 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
157 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
55 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
331 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
101 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
23 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
962 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
152 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
65 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
1 vote
0 answers
303 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
29 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
98 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 ...
-1 votes
1 answer
602 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-...
  • 99

1
2 3 4 5
12