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
99 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
51 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
84 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
23 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
40 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
45 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
54 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
376 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
205 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
30 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
37 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
114 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
77 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
104 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
91 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
116 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
121 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 vote
1 answer
120 views

How to program remotely on horribly slow Pi-2

I have an old RPi 2 B which I've loaded the latest version of Raspberry Pi OS Lite onto. I'd like to use it to make an IoT device using an TFT LCD screen to show information like the weather and my ...
Atom's user avatar
  • 113
1 vote
0 answers
103 views

Receiving push messages sent through my phone (Android) to my Raspberry Pi via Pushbullet [closed]

I am already using the Pushbullet API via python running on my Raspberry Pi 3 B+ to send push notifications upon certain events, that I receive on my Android phone. I would like to also send back ...
Dave Listman's user avatar
1 vote
0 answers
781 views

VideoPlayer using python, tkinter and pythong-vlc

I have created a video (with audio) player using vlc on Raspberry pi 4 board. Code and other details below. I have an HDMI screen attached on HDMI-1. I am hiding the desktop using this approach. This ...
Meritor's user avatar
  • 21
0 votes
0 answers
450 views

Raspberry Pi Camera: Picamera2: Cannot configure camera in the middle of a stream

I'm making a remote config PiCamera for astrophotography, using the official Camera Module 3. When the user configures the camera, my application sends a request in JSON format over an HTTP socket. ...
N3RDIUM's user avatar
  • 113
0 votes
0 answers
53 views

Trouble capturing images from a Raspberry Pi camera using Python

I am having trouble capturing images from a Raspberry Pi camera using Python. The following code works fine the first time, but fails to read data from the camera on subsequent attempts: # shotFoto.py ...
ZondoX's user avatar
  • 1
0 votes
0 answers
70 views

How to generate proper pulse with python (with RPi.GPIO or pigpio) and GPIO pins to count with 4026 IC?

How to generate proper pulse with python (with RPi.GPIO or pigpio) and GPIO pins to count with 4026 IC? At this question it seems it is solved, but it isn't clear how: How can I control a 4026 counter ...
solari's user avatar
  • 1
0 votes
0 answers
35 views

Why is my Raspberry Pi booting an infinite number of times when I turn it on?

I recently got a Raspberry Pi 4 Model B board in 2022, and I did not use my Raspberry much. When I put the OS in the Raspberry, it works. But When I tried using it now with a new OS and a new sd card. ...
Evan Mathew's user avatar
0 votes
0 answers
67 views

Relay light on but not providing power

Hi I am trying to create an automated watering system using a submersible pump, raspberry pi 4 and 2 channel relay. The setup I had before worked until I added a usbc power supply(5v) and after that ...
comper's user avatar
  • 1
0 votes
1 answer
50 views

How to PID Control a 47 Ohms, 8W resistor with a Raspberry Pi and Python?

I got a Raspberry Pi 4B, a 12V power supply, a 12V air pump controlled by a MOSFET, a ds18b20 for feedback and a 47 Ohms, 8W resistor that we should somehow heat. Everything up to actually heating the ...
Mito's user avatar
  • 111
0 votes
1 answer
44 views

What sort of order of magnitude in time does it take from code like GPIO.output(led_pin, GPIO.LOW) to be executed to led being lighted up?

So I am lighting up an through hole led using 5V and an GPIO pin. I have code in python and I’m trying to get a precise timestamp of when the LED lights up with something like this: GPIO.output(...
Lanceward's user avatar
0 votes
1 answer
130 views

How to detect the position and rotation of objects in Python?

I'm building a robot that needs to detect the position and rotation of multiple trained objects from a single image. For this I'm using my Raspberry Pi 3B with Raspberry OS 64-Bit. I tried Localizer ...
JakesMD's user avatar
  • 109
0 votes
1 answer
413 views

Python code cannot detect my i2c address

I would like to ask some opinions regarding i2c communications with pca9685. My i2c1(SDA=GPIO2, SCL=GPIO3) of my rpi 4b is used by my mpu6050, which I had to enable one more i2c channel of my ...
Bobking's user avatar
  • 11
1 vote
1 answer
647 views

Raspberry pi camera module 3 works only on libcamera

I recently bought a Raspberry Pi 3b+ and Camera module v3. After days of troubleshooting, I got the camera to spit out images on the libcamera CLI. But, I can't create a picamera.PiCamera object in ...
N3RDIUM's user avatar
  • 113
1 vote
0 answers
18 views

Can't retrieve PySerial ListPortInfo.vid, ListPortInfo.pid, ListPortInfo.description

I am developing a cross platform Python application which will need to work on Windows and Raspberry Pi. I am using 64bit Raspberry Pi OS on a Raspberry Pi 4. On Windows I have no problem getting via ...
aounmc's user avatar
  • 11
3 votes
2 answers
2k views

Using micropython on Raspberry Pi Zero W

I have found a library and sample code that seems to work very well on the Pico W, but I need a bit more power, so I'd like to use the same library on the Pi Zero W instead. Initially, I tried using ...
G.H.'s user avatar
  • 151
1 vote
3 answers
301 views

Checking angle of servo motor with a Raspberry Pi 3B+

I was trying to check the angle of a servo motor using my Raspberry Pi 3B+. Although when i run the code the servo motor jumps to 90 degrees (physically) and returns an angle of 0.0 in the terminal. ...
Coder's user avatar
  • 11
1 vote
0 answers
231 views

Picamera2.stop() Behavior - do controls persist?

With Pycamera2 you can set controls e.g. autofocus. There doesn't seem to be a get_controls() function to verify what is set. Do the controls perist after using Picamera2.stop()?
user947737's user avatar
0 votes
1 answer
125 views

Pi camera video stream to a PC (not through a web page) which has low latence

I need to send a video stream from my pi camera on a Raspberry pi to a computer on the same network. The video transmission should preferably have a low latency and a good image resolution. After the ...
user153543's user avatar
2 votes
2 answers
95 views

Make screenshot of a program without being connected to a monitor

I am working on a project at a company where I read the temperature of a machine with a raspberry pi. I have downloaded the necessary program and can use it through Wine. In addition, I have made a ...
Niels's user avatar
  • 21
0 votes
1 answer
184 views

Upgraded RPi and lost my functionality using gpio zero

Recently upgraded my RPi and lost my LED functionality I've installed all kinds of things to attempt to resolve this and no success Thanks pi@JASPER:~/controls $ python controlscript.py Traceback (...
Scott Cox's user avatar
0 votes
1 answer
602 views

Buffer size for /dev/ttyS0 in python

I got a Raspberry Pi 4 processing Lidar data (RPLIDAR S2) with python (PySerial library). The lidar sends data in chunks of about 50-60 bytes at 1000000 bps over serial. When I use a USB Serial FTDI ...
Petr Osipov's user avatar
1 vote
0 answers
26 views

SIGINT in python using button

I am struggling with my work on how could I power on/off the script with only using the button only. I was planning to use only button for my work, I had researched and so far all of it doesn't work ...
REM's user avatar
  • 21
-3 votes
1 answer
78 views

Coin sorter Coding

Hello I'm a college student and we have a project in our class and I was assigned into making a coin sorter, the hard part is we didn't have knowledge about programming rpi and some codes are new to ...
REM's user avatar
  • 21
2 votes
0 answers
1k views

Postgres ERROR: SSL SYSCALL error: Connection timed out

I wanted to develop an app with Python that would run on a Raspberry and be remote controlled. This app should control (switch on and off) 2 leds based on the current day, time and the user's ...
Jiannis4's user avatar
3 votes
0 answers
136 views

How can I reduce the memory usage of my python3 scripts on a Raspberry Pi Zero 2? [closed]

I created 9 python scripts that I run as cron jobs. When I run them on a VirtualBox virtual machine running Ubuntu Server 20.04 with 512MB of RAM with a single processor, everything runs smoothly and ...
Serge Charbonneau's user avatar
2 votes
2 answers
69 views

Unable to start python file with http framework on crontab

This is my very first question, so forgive me if I am not correctly following the forum rules ;;)) I am looking to automate a python script for a webpage using GPIO pins that I can remotely enable ...
nilouth's user avatar
  • 23
1 vote
0 answers
90 views

Screen recording a specific window with audio

Raspberry Pi / Python. I need to be able to capture a specific tkinter window with audio, if the specified window is not possible then a predefined area of the screen is. We are currently using ...
Roger's user avatar
  • 11
0 votes
1 answer
283 views

Threading using Python in Raspberry Pi for GPIO inputs

My self-working on encoders of differential drive robot, I need to read the speed and position of wheels using two encoders simultaneously. I have used the threading library in Python even though I ...
DEVAPRASAD S's user avatar
1 vote
1 answer
254 views

Matplotlib error on Raspberry

On my Rapberry Pi Model3 is installed by default python 3.9.2 I've correctly installed : matplotlib 3.6.3 numpy 1.24.1 If I create a simple .py file like this: import matplotlib.pyplot as plt import ...
M4Biz's user avatar
  • 129
1 vote
0 answers
57 views

Raspberry pi capturing rs232 data and outputting through pushover

I'm wondering if anyone would be able to help me? I can see loads of tutorials on using Python to capture data from RS-232 but I can't figure out how I would be able to use that data to send ...
Max D's user avatar
  • 11
0 votes
1 answer
2k views

Raspberry Pi Python Picamera2 Motion Detection Camera Frame Rate

I am trying to write my own motion detection camera Python program for my Raspberry Pi for recording video when motion is detected. I have the following code using Python Picamera2: #!/usr/bin/python3 ...
atl-it's user avatar
  • 9
0 votes
0 answers
20 views

Monitor lightbox project – does this exist yet?

I have a second monitor next to my iMac. What I’d like to do is set up a Pi that simply outputs solid colour to the monitor over HDMI or composite (it has both), thus allowing me to use it as a video ...
Long Peter's user avatar
2 votes
0 answers
195 views

Error loading shared library on python

I'm trying to get a piece of code running on a raspberry pi model 4b that I believe was previously running of a server running Debian10 (although now I am not so sure). The code errors at this line ...
user151456's user avatar

1
2
3 4 5
65