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
-1
votes
0answers
21 views

Segmentation Fault error( core dumped) while running Yolov5 on a custom dataset on Raspberry Pi 4 [closed]

I am trying to run the ultralytics/yolov5 on my Raspberry Pi 4 I have custom-trained the dataset successfully and trying to measure the performance by running the test.py but on running the command ...
-1
votes
2answers
40 views

How to run python script at startup?

I've been all over the internet looking for a solution for this but everybody seems to have different answers and none of them work. I have a python script that emits audio through the headphone jack ...
0
votes
0answers
13 views

Help with NodeJS implementation of I2C for MLX90640 sensor [closed]

I am trying to convert a Python code for the MLX90640 Thermal Sensor to JavaScript using the I2C library on NodeJS. I've read through the I2C documentation via this link: https://www.npmjs.com/package/...
0
votes
1answer
20 views

Raspberry SD goes “read-only”: programatically detect and correct?

I´ve been experiencing the sudden change in SD Cards installed in Raspberry PIs (3B+ mostly) that go read-only after a sudden loss of power. As I have to install these devices far away, running a ...
0
votes
0answers
8 views

Overlay dynamic graphic on static picture RPi & Python

I have an application where I use a Raspberry Pi to runs code and it 1) goes to the web via wifi and retrieves "weather" data from a html site query and 2) manipulates and filters the xml ...
0
votes
0answers
16 views

Error in autorun script, RASP 3

I need to run a script in lxterminal in boot. The unit is headless, just have a digital button to start the process in the code. I already have a automatic pi user loggin and a .desktop created in ...
-2
votes
0answers
33 views

Else: SyntaxError Im getting this error when running a script [closed]

I'm using a code to scan qrcodes with my Rpi camera Why am I getting a syntax error for an else statement?
0
votes
0answers
28 views

Getting Segmentation Fault Error(core dumped) after successfully installing the coco datasets while running YOLOv5 on Raspberry Pi [closed]

I am trying to run the ultralytics/yolov5 on my Raspberry Pi 4. When I run python3 test.py --data coco.yaml --weights yolov5s.pt it successfully starts with the phase and successfully downloads the ...
0
votes
0answers
12 views

Raspberry Pi Python Neopixel WS281x Script suddenly changes LED color

For my Python script I'M using this library. I try to set one single, permanent color to all my 60 pixels. As I'm using two LED strips (one strip at GPIO18 and one at GPIO 13), my code handels both of ...
0
votes
0answers
20 views

Resizing photo keeping aspect ratio for e-ink paper

I am trying to create a photoframe using a 7.5 inch eink paper from waveshare with resolution 800x480. I have been able to print the image on the paper by resizing it to the requested resolution using ...
-1
votes
0answers
29 views

Playing MP3 recordings with raspberry pi

I am trying to make a python program that plays mp3 recordings when a condition is met but I cannot figure it out. I have researched it but I cannot get it to work. I was wondering if anybody knew how ...
-2
votes
0answers
26 views

How do I communicate with a Bluetooth transmitter with Python?

So I am working on a project where I have two streams of data flowing into a Raspberry Pi. I'm using an external USB mic to pick up noise in a given area and a Bluetooth transmitter to receive the ...
0
votes
0answers
21 views

E: Unable to locate package python-gudev

This simple command: sudo apt-get install -y python-gudev is giving this error: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package ...
-1
votes
0answers
18 views

Read byte array with Pyton or Javascript? [closed]

I've used Python SMSBus library to read data from Arduino through I2C, I'm not familiar with Python but with Javascript so I've found this npm package https://github.com/fivdi/i2c-bus , but it seems ...
0
votes
0answers
18 views

What happens if the value for GPIOZERO PWMLED exceeds 1.0? [closed]

I am controlling a DC Motor using the GPIO of a raspberry Pi to switch on and off the power via a MOSFET. To adjust the speed of the motor I am using GPIOZERO PWMLED, 1 is full on 0 is off. At the ...
0
votes
1answer
20 views

How to reduce PiCamera capture time without reducing resolution

I'm currently writing a python script which needs to capture an image. I'm currently using PiCamera.capture() to accomplish this, but it takes too long to capture images. The project requires as high ...
1
vote
0answers
37 views

Serial RS232 Raspberry FTDI chip USB to RS232

Circumstances I am running my Raspberry Pi 3 Model B+ with Raspberry Pi OS. I use a FTDI chip serial cable adapter USB to RS232. https://www.amazon.com.mx/gp/product/B081PP3ZM4/ref=...
0
votes
0answers
79 views

How to make sure BlueZ NoInputNoOutput agent does not ask for user authorization?

I am trying to pair my custom made BLE device with a Raspberry Pi 4, using the bluepy library, programmatically. I do not want to press "accept" or type "yes" whenever I try to ...
0
votes
0answers
28 views

Overlaying text to OMXPlayer using numpy array

Overlaying text to a video can be solved in this way: Play the video with OMXPlayer. Use Pillow to create a transparent image with the text. Save the image. Show the image with omxiv in a higher ...
2
votes
1answer
74 views

Serial port fails after some time

I use a RPi 3b to request and receive float values over serial from an Arduino Nano (fake). For that I use python and pyserial. Arduino Loop: if (Serial.available() > 0) { String req = Serial....
0
votes
0answers
18 views

Play an audio stream (internet radio) and start again automatically after Wi-Fi reconnects

I have a working Python script that streams an internet radio station with Omxplayer. The script restarts Omxplayer if Omxplayer stops, such as when the internet signal is lost and reconnects. ...
-1
votes
0answers
16 views

Python GPIO OutputDevice.value does not change

I'm trying to control a ICE tower cooler fan using a circuit with a transistor wired to power the fan with 5V when GPIO17 is powered. When trying to print whether the GPIO17 is on or off using ...
0
votes
0answers
30 views

How can I download PyTorch 1.8.1 on a Raspberry Pi 3?

I want to download PyTorch 1.8.1 on a Raspberry Pi 3. Can this be done? If so, how?
0
votes
0answers
52 views

Raspberry pi with distance measurement laser sensor in python

I am new to this both using raspberry pi and laser sensor. Our requirement is to find distance in meter using laser sensor. The maximum distance is 40 meter, so ultrasonic or IR will not be useful ...
0
votes
1answer
13 views

camera program gives error when run in /etc/profile but the program runs fine

This is the error I get : picamera.exc.PiCameraMMALError: Failed to enable connection: Out of resources import numpy as np import os from picamera import PiCamera from time import sleep from gpiozero ...
0
votes
1answer
30 views

socketserver module working with command python on Raspberry pi 3

I'm new to the forum, and I'm writing because I have a strange problem: I wrote a code using socketserver module one or two years ago and if I launch the code with the command "python script.py&...
0
votes
0answers
29 views

Calculate the motion of a simple object in 3d

I'm a beginner in python and raspberry pi and for a school project which is due this month, we're using a raspberry pi 3 and a camera module (fixed) and the idea is when u move something in the camera ...
0
votes
0answers
13 views

Why is 5V Solenoid not working with Pi Pico

I'm trying to control a solenoid with Pi Pico. Solenoid - https://www.tanotis.com/products/genuine-sparkfun-solenoid-5v-small I tried following this article (and used USB power and Pico instead of ...
0
votes
0answers
34 views

Check if display is broken or gpio problem

I bought ST7735 128x160 display and I run it with this code The first time I ran it, it worked, but cables were connected through a breadboard. So I decided to connect it straight to GPIO - I took a ...
-1
votes
0answers
27 views

Gpt error 1575.1

Was testing a python code for memory leaks and got this error. I was entirely expecting it to error out, but before I continue I decided to figure out what the error means. I have done copious google ...
1
vote
1answer
41 views

L298N motor driver either keeps running or slows down the motor with RPi3

So, according to this video which I had followed, my motors should be constantly running as per the program and should stop running after the program is executed. Instead, when I first ran the script, ...
1
vote
0answers
13 views

Making certain texts stop at certain time [closed]

i'm trying to make a loop with various type of messages but i can't make text 1 ,text2 and text 3 run in the same time ( separating them just with a time.sleep) and in the same tame text 1 top ...
0
votes
1answer
35 views

Can I connect over 15 Bluetooth devices with raspberry Pi 4B 4GB ram using usb Bluetooth apapters

I have a raspberry Pi 4B 4GB ram and I want to connect it to 16 Bluetooth oximeters(BLE) and take readings after every 20 secs. Now I know that pi can connect to only 7-8 Bluetooth devices at a time ...
0
votes
0answers
52 views

Raspberry PiCamera: VIDEOIO ERROR: V4L: can't open camera by index 0

I got this message from my Raspberry Pi 4. This code worked for me when I ran it last week, but now it's giving me this error... VIDEOIO ERROR: V4L: can't open camera by index 0 Reading QR code using ...
0
votes
1answer
18 views

Autostart random video script throws IndexError

I am trying to autoplay a random video from an attached usb volume upon boot on my Pi 4 Model B Rev 1.2. The following Python 3 script works within Thonny, popping a Tk message box with the randomly ...
0
votes
1answer
20 views

PiCamera V2 NoIR and AMG8833 thermal sensor mmal_vc_port_enable: failed to enable port vc.null_sink:in:0(OPQV): ENOSPC

Hardware used: Raspberry pi 4b, 4 gb ram, AMG8833 thermal camera, PiCamera V2 noir, ALL brand new, i just bought them few weeks ago. Im trying to do finish a project and i ran into a not that good ...
1
vote
1answer
37 views

PiIR TypeError: unsupported operand type(s) for /: 'NoneType' and 'float [closed]

I use the PiIR module to record infrared light buttons and it works. But when I use piir play I get the following error. Does anyone know how fix that? Keep in mind: I use Python 3.7 and PiIR 0.2.4 ...
0
votes
0answers
20 views

Temperature and Humidity does not print on LCD

I am working with a DHT 11 and LCD. When executing the code, the temperature prints one time on the pc and freezes. It does not print on the LCD though neither. Can I have someone assist me with ...
1
vote
1answer
23 views

Need script to make scheduled 8 channel relay outputs [closed]

This script fires my relays, but I don't know how to change duration and need it to fire daily to run pump and ozonator for an iso float tank. I'm currently only using GPIO 9 and 10 #!/usr/bin/python ...
0
votes
0answers
30 views

PIR Sensor Counter

Hey guys I'm trying to create a simple script that essentially counts the amount of people that reside within a room, by having an entry sensor and exit sensor and tells you how many are within the ...
1
vote
1answer
29 views

Bluetooth Ignition need help smoothing out functionality

Hello I have been working on a Bluetooth authorized push to start ignition in my truck. Right now its installed and working but I would like to change the function of the button and shorten the time ...
1
vote
0answers
51 views

What's causing my stepper motor to fail / perform inconsistently?

Summary: Raspberry Pi controls an EasyDriver and stepper motor, but results are inconsistent and the system fails regularly. Can't figure out why. Long text: Hi all, I have a small setup where a ...
0
votes
0answers
39 views

RPI-4 Bluetooth board does not find iOS devices

On a brand new RPI-4, I cannot find apple iphones neither using module bluetooth nor bluez package. I tried to scan for BLE devices and all the command line tools such as bluetoothctl and hciconfig to ...
0
votes
0answers
25 views

Motion sensor script

Hey guys I'm trying to create a script which counts the number of times a person has interacted with the motion sensor using a while loop, however whenever the motion sensor has been interacted it ...
0
votes
0answers
299 views

Raspberry P 3b+ pyqtgraph Import error sip

I am trying to show charts on the Raspberry Pi 3b+ The OS is : Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster Python is : 3.7.3 pip or sudo apt get does not show ...
0
votes
0answers
10 views

Modifying frames that I'm streaming

I'm currently trying to capture a video stream with picamera, apply a function I've made using OpenCV to detect something on each frame then stream it to the network. Currently, I'm using the code ...
0
votes
1answer
26 views

Python - how to make non blocking terminal where every one second serial link sends packet [closed]

I can write this in C#, but now i learning python and I don´t know how program this. I want to make simple terminal where serial link sending every one second packet... In non-blocking way. In C# I ...
0
votes
1answer
24 views

Python - How to automaticly open first available serial port (COM/tty) [closed]

I am new at Python and I want to learn serial communication between Raspberry and other devices like PC, arduino, sensors... I often plug and unplug devices like arduino, FTDI, etc. to COM port... I ...
0
votes
0answers
37 views

How to run python tkinter at start

I want to start my GUI app wrote in python with tkinter at start my Rpi, I set the start method in the rc.local like this: sudo bash -c 'python /home/pi/Desktop/appPython/good.py > /home/pi/...
0
votes
0answers
37 views

pi zero portable mp3 player software

i am thinking about a project for which i could use some guidance. i want to build a flac/ high bitrate mp3 player with nice clicky buttons and rotary encoders. i have a raspberry pi zero, a dac hat ...

1
2 3 4 5
58