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.

150 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
3answers
2k views

Raspberry Pi won't recognize nRF24L01+

I'm a Raspberry Pi n00b and a python beginner, but I have a lot of experience with DIY electronics, arduino and c#. I've tried everything I can think of, and I just can't get the Pi to recognise the ...
1
vote
1answer
257 views

Camera pretrigger capture

Hi i want to make a program that will continually record a video and on a press of a button, it will save 2 minutes before i pressed the button is it possible to do it somehow ?
1
vote
0answers
883 views

usb.core.USBError: [Errno 13] Access denied (insufficient permissions)

I am running Rasbperry pi and have the pyusb module installed. The printer is Bus 001 Device 004: ID 0fe6:811e Kontron (Industrial Computer Source / ICS Advent) Parallel Adapter, and it's idVendor and ...
1
vote
1answer
2k views

Controlling Linear Actuator

I am hoping to control a WINDYNATION 4" Stroke Length Linear Actuator with a Raspberry Pi for a senior design group project. Ideally, the program will make the actuator fully extend, and then retract ...
1
vote
0answers
162 views

Python 3 Debugging Symbols for Raspbian Stretch

I am trying to track down a segfault when using Pip on my Raspberry Pi Model 3B running Raspbian Stretch. I've configured the pi to do a core dump, and I've gotten gdb to load the core. The ...
1
vote
0answers
45 views

Raspbian Python Package installtion errors, Parselmouth

I am trying to install this package, praat-parselmouth, however the installation does not move forward after getting stuck at either "Running setup.py bdist_wheel for praat-parselmouth" or if ...
1
vote
0answers
736 views

How can i emulate a ps/2 keyboard with raspberry pi3

So I am working on an medical machine which runs on microcontroller(So,No OS).It gets the input from ps/2 keyboard. I would like to automate it. I would like some basic idea and some help on how to do ...
1
vote
0answers
426 views

Block Raspberry Pi from quitting fbi fullscreen (HDMI) to command line

I'm developing a parking control system in Python 3 which runs in headless mode at the Raspberry Pi startup and uses one RFID reader, one Barcode reader and many other devices but they really don't ...
1
vote
1answer
1k views

After installing python 3.6 most modules don't work

I'm new with RPi and also Linux, so my question might be stupid but I tried to get Python 3.6 running with different ways (compiling, pyenv, berryconda). In general I think python is running on all ...
1
vote
0answers
523 views

I keep running into missing elements with GStreamer

I have tried uninstalling and reinstalling GStreamer on the Raspberry Pi 3 and I keep finding that I have missing elements. This is the Pi on Log Level 4 (GStreamer): This is my laptop, running ...
1
vote
1answer
1k views

PWM object's ChangeDutyCycle method is not working

I have a motor class but I dont' know why this motor cannot change speed class Motor: def __init__(self, pos, line_status=0): def set_motor_gpio(_a, _b, _pwm): self._A = _a ...
1
vote
0answers
619 views

IR Tracking Sensor (TCRT 5000 ) always gives led off as output

I am using a Raspberry PI3 Model B and TCRT 5000 sensor to monitor movement. I am using a Python script(Python3) to read the data from the sensor. Script used - #!/usr/bin/env python import RPi.GPIO ...
0
votes
1answer
17 views

How to interface MLX90614 temperature sensor with Raspberry Pi

I have a mlx90614 sensor and I am interfacing it with raspberry pi 3 B+. I am using adafruit library python. Below is the code: import Adafruit_GPIO.I2C as I2C I2C.require_repeated_start() class ...
0
votes
0answers
16 views

Moving /home dir form sd card to USB drive on a Rasspberry pi 4

I'm trying to run Insightface package on raspberry pi 4 after struggling to install all required packages namely cv2 and mxnet but when I exit python or run my program I get “corrupted size vs. ...
0
votes
0answers
23 views

While using sudo command my python script crash

I am using LIRC 10.1-5.2 with Raspbian Buster, i need to map IR keys as keyboard input. I have successfully enable to setup IR receiver with the following guide (https://www.instructables.com/id/Setup-...
0
votes
0answers
10 views

Importing Cv2 in TFlite

I tried running TensorFlow Lite, on Raspberry Pi 3 Model B+ having Raspbian Buster OS (January 2020 Release) (TFenv) pi@raspberrypi:~/tflite1 $ **python3 TFLite_detection_webcam.py --modeldir=Model3*...
0
votes
0answers
14 views

using passlib with argon2 gives MissingBackendError

Installed passlib on my Windows 10 pc to study how to store passwords To use passlib with argon2 I installed that argon2-cffi too just as it shows in the passlib documentation Runs fine on my laptop, ...
0
votes
1answer
50 views

function to wait for any of the buttons press

I'm working on a project that use four buttons to navigate in a menu. The root options of the menu have nested options etc. The buttons don't have hardware de-bouncing. My ultimate objective is to ...
0
votes
0answers
32 views

Reading Mitutoyo digital micrometer with rasberry pi

Im trying to read the value from my Mitutoyo digital micrometer 543-390B Datasheet. The micrometer is using a smartbox to communicate with PC, the box is using P87C51SBPN microchip P87C51SBPN ...
0
votes
0answers
18 views

Serial communication with arduino over bluetooth

I am using rfcomm to connect to an Arduino nano (HC-06 bluetooth module) from my RPI 4B+. It works flawlessly and the two devices are able to communicate with no issues. I need to be able to connect ...
0
votes
0answers
21 views

How to make a voting machine using a Rapberry pi?

I'm a newbie on raspberry pi tinkering world, making a small project with R307 fingerprint module this link was quite helpful to get me used to the module later as the writer presents all the ...
0
votes
0answers
42 views

How to get AIY voice project to shutdown with button

Greetings fellow raspberry pi fans! I use this code for AIY VOICE KIT google assistant. This kit uses a raspberry pi to run google assistant. So basicly you can build your own google home and control ...
0
votes
1answer
28 views

Issue using pyserial on Rpi with python3.7

I don't know what when wrong but somehow I can't use the serial module from pyserial. (venv) pi@raspberrypi:~/workspace/test $ python Python 3.7.0 (default, Apr 28 2020, 16:06:28) [GCC 8.3.0] on ...
0
votes
0answers
18 views

NeoPixel library slow with large number of WS2812B LEDs (Raspi3)

Noob here, I am currently working with a 10m long strip of 144LED/m density LEDs. The problem is with such a high number of LEDs loops (like a color wipe for example or filling LEDs one after another) ...
0
votes
0answers
31 views

How to call readings from one script that reads a sensor to be used by another script that controls servos

I'm trying to use the readings of the accelerometer of an IMU MPU9250 to control servos. For that I created (with help of resources online) a script(IMUmodule) that reads the IMU and spits out ...
0
votes
0answers
85 views

Problem when following Teach Your Raspberry pi Yeah-World tutorial

I've just been following the Yeah-World tutorial and have done all the things it said, except I changed the code in record.py so it can use a standard USB webcam: cap = cv2.VideoCapture(0) frames = []...
0
votes
0answers
40 views

Writing code to access agile octopus rest API in python 3 on a raspberry pi

Octopus give an example of the command needed to access their API: curl -u "sk_live_************************:" "https://api.octopus.energy/v1/products/AGILE-18-02-21/electricity-tariffs/E-1R-AGILE-18-...
0
votes
0answers
29 views

Installing TA-Lib in Thonny on Raspberry Pi

I am trying to install TA-Lib on my raspberry pi. When I try using Thonny, it gives me a gcc error. I updated the python3-dev and gcc tools but still the same error. When I try to compile using the ...
0
votes
0answers
19 views

2 MPU6050 on Raspberry pi4, different values

I have two identical MPU-6050 connected to a raspberry pi 4, but it looks like one is off in the readings. I don't have another sensor, so can't test that, but I was wondering if it is the sensor or ...
0
votes
0answers
20 views

Cross compiling error in python code for raspberry pi target machine in Ubuntu Virtual machine

I have to compile python code into an executable file. To do that on my RPi3 b+ running Debian stretch. I use cython to convert .py into .c code and then using gcc to create an executable file. The ...
0
votes
0answers
30 views

Tektronix Oscilloscope under PyVISA on a RaspberryPi 3B +

I am working in a project that requires to control and automatize to devices, a Function generator HAMEG HMF2550 and a Tektronix TDS2024C, which are connected via USB to the RaspberryPi (I will ...
0
votes
0answers
35 views

Python3 Program Suddenly Given Error Messages Regarding Request Code

I have been running a python3 program that is using request and it has been running fine for the past month. Today when I rebooted my Pi Model 3B+, I am getting these errors when I restarted the ...
0
votes
0answers
74 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
28 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 ...
0
votes
0answers
56 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
0answers
84 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) ...
0
votes
0answers
483 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 ...
0
votes
1answer
30 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 ...
0
votes
1answer
33 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 ...
0
votes
0answers
72 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
26 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
203 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", ...
0
votes
0answers
39 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
0answers
50 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:/...
0
votes
0answers
141 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
43 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
335 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
164 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
286 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 ...
0
votes
1answer
50 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 ...