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

Brushless Motor not spinning when controlling with PWM and ESC

I'm currently working on a drone which is controlled by a Raspberry Pi. I try to controll the motors by using PWM on the connected ESCs, which is described in many guides and forums. For that I use ...
0
votes
0answers
4 views

Mqtt driven python servers not working when launched by crontab -e / @reboot

I have programmed in Python several mqtt driven servers on a Raspberry Pi W (with Buster) to execute a set of commands when receiving a given set of mqtt messages from the mqtt broker (after ...
1
vote
0answers
11 views

How to combine ssmtp with License Plate Recognition on Python and Sudo Nano

I need help with combining ssmtp on both python and Sudo nano for my Raspberry Pi 4 Model B, as I have setup the ssmtp for Raspberry Pi with the codes below: sudo apt-get install ssmtp sudo nano /etc/...
0
votes
0answers
11 views

Need help overlaying an application window over camera screen

I made a python code where it will launch the pi camera and I can use buttons to record a video for 30 seconds or take pictures. In this python code, I mixed in another python script where I can ...
0
votes
1answer
18 views

Installing openCV: Bash cmake command not found

I get an error return from typing the codes below: cmake -D CMAKE_BUILD_TYPE=RELEASE \ > -D CMAKE_INSTALL_PREFIX=/usr/local \ > -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib/modules \ > -D ...
-1
votes
0answers
4 views

copy files copied across from smb via pythno

I have a raspberry pi running some python that checks a nominated directory and moves any files in there to a new directory created by the python code. my problem is when I copy a file to that ...
0
votes
1answer
32 views

License Plate Recognition System: Error writing /etc/ssmtp/ssmtp.conf smpt: No such file or directory

I faced an error which is Error writing /etc/ssmtp/ssmtp.conf smpt: No such file or directory, when typing root=postman mailhub=smpt.gmail.com:587 AuthUser=youremail@gmail.com AuthPass=...
0
votes
0answers
22 views

License Plate recognition System pip install pytesseract error

I have an error when entering the pip install pytesseract command, here is the tutorial of the project that I am working on: https://iotdesignpro.com/projects/real-time-license-plate-recognition-using-...
-2
votes
1answer
28 views

License Plate Recognition System dpkg: error need an action option

I faced an error which is dpkg: error need an action option, when typing sudo dpkg - -configure –a into the raspberry pi based on this tutorial https://iotdesignpro.com/projects/real-time-license-...
0
votes
0answers
19 views

How to code for a raspberry Pi in windows? [duplicate]

I know this question has been asked before, but I couldnt find any way for pycharm... I want to code on my windows pc with librarys which are only available for the raspberry pi and deploy it ...
0
votes
2answers
15 views

Python script runs in rc.local, but won't save file, Works from command line

I have a python script that saves values from a MPU6050 sensor to a csv, and then zips the file. When I run it from Thonny or direct from the command line, it works. When I run from rc.local at ...
1
vote
0answers
20 views

Communication between Pico and PC over USB with Circuit Python

How do i send text/json or bytes data over USB cable from my PC to Raspberry Pi Pico using Circuit Python. I tried to do that using a text file and then editing it from PC but it was taking over 1 ...
-1
votes
1answer
28 views

GPIO Runtime Error with cron script at reboot

On my Pi I am using cron to run a shell script, which in turn runs a python script on startup using the @reboot flag. This python script sets up a GPIO pin to listen for a button push, and for some ...
0
votes
0answers
13 views

Writing JSON objects to NFC tag with RC522 and python?

I'm working on a project where I need to read and update an NFC tag that is attached to a component as it runs through various processes, so that it can be tracked through the various stages. My idea ...
0
votes
0answers
17 views

RPi Zero W Python Threading.Timer Problem in crontab

t = threading.Timer(20, function=callback_func, args=[]) t.start() The above code is designed to call the callback function after 20 seconds and the callback function sets a global variable. This ...
1
vote
0answers
25 views

How to make analog servo power off with code?

I'm writing a sample code for my pi zero w and I have an analog servo motor (FS9225M) What I'm trying to do is make it work for a few spins then deactivate it so that I can move it manually with my ...
0
votes
1answer
19 views

python script can only work in geany not in terminal@@

i have one python script send message to my phone using pywhatkit it can run flawlessly on geany IDE.but when i invoke from terminal like sudo python3 /home/pi/Desktop/pyf/whatsappsend.py it run in ...
0
votes
0answers
17 views

How to use ctr + alt

So I am German and usually "ctrl + alt + Q" makes the @ (email) symbol. On my Raspberry Pi 4. However, after changing the keyboard language to German, I can't seem to access any characters ...
0
votes
0answers
60 views

Bullseye pipenv and Python 3.9 issues

I have a pipenv environment which uses Python 3.7. Version 3.7 is unavailable by default in bullseye so I have tried upgrading to 3.8 and 3.9.5 with no success. The virtual env fails to install RPi....
0
votes
0answers
12 views

Reading text from RFID card using MFRC522 (sort of)

Aight, this will probably get taken down but hear me out. So what I'm trying to do is open a website upon RFID card being read, my code currently looks like this: from time import sleep import sys ...
1
vote
1answer
29 views

How can I connect raspberry Pi 4 to submersible water pump

I recently handle a part of my team project which is hand sanitizer part came up with the idea of using a raspberry pi to power and control the hand sanitizer system. It's nothing large scale, but I ...
0
votes
0answers
13 views

GPIO change state record

I'm looking for a way to record Datetime and state of GPIO, but just want a record when the state change. I have this in my code: temp_def = 30.0 while True: print(read_temp()) if(read_temp() &...
0
votes
0answers
15 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/...
0
votes
0answers
13 views

MPU6050 on I2C is intermittently connected

I have several MPU6050 that will sometime show up in 'sudo i2cdetect -y 1' as 68. When it is there my python code that reads them works. Then randomly the code will fail to see the sensor, and when ...
0
votes
1answer
37 views

Raspberry Pi official Display

I bought the official Raspberry Pi Display and wonder now how I can display a GUI on it. I‘m using Raspbian with desktop. I did a lot of research and tried to make an Autostart Programm, which shows a ...
-1
votes
0answers
22 views

16 Port Servo Driver Disconnects Anytime It Is Accessed With Python

I have a 16 port servo driver (from adafruit) connected to my raspberrypi 4 model b. To power it, I cut a usb-cable and plugged one end into the USB 3.0 ports on the raspberrypi, and the other end ...
0
votes
0answers
25 views

Why does this callback method run indefinitely?

I've recently stumbled upon this very useful code which I got from this link https://github.com/Douglas6/cputemp. I've modified the code for clarity reasons and so "application" class is ...
1
vote
1answer
39 views

How to send Data from the Ras Pi Pico to Ras Pi 4.0?

I have a Ras Pi Pico which I am using for data collection due to the required sampling frequency. I would like to collect that data and send to the Ras Pi 4.0 so I can use the data elsewhere. Is this ...
0
votes
2answers
32 views

16 Port Servo Driver Won't Stop Continuous Servos Completely

I have a 16 port adafruit servo driver connected to my Raspberry Pi. I followed the directions (https://learn.adafruit.com/adafruit-16-channel-servo-driver-with-raspberry-pi) to set it up. I then ...
0
votes
0answers
32 views

How to display the Pi Camera preview on a tft display screen?

I have a PiCamera for my Raspberry Pi 4 (8gb) and a HDMI 5 Inch 800x480 Resistive Touch Screen TFT Display from (https://www.elecrow.com/hdmi-5-inch-800x480-tft-display-for-raspberry-pi-b-p-1384.html),...
0
votes
0answers
34 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 ...
0
votes
0answers
20 views

Beginner want's to add button function to a night vision PiCamera

I want to add button functions to my night vision PiCamera. I have a custom script that outputs the screen to spilt screen because I want to make night vision goggles with it. ` from picamera import ...
0
votes
1answer
24 views

Pygame audio is full of pops/crackling when started via systemd

I'm trying to set up a Python process that plays audio to auromatically start on boot with systemd but when I do the audio is full of pops, even though it's fine when I run it myself in the command ...
0
votes
1answer
42 views

How do you program a 1x4 Matrix Keypad in Raspberry pi?

I bought a 1x4 Matrix Keypad https://www.google.com/url?sa=i&url=https%3A%2F%2Fshopee.com.my%2F-Luminense-1x4-Matrix-Memberane-Switch-Keypad-Numpad-Arduino-Raspberry-Pi-i.63040732.4334990197&...
0
votes
0answers
17 views

Pycharm support?

I want to learn Python using PyCharm editor. What operating system (Raspberry OS) does PyCharm support?
0
votes
0answers
9 views

Transparent window using pyqt5 on raspberry pi3

I am trying to achieve transparent windows using PyQt5 in raspberry-pi 3, but it's turning into black window. Any help will be appreciated.
0
votes
1answer
41 views

Detecting clicks of usb mouse on raspberry pi

I am running the Debian lite cli PI 3 I have a wired USB mouse I have plugged into one of 4 usb ports I am trying to write a python script to detect when I left/right click and use the scroll wheel. ...
0
votes
0answers
14 views

Using RFID-RC522 with spi on RBpi 3B+

Hello_friends, I am trying to get a RFID reader working on a Raspberry 3b+ That same setup and codebase used to work well on the older 3b+ model from 2015 (the current one is 2017 edition), but now ...
1
vote
1answer
54 views

Pi Zero - GPIO Lag

Summary: I have been trying to write a robot tank using a Raspberry Pi Zero W in Python and am running into an issue wrt to lag. The left motor moves 100-500ms before the right motor (or vice versa), ...
-1
votes
1answer
47 views

Can my Raspberry Pi Zero W python program be duplicated and resold?

I have a Raspberry Pi Zero W that runs a program under the main username, Pi. I'm going to give this Pi to someone for their own use, however I expect them to use the Pi for their application without ...
0
votes
1answer
41 views

Controlling a rotary encoder through a Tkinter interface (letting RPI control the dial instead of the dial controlling a function on the RPI)

EDIT*** I have a "STEC11B03 ALPS" rotary encoder and I want a python script to output the same signal to the circuit as the rotary encoder does when turning. I want the script to do the same ...
0
votes
1answer
30 views

My desktop shortcut won´t execute

I created a GUI that tells me the temperature based on the temperature sensor I connected to the raspberry pi, that works fine, but then, I tried to do a desktop shortcut, and when I click on it, the ...
1
vote
1answer
37 views

Raspbery Pi GPIO Hat

I've got this Raspberry PI GPIO [expansion hat][1] attached to a Raspberry PI 3b and have a question. Even though the terminal blocks are well labeled, I don't think I understand what pin numbers of ...
0
votes
0answers
44 views

Error "usb_hid module not found" on Raspberry Pi Pico

I'm trying to create a USB Rubber Ducky as seen in NetworkChuck's video, and the very first line of dbisu's script includes an import usb_hid, but when the script is run, I get an error stating ...
0
votes
0answers
42 views

How to send a string from RaspberryPi to Arduino via serial interface?

I want my HomeAssistant being able to send out RF433. HomeAssistant is hosted on RaspberryPi while the RF433-module is on ArduinoNano. I am referencing this article with some modification. How to send ...
0
votes
0answers
13 views

Raspberry omv python script

I have installed omv and I have create a public file which inside I have put a python script. How I can run this script with ssh to see if is all okay? thank you in advance
0
votes
1answer
52 views

can't get audio to play from python, on raspberry pi

I have a Raspberry Pi 3B+ For speaker, I have some ear phones plugged into the 3.5mm audio jack. If I try pi@raspberrypi:~ $ omxplayer ./mario1.mp3 Audio codec mp3float channels 2 samplerate 44100 ...
0
votes
0answers
30 views

RS485 Thermometer reading with python

The idea of the project is to get the data from the RS485 devices and write it for visualisation later. I have raspberry pi 4 with 4GB RAM with this hat and this sensor. I'm not sure how should I send ...
1
vote
0answers
51 views

Trying to plot the ADC values from the PICO similar to what an oscilloscope displays. Just scrolls to the left right now. Total Python newbie

#!/usr/bin/python #Python 3.7.3 # Attempting to plot the ADC values coming from the PICO # Program contains only necessary lines of code for testing plot routine # The Raspberry PI Pico is connected ...
5
votes
1answer
91 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 ...

1
2 3 4 5
60