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

PiCamera Module V1.3: Effects of Not Performing Automatic Gain Control (AGC)

I know that the automatic gain control (AGC) is performed every time the PiCamera is initialized to allow the analog_gain and digital_gain to settle to suitable values according to the documentation (...
-1
votes
1answer
27 views

Install Pytorch to RPi (x86? arm?)

I recently study about running some Deep Learning codes on RPis(Rpi 3) so I tried to install Pytorch 1.4.0 on them. However It is quite tough job to do as you may know. I'm so sick of installing ...
-1
votes
2answers
54 views

Keyboard with rc.local

I Have written this python program for my pi. print("CC ACTIVATED") import lcddriver import time import subprocess display = lcddriver.lcd() try: display.lcd_display_string("CC... &...
0
votes
1answer
26 views

Why can I run a python script accessed per php file that is accessed per cmd WHILE I can't run the same thing accessed per browser?

Hello ladys and gentlemen :) I got a python script py.py that switches a GPIO (works perfectly when accessing per cmd line). I got a php file php.php in which I access the py.py file (works perfectly ...
0
votes
0answers
26 views

How to reshape the output stream of the script to make it work for a cvlc stream using Python?

stream.py needs to be changed: import sys import cv2 from picamera.array import PiRGBArray from picamera import PiCamera import time RES_W = 640 RES_H = 480 camera = PiCamera() camera.resolution = (...
1
vote
1answer
24 views

Run a subprocess in administrator mode

I'm trying to add a wifi network on the raspberry pi via bash inside a python script. I want to run a subprocess in administrator mode inside a python application, does anyone have any suggestions to ...
-1
votes
1answer
34 views

Compile exe for Windows using Wine [closed]

I'm trying to use Wine on my RP4 to compile a script as a Windows Executable. Unfortunately I'm not able to install Python 3 on Wine. I could not find any guide on installing python in wine on a RP ...
1
vote
1answer
35 views

RGB LED - Only first color activates when multiple colors are called

I have one RGB LED (common anode type), and while I can get every color to light up independently I am seeing some bizarre behavior when trying to combine colors. This is my first project involving ...
0
votes
1answer
51 views

Run python script on startup and wait for keyboard input [closed]

I know, I know, it looks like the 1000th question about the same thing, but I have tried almost every answer I came across here about running scripts on startup, but they fail to meet my particular ...
1
vote
1answer
38 views

How to reduce the polling frequency of the w1-gpio module on an Raspberry Pi?

I would like to know how to influence the polling frequency of a device on the w1-gpio module. The reason is because I have a DS18B20 temperature sensor on a Raspi that reads too hot. The first thing ...
0
votes
0answers
31 views

Load cell changing over time

I'm using a 1kg load cell beam (see example at bottom) connected to a HX711 board then connected to the Raspberry GPIO. I'm running this Python3 code: https://github.com/gandalf15/HX711/blob/master/...
0
votes
0answers
36 views

How to quit an automatically run script on startup in Python Kivy?

I run a script at startup with the command line @lxterminal -e /home/pi/Desktop/Python3/myApp.sh in the file /home/pi/.config/lxsession/LXDE-pi/autostart which I created with nano, not with sudo nano ...
0
votes
1answer
16 views

Can't append python prints to a file if the .py program is running in the background

I have a Raspberry Pi Zero WH. I wrote a python program import time while True: print("test") time.sleep(2) At the system prompt, /usr/bin/python3 test.py prints fine to the screen. /...
1
vote
1answer
524 views

Updating Python 3.7 to 3.8 [closed]

I recently updated my Raspberry Pi with sudo apt update and sudo apt full-upgrade to the system. Even if Python 3.8 is out, when I run python3 in terminal, it shows me version 3.7, instead of 3.8. Why ...
1
vote
0answers
26 views

How to make python3 aware of manually compiled opencv?

all this is on a 4Gb RPi 4GB. I compiled opencv from source following this guide and it built and compiled ok. Running opencv_version reports 4.4.0-dev. But in python3 when running import cv2 it says: ...
0
votes
1answer
50 views

Converting from RPi.GPIO to circuit python digitalio

I didn't write this code (just made some modifications) but it was using a depreciated library so I'm trying to update to the official circuit python libraries and update everything for python3. This ...
0
votes
0answers
22 views

How to control GPIO pins using python CGI library

I am trying to create a web app with python cgi, cgitb libraries that would be able to interact with the GPIO pins. The application has an html form with a textbox and a submit button. The script can ...
0
votes
1answer
103 views

raspberry pi captive portal

I have created a python flask script that runs on my raspberry pi, I have also configured rpi to switch to access point so when my laptop/mobile gets connected to the AP, I can navigate to the IP '192....
0
votes
1answer
47 views

Wierd output in python from serial connection output

Output: b'00000-000000\r\n' b'450302198011281530\r\n' b'' b'' b'+\x00--To--\r\x12-\x00000800\r\x12-\x00000800\r\x12' b'-\x00000800\r\x12-\x00000800\r\x12' b'-\x00000800\r\x12-\x00000800\r\x12' ...
0
votes
0answers
46 views

vlc python does not play a video in hdmi2

I want to run a video in my second monitor/projector using vlc pip3 install python-vlc and python3 in Raspberry Pi 4. I set the Fullscreen Video Device to HDMI-2 Tools --> Preferences --> Video -...
1
vote
1answer
79 views

Connecting an Arduino Nano to a Raspberry Pi using Serial Cable on an a Pi 3B+ or Zero W

I wanted to connect an Arduino Nano to either my Pi 3B+ or my Zero W preferably my Zero. When I connected my Nano to my Pi Zero and ran a simple script with the python 3 serial library, it didn't work....
0
votes
0answers
55 views

“wlan0: carrier lost” untimtly WiFi deconection on raspberry pi 3b+ and pi0 W

I am facing this bug since few days. I am using: Rpi 3b+ or Rpi0W, Buster-lite with last update, Kernel : 4.19.118+ I using Ubiquti WiFi AP and dnsmasq for managing the lan, both working normally with ...
0
votes
1answer
86 views

No module named 'gi'

Recently i have installed Altinstall Python 3.8.0 in /usr/bin. However when i try to from gi.repository import GLib i get: ModuleNotFoundError: No module named 'gi' I have tried many ways (...
0
votes
1answer
30 views

Calculate Accurate Distance Traveled with GPS in Python [closed]

I am trying to update distance traveled between GPS coordinates. My error is that the GPS can move short distances while sitting still. I am currently simply adding the new coordinates to a list every ...
0
votes
0answers
49 views

I2C, SPI and Python Libraries with Raspberry Pi 4b

I've been working with RPi.GPIO so far but I have had issues with PWM and edge detection, which are well known issues with RPi.GPIO, anyway, after some research I'm considering using a different ...
0
votes
0answers
25 views

Playing videos based on GPIO input Python

I am making a Raspberry Pi(with model 3B) video player that pays a video when an button(from GPIO) is RELEASED. So what I would like to do is when a button is released the video would play. And when ...
1
vote
3answers
69 views

Running Toy Motor circuit with Pi's 5v

I am currently going through the tutorials included with those kits that you can get for the Pis with breadboards and components, etc. Anyway, in the tutorial, I am making the following circuit: In ...
0
votes
1answer
34 views

raspberry pi access point status

I have created an access point on my raspberry pi, now I wish write a python program to check if an access point has been created or not? is it possible to know through command line or python library....
0
votes
1answer
33 views

Controlling LED using PWM

When I run this code I’m expecting to get a led that brightens but I get a led that dims. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(11,GPIO.OUT) dc=0 LED=GPIO.PWM(11,...
0
votes
0answers
44 views

Bus error raspberry pi

I have a function make_model() which works fine everywhere and I ran it on my raspberry pi in the morning and it worked fine but now it gets the following error: Using TensorFlow backend. 2020-07-11 ...
0
votes
1answer
77 views

Raspberry pi 4 bluetooth file transfer rate [closed]

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
1answer
110 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
14 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
33 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
37 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
86 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
45 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
72 views

Getting Memory Error while installing tensorflow in raspberry

Memory Error while installing tensorflow in raspberrypi-buster
0
votes
0answers
9 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
34 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
22 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
75 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
29 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
632 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
27 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
26 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
32 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
36 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
88 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
43 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 ...

1
2 3 4 5
9