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

Raspberry pi 4 bluetooth file transfer rate

I am new to raspberry pi so please forgive me if I ask a silly question. What I am trying to do is send files from my windows 10 laptop to raspberry pi with raspbian OS, I was able to send some data (...
0
votes
0answers
11 views

Bluetooth library for Raspberry Pi

Based on this update of the author of bluepy https://github.com/IanHarvey/bluepy/issues/403 it looks like it will take some time before it is updated or might be abandoned if there is no further ...
0
votes
0answers
21 views

Emailing with python problem [closed]

I'm trying to send emails with claws mail through python. I used to do that with google, but they give me grief about logging in with a non google app. This is the code I tried: # instance ...
0
votes
0answers
12 views

picamera module save video periodically

I would like to record video to a file using the picamera module, and "save" the file every few seconds so that in the case of a power outage the video is partially saved, instead of being ...
1
vote
1answer
29 views

How can I track the version of Python in Raspberry PI O/S

I'm trying to keep both a Mac (Mojave - 2.7.16 by default) and a VM Raspberry Pi Desktop up to date with Python so that it matches that on the Pi but other than firing up a Pi and running python3 --...
0
votes
0answers
35 views

Using datetime how can I trigger a change based on the minute of the hour?

I'm trying to edit a Python script that works perfectly - except I want to change one variable and I can't figure out how to do it. The script plays a set of mp3 files in a directory. The script ...
0
votes
2answers
34 views

Using PWM with RPi.GPIO in Python

Scenario: I want to control a PC fan using the Raspberry Pi. The 4-wire-fan (MGT9212UR-W25) has its own power supply (12V) and can be controled via PWM. I would like to control it with a Python script ...
0
votes
0answers
33 views

raspberry pi notorious problem = cannot find INSTALLED module

could not use module keyboard, i have check using python3 -m pip list to check the pip packages that i have installed and i saw that i have installed keyboard 0.13.5 , however after i execute this ...
0
votes
1answer
31 views

Getting Memory Error while installing tensorflow in raspberry

Memory Error while installing tensorflow in raspberrypi-buster
0
votes
0answers
8 views

Debugging / analyzing: no sound output on Pi Zero. Running PyAudio

I have written a python-based audio servo controller that runs on a Raspberry Pi. It takes input from either .wav files or a microphone, analyzes the chunks of the stream to get the volume of each ...
0
votes
1answer
30 views

Performing multiple separate actions in Python with callback to main class instance

I am making a smart nightstand using a Raspberry Pi and Python. It should be able to: Have settings being controlled by a mobile app communicating through TCP requests to the Raspberry Pi Have an ...
1
vote
1answer
20 views

Exceptions not caught properly in while loop [closed]

I am trying to implement a RESET button, so when pressing the button, the code restarts. However, I am getting some strange behavior. First I tried raising a custom Reset Exception: class Reset( ...
0
votes
1answer
43 views

PiCamera 1.13 docs MMAL example problem

I am trying to lower the time to capture a still image from the Pi camera (I have a V2 and HQ). To this end, I have found my way to the PiCamera 1.13 docs, specifically chapter 16 dealing with the ...
0
votes
0answers
21 views

when_pressed and when_released functions in gpiozero not working

I have the following code, and I cannot figure out how to make when_pressed and when_released work. The callback functions just do not run to the press and release. On the other hand, properties such ...
0
votes
1answer
115 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
24 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
19 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
61 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
1answer
38 views

Issues with Throttle Control on ESC with RPi 3B+

I am using the 30A BLDC ESC to control a brushless motor from my Raspberry Pi 3 B+. The documentation for the ESC can be found here: ESC pdf I seem to have successfully calibrated the ESC, but after ...
0
votes
0answers
34 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 ...
1
vote
1answer
28 views

Importing Data from MFRC522 to MariaDB via. raspberry pi 3

can you please assist me on python scripts that can import DATA FROM AN RFID READER (MFRC522) TO A MariDB DATABASE using a Raspberry Pi 3 B+?
0
votes
1answer
22 views

Installing Python Modules globally using pip

I'm doing a Udemy course using Python, and I recently created a fresh copy of Raspian for my Raspbery Pi 3B+. I have attempted to install the module pyfiglet, and used the terminal command sudo pip ...
2
votes
1answer
46 views

While loop bahaviour with rgb LED

I'm comfortable with the physical side of circuitry etc but a total newbie at python so I've been messing around with a Raspberry Pi 4B and python 3 to help me understand how to control various ...
0
votes
0answers
22 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
1answer
50 views

Can I upgrade my Python version with miniconda on Stretch or do I need to upgrade OS?

Need some advice here. I have an old RPI 2B with ARMv7 Processor rev 5 (v7l) running Raspbian GNU/Linux 9 (stretch). At the moment it's got python 3.4.3 and a lot of other packages installed with ...
0
votes
1answer
420 views

vcgencmd not found

Recently, i installed ubuntu server 20 64bit on Raspberry pi 4 B+ 4GB model, and youtube is laggy so i searched a bit and installed raspi-config and tried to change memory split setting but it says i ...
0
votes
0answers
24 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
1answer
71 views

pi 4B ubuntu 64 bit - Is it safe to pip install packages from 32 bit added repo, for a 64 bit python3, if that package not in the default 64 bit repo?

Having reviewed this on May 16, I conclude it is too much of a mashup of several questions I had in mind. Therefore, today I have resolved to edit again. Until that edit is complete, please pardon ...
0
votes
0answers
43 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
41 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 ...
2
votes
0answers
99 views

ALSA errors on raspberry pi 4

So i'm trying to make a virtual assistant on a raspberry pi 4. I have coded the bot to work on my windows machine but now I'm running into errors while using the raspberry pi I figured out which part ...
1
vote
2answers
44 views

python code runs fine outside, does nothing on Raspberry Pi

As the title suggests, I have a code that runs perfectly on my laptop. It connects to my solar inverter, grabs the information, and writes(appends) them to a CSV file. When I run the same code ...
0
votes
1answer
43 views

blynk for python3

I run this command to try to install Blynk for python on my raspberry pi. I want it to get it working for python3 but when I tell python to "import BlynkLib" it can't find the module. Can someone here ...
0
votes
0answers
20 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) ...
1
vote
1answer
375 views

Unable to pip install librosa in raspberry pi 3 model b+ (Raspbian stretch)

Respected people, Attempt 1: when I run the command, pip3 install librosa I am stuck here, Running setup.py bdist_wheel for scipy ... \ It was taking more then 2 hours but it was still ...
1
vote
1answer
24 views

Setting a GPIO port for an accurate time duration with Python

I am trying to set a GPIO port to LOW for n seconds and set it to HIGH afterwards. The problem is that it's not at all accurate. It varies between a small number of seconds to 2*n or even more. ...
0
votes
1answer
45 views

No module named RPI after install

sudo apt-get -y install python3-rpi.gpio I used the above command to install the package, it shows that is already the newest version, however i still get the error no module named RPI. Anyone has ...
1
vote
0answers
40 views

How to run “ import serial” and “import cv2” in one python file?

I am actually creating my project wherein I can control my raspberry pi in my pc using FPV Radio Telemetry. The scenario is my pc will send string data like "red" and "blue" to my pi. After my pi ...
0
votes
0answers
35 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
95 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 = []...
1
vote
0answers
64 views

pigpio hardware PWM for servos

My goal is to build a pan/tilt system. this works fine: import pigpio pi = pigpio.pi() pi.set_servo_pulsewidth(13,1055) 2 questions: is pi.set_servo_pulsewidth using hardware PWM (I prefer HW PWM) ...
1
vote
0answers
31 views

Change Default Microphone

I am having trouble changing my default mic on raspbian buster lite (kernel 4.19.36 on the 3B+). I know that the mic is fully functional because when I run: arecord -D plughw:1,0 --duration=3 test.wav ...
0
votes
0answers
60 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
1answer
37 views

Connecting bluetooth keyboard automatically at boot

I made a raspberry pi robot that you can control with the keyboard and I want to use my bluetooth keyboard with it. The python program automaticley starts. I used /etc/rc.local to do this. #!/bin/sh ...
0
votes
0answers
52 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 ...
1
vote
0answers
30 views

GUI with tkinter, 2 buttons touched together

Have written a GUI (touchscreen) for my Pi in Python 3 with tkinter. It works in fullscreen. I do not want to have an extra button for shutting down the Pi but when I push 2 buttons together. How can ...
1
vote
2answers
58 views

Error with apt-get and anything that runs python3

I have an issue with apt-get and any script I will call python3 on my Raspberry running Raspbian Buster. When I run apt-get upgrade (or apt-get dist-upgrade or apt full-upgrade) this happends every ...
0
votes
1answer
74 views

Increase sleep interval for LED sequence whenever button is pressed. (Python)

This is the code: #!/usr/bin/python3 from time import sleep from gpiozero import LED, Button from threading import Thread from signal import pause, signal, SIGTERM LEDs = [5, 17, 22, 19, 26] LIGHTS ...

1
2 3 4 5
9