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
85 views

Why does native resolution capture with picamera raise 'Incorrect Buffer Length' for Arducam 8MP with IMX219 sensor?

I am trying to capture() full resolution images using picamera.array but it fails raising a PiCameraValueError: Incorrect buffer length for resolution 3280x2464. camera.MAX_RESOLUTION gives ...
0
votes
0answers
78 views

Issues with timestamp creating overflow error

I'm trying to run a python script I wrote on my Raspberry Pi Zero but I keep getting the error OverflowError: timestamp out of range for platform time_t. I'm relatively certain it's something with ...
1
vote
1answer
226 views

Raspberry Pi 4 to Mitutoyo Digimatic interface

I've been trying to interface a Mitutoyo digital caliper. I used the code from here and I think I made the right corrections according to the posters comments but as I checked he was last online in ...
1
vote
2answers
98 views

Use HC-SR04 Distance Sensor and Relay to trigger the Water Pump - Need help with triggering the pump

I am trying to trigger/stop a water pump with the use of a 4-channel relay and a UC-SR04 distance sensor. I tried with some codes but I think I am missing something because although there was no error ...
0
votes
0answers
140 views

picamera.exe.PiCameraIOError: Failed to write 291840 bytes from buffer to output <picamera.stream.BufferIO object at 0x62f70c60>

Using the PiCamera Advanced Recipies in the link I am trying to capture the image to a numpy array. My code basic lines of code are. final_image = np.empty((height , width , 3), dtype=np.uint8) ...
1
vote
0answers
40 views

PiGpio – pass through binary data

I have two ports connected to GPIO on a Raspberry, where I read and send data NMEA sentences to external equipment using the PiGpio library in python, and this is working fine. Now I need to transfer ...
0
votes
0answers
595 views

issues while installing scipy

I updated the python version to 3.7. While installing scipy using sudo apt-get install python-scipy it says python-scipy is already the newest version (1.1.0-7).. I also need a python package called ...
-1
votes
1answer
560 views

How to print list of availble networks and connect using python

I have been search for a couple of hours to find a a tutorial on how to show the list of available networks and connect to a network programmatically.I don't want to use command line. I have ...
0
votes
1answer
104 views

Raspberry3b, Python3, Combine 2 codes which work by themself (Thonny, Geany) but not together in the same IDLE

I have to combine two codes and run them one after the other. Unfortunately, I can't start the gps_receiver on Thonny_ide and neighter the other code on the default Geany_ide. Can somebody help me to ...
1
vote
1answer
105 views

lighting up LEDs from suricata security alerts

so I am a Python newbie attempting to write a script that will light up a different LED based on the priority level of the latest security alert added to a log file generated by the Suricata Intrusion ...
1
vote
1answer
56 views

Is there a motion/ location sensor for RPi/Python?

I'm currently working on a rough VR system using the Raspberry Pi 3, and, of course, for that, I need a way to track the custom headset and controllers. I need the sensors to be compatible with Python ...
1
vote
1answer
357 views

Error Installing TensorFlow on Rasperry Pi 3 B

I'm following this guide to create an AI chatbot which requires Python 3.6, TensorFlow etc. So I installed Python 3.6.8. To install TensorFlow I tried sudo pip install tensorflow I also downloaded the ...
4
votes
3answers
330 views

Raspberry Pi Cluster for Computation

I am new to Raspberry Pi's (as well as this stackexchange) and would like to use them to learn how to build a small cluster. (Currently using this guide: https://medium.com/@glmdev/building-a-...
0
votes
1answer
32 views

How to add the hfp/hsp profile based speaker for input (speech recognition)and output simultaneously?

I m trying to make kinda type of assistant out of my raspberry pi 3 b+ model and so bought this Speaker . So that I can use it to give audio input as well as get the output at the same time . But I'm ...
2
votes
1answer
413 views

5v/12v power source/submersible water pump/RPI/relay. What kind of combination is suitable?

I am using a 12v DC water pump with a 20 l/min flow rate, a raspberry pi 3B and a distance sensor. I would like to use a relay and an external power supply to control turning on/off the water pump. so ...
1
vote
0answers
126 views

Is there a way to stop Pyaudio and omxplayer from printing info

I am trying to create an application which uses wakeword with snowboy and speech recognition using the speechRecognition library in Python. When I start my scripts, when say I my wake-word - 'Python'...
1
vote
0answers
37 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
130 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
160 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
208 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
39 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
273 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
297 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
322 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
77 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
85 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
27 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
260 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
224 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
299 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
49 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
430 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
80 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
180 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
41 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
189 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
51 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
432 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
170 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
45 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
377 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
199 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
333 views

how to 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
497 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
79 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
523 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
76 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
52 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 ...
3
votes
2answers
3k 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 2
3
4 5
9