We’re rewarding the question askers & reputations are being recalculated! Read more.

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
1answer
5 views

Reliable temperature/humidity logging with Python and a DHT11

There are more than 100 questions on this site concerning DHT11 or DHT22 sensors and I have used these with Python and c code using various libraries. None that I have tried seem to give reliable ...
0
votes
0answers
10 views

How to Type Unicode Characters

I want to show if a code is locked or unlocked and a fun way I thought of would be to use a unicode character. How would I type Unicode characters such as “🔒” (U+1F512), or is that beyond the pi's ...
0
votes
0answers
17 views

Raspberry Pi 3B+ successfully connect and pair but can't receive data from OBD II

Hello guys my problem is i cant recieve any data from OBD II to Raspberry Pi 3B+ Here the materials that i use: Raspberry pi 3B+ ELM327 -> OBD II Operating System of Raspberry Pi -> https://medium....
0
votes
0answers
14 views

Nano Color Syntax for Python3

Currently if I use nano to edit a file with a .py extension nano will recognize it as a Python file and will color the syntax, but for Python 2. Is there anyway for nano to color syntax to Python3 ...
0
votes
0answers
12 views

Can't get OpenCV up'n'running in Raspberry Pi, what should I do? (details in the description)

I followed the whole tutorial (https://www.deciphertechnic.com/install-opencv-python-on-raspberry-pi/) line by line, but at the end when I imported the OpenCV library in Python CLI, it gave this error:...
0
votes
0answers
36 views

How do I read all registers of an INA219 sensor via SMBus in Python at once?

I'm trying to Connect my Raspberry Pi 3B+ with a Raspbian 10 to an INA219 current sensor (that also returns voltage and a premultiplied power) via SMBus in Python 3.7. After destroying one Raspberry ...
0
votes
0answers
9 views

how covert pyaudio sample rate 44100 to 16000 sample rate in Raspberry pi3 b+

Here I have provide the code which was working properly before but suddenly its stop working. But if I change the sample rate 16000 to 44100 its working. But i am not able to understand what exactly ...
-1
votes
0answers
31 views

How to run a python3 program automatically in Raspberry pi 3 - Raspbian Jessie?

Good morning, I'm trying to run a program automatically When the Raspberry log in and shows the desktop, I'd already run a program following this tutorial: https://www.raspberrypi-spy.co.uk/2015/02/...
1
vote
0answers
38 views

imutils VideoStream(src=0) return VIDIOC_QBUF: Invalid argument in raspberry pi

I am only doing a simple code in my Raspberry Pi 4: from imutils.video import VideoStream # initialize the video streams and allow them to warmup print("[INFO] starting cameras...") webcam = ...
1
vote
3answers
53 views

Reboot not starting python app but executing runs with no Errors

I'm running a bell app connected by ENet between two RPI 4. The button end works well, but the server end only works when I sign in to activate it. How do I get it to start at start-up in Crontab? @...
1
vote
2answers
52 views

AdaFruit ServoKit CircuitPython Blinka Library Installation Problem

I'm follow along with a tutorial to get started with using CircuitPython to control servos on my RaspberryPi (https://learn.adafruit.com/adafruit-16-channel-pwm-servo-hat-for-raspberry-pi/using-the-...
0
votes
1answer
48 views

Desire line mapping with Raspberry Pi and Python

Desire lines normally refer to paths created by humans as a result of excessive use, as that path is the most efficient form of transportation. So if I mount my Pi Camera looking at an intersection, ...
0
votes
1answer
34 views

Raspberry Pi 0 W spontaneous event triggering for an input pin

I have two "Cylewet 25Pcs AC 1A 125V 3Pin SPDT Limit Micro Switch"-es that are normally open and connected to two of the Pi pins with internal pull up resistors. Left unattended, they call ...
2
votes
2answers
69 views

How to automatically rerun python script if error occurs

I have python script which ideally runs indefinitely in loop. I am catching some exceptions, however, the problem is when some error occurs and script stops because of error. I want to detect somehow ...
1
vote
2answers
38 views

Installing Python 3.6: question about needing sudo command for configure command

I have a Raspberry pi 3 Model B and I want to install Python 3.6 on it. A bit of context: I acquired this Raspberry pi over 2 years ago and it came with Python 2.7 and 3.4 installed by default in /...
0
votes
1answer
21 views

Invalid syntax when setting variable

When setting variable c1, it shows invalid syntax error on c1 def project(k, n): h = 200 L = 18 M = 70 da = 8 xo = h - L g = 9.81 V0 = m.sqrt(2 * g * L) W = M * g xss = -(W / k) + h ...
3
votes
2answers
36 views

Executing 2 commands in 2 different Terminal windows

I want to execute 2 python programs(both run flask servers on different ports) in 2 different terminal windows, from a single bash script. Python files: a.py and b.py Bash Script: runner.sh This is ...
0
votes
0answers
29 views

Awful Color Saturation in Datlight using pi-camera

I decided to finally post this after no avail and several videos that are unusable. I made a python script to record and convert video from a raspberry pi running in the nosecone of my rocket. However ...
1
vote
2answers
62 views

What system libraries are required to support Pillow on Raspbian Buster Lite?

After installing Pillow, I get errors such as: >>> from PIL import Image Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/pi/env/lib/python3....
0
votes
0answers
23 views

Starting python script at startup fails after some down time

EDIT: it seems that it starts randomly I have python script and I've created in lxsession/LXDE-pi/autostart file following command: sudo /usr/bin/python3.7 /home/pi/script.py If I type this command ...
1
vote
0answers
33 views

Raspberry camera v1.2 results in kernel panic

Update I have found the following issues that might relate to this problem: Framerates below 1 are not supported (https://github.com/raspberrypi/userland/issues/575) Frequent sequential call hang (...
1
vote
2answers
17 views

Cannot connect to Xserver during CLI boot

so i want to autorun my python script after boot in a CLI boot however it seems that its giving me an error "Cannot connect to Xserver". My python script uses a camera i used crontab to autorun my ...
1
vote
2answers
70 views

Tkinter not running on updated python

So, I'm trying to use a project, that uses tkinter on my Raspberry Pi but I have an issue. I needed an updated version of Python, so I updated it to 3.7.4, however, when I try to import tkinter, it ...
1
vote
2answers
55 views

Callback parameters to GPIO.add_event_detect?

I have a button object that when pressed needs to perform something, and for this I'd need to get a property of the button. I'd like it to work like: ... GPIO.add_event_detect(button, GPIO.RISING, ...
0
votes
0answers
19 views

mbus to modbus protocol

Im trying to convert mbus protocol to modbus IP protocol with a raspberry. Im new on this, just doing bcs my boss asked. I´ve been searching on all google, but I found nothing. Any help would be ...
0
votes
1answer
64 views

Desktop no longer displays after modifying LXDE-pi autostart

I upgraded to Raspbian Buster this morning and everything worked fine, until I added a command to run a python tkinter application in the LXDE-pi autostart file. When I rebooted to test the tkinter ...
1
vote
1answer
162 views

Selenium won't run on my raspberry pi 3 Model B+

Today I recieved my Raspberry pi 3 Model B+. I downloaded NOOBS and installed it on my raspberry pi. However, I cannot run a selenium browser on it. I have tried to install iceweasel but it says that ...
0
votes
2answers
69 views

Does gpiozero need RPi.GPIO?

I'm trying out gpiozero, but after running the examples from their documentation, I still get this errors but it still runs ok. gpiozero is installed on venv using pip3 #!/usr/bin/env python from ...
1
vote
1answer
62 views

Can I just create a python thread per raspberry pi for parallel processing?

I have been looking to make a cluster of raspberry pi 4s, and have been pretty interested in it and made good head way. I have seen quite a few guides on the topic as well. I followed this one found ...
2
votes
0answers
69 views

Hardware controlled RTS on a Pi4 not working accurately

We need to use RS485 to talk to one of our custom tools. We need to use hardware controlled rts/cts. I've read so many articles about this but nobody ever says it works for them with fast timing and ...
1
vote
1answer
95 views

Cannot install pandas on Raspberry Pi

I have been trying to install pandas for a week now. Read pretty much every thread I could find but nothing seems to work. I keep getting a ton of import and dpkg errors every time. Everything is up ...
0
votes
1answer
39 views

Running script after reboot does not work

I have a simple script will runs a loop that reads off temp data in the console from a sensor and then writes it to a file. I would like to make sure that this script starts running right after my pi ...
2
votes
0answers
67 views

Waveshare ADDA (ADS1256) full scale input issues

My question is about a problem of full scale output with the Waveshare ADDA ADS1256 card. I use the Waveshare High-Precision AD/DA Board based on ADS1256 on a Raspberry Pi 3b and the Python3 examples....
1
vote
0answers
25 views

Schedule Video Recording

The code below records video for 24 hours straight which is too much. I wanna schedule the record like from 9.00am to 3.00pm only 6 hours of video. Being a novice and newbie I don't really know how to ...
0
votes
0answers
55 views

Speed drops in for-loops python on rpi

I am working with python 3.5 on rpi 3B+ and making a led matrix project. For that I would like to know at what speed my code is running each cycle. I will take the minimum and use that as a refresh ...
0
votes
1answer
27 views

spidev sanity check not working

ArchARM on Raspberry Pi 3, spidev installed from AUR. I'm trying to control a Waveshare device via SPI, and can't get SPI to work from Python. The most basic sanity test I can think of is failing: ...
-1
votes
1answer
92 views

Need a large (20 inch +) touch screen monitor Raspberry Pi 3b+/4b running Debian Buster

I'm looking for a large (20 inch +) touch screen monitor for Raspberry Pi 3b+/4b running Debian Buster. We tried the ViewSonic TD2230 but the driver support is lacking; Tkinter misses about 35% of the ...
0
votes
0answers
34 views

HC-SR04 Ultrasonic Rangefinder readings are off by a large margin

I'm making a robot that should avoid obstacles and im using a HC-SR04 to measure distances. My problem is that my readings are off by a large margin. when there is no obstacle in the way I get a ...
1
vote
0answers
27 views

I don't know why suddenly mjpg-streamer and webcam stop working

I have made a program that uses three webcams and three ultrasonic sensors using raspberry pi 3 and python 3. When each ultrasonic sensors detect stuff in front of them, webcam take a picture of it. ...
0
votes
2answers
20 views

Generating Stereo Audio in PI programmatically

I want a stereo output form the PI. The sound being played will not be a recorded sound rather it would be generated using a code (preferably python). For example, the program's input will be (x,y,z) ...
0
votes
1answer
39 views

Connecting pihut controller to pi zero. Syntax error when calling a script

Please let me know if I should provide any more information. I'm trying to connect a pihut controller to a raspberry pi zero using code I found from approxeng. I am running python 3.5. https://...
1
vote
1answer
174 views

No module named 'adafruit_circuitpython_servokit' [closed]

I have a Adafruit PWM hat and I am trying to run play around with some servos. However, when I run this line: from adafruit_servokit import ServoKit It returns: No module named '...
-1
votes
2answers
67 views

How can i convert a python script into a Raspberry Pi 3 (Raspbian) executable?

I'm designing a GUI for my Raspberry Pi 3 B+. I've written the code in Python3.5 and now I want my script to be run as executable (Raspbian package). Is it possible to do so and if possible any ...
0
votes
0answers
23 views

Could I use Processing.py to display text and shapes on a Waveshare ePaper display?

I am new to Raspberry Pi and programming in general. I have very basic knowledge on Processing.py and I would like to know is it possible I could use this library to display shapes and text on a ...
0
votes
0answers
49 views

Packages are correctly installed using pip3 in my virtual environment but are not being imported, I get ModuleNotFoundError

I am using a raspberry pi 3 with raspbian buster and python 3.7.3. I can install packages fine in my virtual environment using pip3 install. This can be seen when I use the command pip list, all my ...
0
votes
1answer
54 views

MGR996R rotation angle

Basically I want to control the angle of the rotation of the servo motor but I don't seem to know how... From the tech sheet I know this motor shouldn't be a continuous one, any hint would be ...
0
votes
0answers
8 views

Can I save and open multiple videos with OpenCV or any other module/package/method

So, I have been working on a project which requires me to open an animation/video if the user gives an input of a recognized string mentioned in my code. Basically if the word entered by the user is ...
0
votes
0answers
47 views

How to Volume control PAM8610 from RPI

Does anyone know how can I control PAM8610 module volume through code from RPI? Thanks.
1
vote
0answers
32 views

softly increasing and decreasing volume with mpg123

I am using Picroft on raspberry pi 3. In picroft, every mp3 files run with mpg123. I am creating my own device using this OS. when I say it to sing a song it starts singing by playing mp3 files and ...
0
votes
1answer
71 views

Simulating OpenCL on a Raspberry Pi using Python

Is it possible to run code on a Raspberry Pi which simulates the use of OpenCL? I am developing code on a computer which is capable of using OpenCL, and am testing this code remotely on a Raspberry ...