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

To perform only one task

How can we prioritize raspberry-pi3b+ model so that if my "code on python" is running then the raspberry-pi should not perform any other task in background. Since i have to calculate time taken by my ...
0
votes
0answers
30 views

How to continuously check Pin status in infinite while loop

I am working with Raspberry Pi 4 and using python for some project. The sample code is as below: while True: if( GPIO.input(a)==GPIO.LOW): if __name == '__main__': try: ...
0
votes
0answers
15 views

Initiating a (or multiple) ADC read with SPI during Ton of a PWM signal generated by the RPi

My goal is to create a signal to my circuit that can be anywhere between 1-1khz, with a wide range of duty cycles. I have achieved this, where I am using the following to generate a PWM signal (this ...
2
votes
1answer
53 views

Can I use a GPIO and do multiple things with it at the same time?

I have a GPIO that creates the PWM pulse. Would it be possible to have my python code read the same GPIO, and on high execute my code to read the ADC? Would that disrupt the PWM because I'm accessing ...
2
votes
4answers
72 views

Why is my relay switching on automatically when I start my program?

I'm building a little automated hydroponics system using a raspberry pi zero, a 5 volt relay, a pump and a soil moisture sensor from adafruit. So far everything is working, I can pull the pin to high ...
1
vote
0answers
30 views

display a cross-hair within a picture with python3

I want to add a cross-hair pointing to a position within a picture frame and display it. How could this be done effectively using python3? Which library would be preferable?
1
vote
1answer
35 views

Get cheap ST7789 TFT display working through SPI (without CS pin)

I purchased a cheap Chinese ST7789 TFT (1.3in, 240x240) that is clearly identified as SPI compatible, tough it does NOT have a CS pin and also some of the pins seem weirdly named to me. I have been ...
0
votes
0answers
23 views

ADXL345 sampling rate setting

I want to set ADXK345 sampling rate. I wrote the following code in python3 import time from datetime import datetime,timedelta import Adafruit_ADXL345 import threading import pandas as pd import ...
3
votes
1answer
69 views

Raspberry Pi Zero W serial communication

I just got a RPI zero w and I want to communicate to a device through serial comm. I also have a MAX232 board and a RS232 TTL converter. I want to use one of this boards to be able to communicate with ...
1
vote
1answer
30 views

Don't know how to connect multiple MCP23017

I need more pins on my raspberry pi 3 so that I can use it to manage the lights in my house. I am going to use relays and MCP23017. I need to know how to use 8 of the MCP23017 on my raspberry pi. If ...
2
votes
1answer
33 views

apt-get update - trying to install python OpenCV on rasp pi?

$ apt-get update Reading package lists... Done E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied) E: Unable to lock directory /var/lib/apt/lists/ W: Problem unlinking ...
1
vote
1answer
38 views

Can't find python pip on newly installed Buster on my old model B

Anyone else using python and pip on Buster lite? Pip is not working for me on my old dual usb Model B. Just seems to be missing. I tried installing it using the "get-pip.py" module from the official ...
1
vote
1answer
36 views

Can Not able to install python OpenCv on raspberry pi 3?

I have been trying to run my 4WD Smart drive car with raspberry 3. I am using python 3 to implement algorithms and computer vision object detection. I also have a problem with Cheese camera on the pi. ...
-2
votes
0answers
62 views

Two Monitors connection Raspberry Pi4

I want to connect two monitors (Screen A, Screen B) with my raspberry pi4. Screen A is to display content and when the user clicks on it the content display on Screen B. the Screen B will be static ...
-1
votes
1answer
266 views

Why is there an ssl problem after installing python 3.8.1

Hello i'm using a Raspberry pi running Raspian Jessie. I've tried updating the python version to 3.8.1 and it seems I'm having troubles running pip with it. After i enter this line in terminal ...
0
votes
0answers
60 views

Can't sudo apt-get update && sudo apt-get upgrade (won't complete task)

I am having an issues updating my raspbian operating system. After running sudo apt-get update && sudo apt-get upgrade -y I receive the following error messages: Hit:1 http://raspbian....
1
vote
0answers
23 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
32 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 ...
0
votes
1answer
64 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
78 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
33 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
29 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
264 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
79 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
50 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
66 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
42 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
160 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 ...
4
votes
3answers
191 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
23 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
98 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
47 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
33 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
50 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
59 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
113 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
28 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
110 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
98 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
15 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
256 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
61 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
48 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
88 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
75 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
149 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
44 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
82 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
58 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: ...

1 2 3 4 5 7