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
1
vote
0answers
34 views

“Attribute Error”- How to display data from distance sensor on lcd display?

I am trying to incorporate LCD display features with the codes that are already written for the sensor. "lcddriver.py" is in "lcd". "distance.py" contains codes for my distance sensor. This is the ...
-1
votes
1answer
66 views

Distance sensor with 16x2 lcd display- ImportError: cannot import name lcddriver

Happy new year. I am working on a personal project which involves a distance sensor and a LCD display. The distance sensor's data should ideally be displayed on the 16x2 LCD display. The codes for the ...
1
vote
1answer
68 views

While loop picking up button press twice with gpiozero

good morning! I've been working on some python (pretty new to the language) to control some buttons and LEDs utilising gpiozero and I've run into a few issues which I've been trying to troubleshoot ...
-1
votes
1answer
145 views

TFMini Plus LiDAR not working

I'm trying to work with a Benewake TFMini Plus Lidar sensor in a RaspberryPi. I'm using a USB-2-TTL serial adaptor, which is working properly according to the tests I've ran. I'm testing the sensor ...
0
votes
1answer
31 views

Raspberry pi failing to take still

I am developing my remote camera robot with flask on raspberry pi zero w. Where is mjpg-streamer used for video stream and picamera python lib used to take high resolution stills. And I having very ...
2
votes
2answers
149 views

How can Rpi4B select multiple ADS1115 ADCs using PCA9546 / TCA9548A I2C multiplexer?

I have a PCA9546 i2c multiplexer hook to my raspberry pi under it are 4 ads1115 i2c ADC. My first main problem is how do you switch the address of the i2c in python the sample code that i have seems ...
1
vote
1answer
149 views

How to execute a Python 3 + OpenCV 4 script @reboot on Raspbian Lite (headless)?

The Python script works perfectly fine when ran from the command line while signed in as the "pi" user, with this command: python3 /home/pi/www/main.py & But from the crontab, it just doesn't ...
0
votes
0answers
16 views

time.time() taking a big jump after initial boot up [duplicate]

I have a Python3 program that is constantly using time.time() to measure elapse time of each loop in the program to drive a real time plot. When I run this program normally either from a terminal ...
3
votes
1answer
267 views

Open a Folder in the File Manager by a Python Script

I would like to open a specific folder (not a file) in the file manager by pushing a button in a Tkinter frame. Does anyone know the function?
1
vote
1answer
67 views

python script not launching when put into crontab

I have two python scripts, flickSwitch.py & measureTemp.py, the first calls the second when a button is pressed. All works fine when run directly from /home/pi. I put the first script into ...
0
votes
0answers
62 views

Can't connect waveshare hat to raspberry pi 3b via python3 to obtain gps

I'm stuck with my waveshare hat and it would be cool if you could help me. I would like to obtain the gps location. I'm a python beginner and tried to use some already written code from this websites:...
0
votes
0answers
24 views

Why i can't write OBD 2 value of a car to firebase?

Hello guys im having a problem sending a value to firebase here's the code that i use import obd connection = obd.OBD("/dev/ttyAMA0") while True: cmd1 = obd.commands.RPM response1 = ...
0
votes
0answers
147 views

Tkinter no display error

I'm using Tkinter and running into the next error: Traceback (most recent call last): File "TKtest.py", line 3, in <module> master = tk.Tk() File "/usr/lib/python3.7/tkinter/__init__.py", ...
1
vote
1answer
119 views

Using GPIO from my virtualenv

I have a project I am developing with python3. I would like to add some status LED functions to it. If I am not root everything is fine, my activated virtualenv is all good, but I cannot use GPIO (...
0
votes
1answer
202 views

Azure IoT Hub/Services with Raspberry pi in python

I have been googling how to connect raspberry pi 4(with and without buster) to Azure IoT using the python SDK and found somethings but they are not clear as they should be for a beginner like me who ...
0
votes
1answer
46 views

Turn On/Off 3D printer projector with Python/GPIO

There are similar questions but I don't want to turn on the LED but the 3D printer projector(NQM Plus Light engine) for the image projection. The pins that I wanted to use are shown in the picture. ...
1
vote
1answer
155 views

Get time in microseconds (a 8 digit number) in python3

I am converting an Arduino code to python3. I am trying to read data from IMU 9250 sensor from the I2C interface of raspberry-pi. I am facing issue with the timing libraries of raspberry-pi and ...
2
votes
1answer
64 views

Installing pip3 mysqlclient results in error

I have tried a few different ways to get this installed. mysqlclient and also tried pip install MySQL-python both result in error. pi@raspberrypi:/ $ pip install MySQL-python Looking in indexes: ...
2
votes
1answer
150 views

Raspberry Pi 3 B+ (Buster) can't control Dynamixel AX-12A with Raspberry Pi 3 B+ (Buster) with half duplex communication

I have a project to make mobile robot with Dynamixel AX-12A as the wheel, so i changes the AX-12A to Wheel Mode with CM-530 and it works well. I follow the guide from http://www.oppedijk.com/robotics/...
0
votes
0answers
33 views

VOIP phone dialer

What would the best way be to connect to my PBX or to dial a number to PBX? I'm really lost where to start. looking to use python3 with some softphone maybe
0
votes
1answer
100 views

Is there a way i can view RPI screen to VNC on Raspbian lite

i have a problem where i need to view my running python GUI app (Kivy) to VNC. The app is running on the 7" RPI screen and i am using raspbian lite (no desktop), i used raspi-config to enable VNC but ...
0
votes
0answers
47 views

How to create a person or head (not face) detection using open CV that are not too slow when run in Raspberry Pi 3B+?

Hello guys my problem is creating a program that can detect the head(not face) or human detection for my project One of the program that i see is too slow for raspberry pi 3B+ which is this : https:/...
1
vote
1answer
263 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
100 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
39 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
272 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
110 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
169 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
vote
1answer
299 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
73 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
363 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-...
-1
votes
1answer
71 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
45 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
1k 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
69 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
32 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
39 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
37 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
412 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
33 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
75 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
103 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
313 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
443 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
29 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
190 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 ...
3
votes
2answers
1k 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
286 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
222 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
185 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
2
3 4 5
8