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

Raspberry Pi Python 3 Script - RuntimeError: Failed to add edge detection

I have looked at all the posts about this error, but none have cured it for me. I am using a ChronoDot RTC on an old Pi B+ with the SQW Wave Output going to Pin 8 which I use to update an LCD display ...
0
votes
1answer
15 views

How to run root in autostart

I have successfully launched a python script using "LXDE-PI" autostart function, however, this script needs to run as root in order to function correctly. How can I do this? Where would I ...
1
vote
1answer
26 views

python3 code doesn't write files when opened with rc.local

i coded a small datalogger in python3 that gets readings from an Arduino and stores them locally. The code works if i open it manually, but as soon as i reboot and code runs from rc.local it stops ...
1
vote
0answers
19 views

heartbeat sensor for pi

i want to measure the heartbeat using the pulse sensor. i connected the pulse sensor to a mcp3008 adc and the pi. this is the code i used from pulsesensor import Pulsesensor import time p = ...
0
votes
0answers
15 views

Cmake : interpreter and numpy virtual environment path problem

I am trying to install OpenCV 4 on a Raspberry pi b+ flowing this Article , Everything looks good until i come to Step #5 the outputs of cmake are different, even though i followed the previous steps ...
-1
votes
1answer
47 views

How to UNDO unwanted changes on my raspberry pi 4. Bash_profile not found

Updated Question. I was trying to add this directory "/usr/local/opt/python-3.9.0/bin" to PATH on raspberry pi 4 and so I edited the bash file by adding the line: PATH = "/usr/local/...
0
votes
1answer
45 views

Using Pymodbus, I want to tie coil states to GPIO pins within my server not from a client

I am writing a PyModbus asynchronous updating server based on the example on the Pymodbus Asynchronous Server Example and I want to link the states of the coils to GPIO pin states, such as when coil 1 ...
1
vote
0answers
27 views

error: (-215:Assertion failed) !empty() [closed]

I'm trying to run a python code that's associated with using OpenCV library. I'm also a mere beginner. I'll show you the code and the error it gets when executed. Any comment will highly be ...
0
votes
0answers
25 views

AttributeError: 'module' object has no attribute 'FFI'

I am trying to set up Picovoice's Rhino to my Raspberry Pi Zero W. I have followed all the instructions on the website: link My RPi uses Python 3.4.2. I have updated the packages using: sudo apt-get ...
0
votes
0answers
16 views

Receive pycam video from socket and save to file or process it

I tried using the pycam documentation 3.13. Recording to a network stream where the client is the pycam that sends H.264 video over a socket and the server incrementally reads a file-like object and ...
0
votes
1answer
43 views

Raspberry pi zero don't see i2c device

I try to connect to raspberry pi zero by i2c bus 3 different devices: 3 accelerometers mpu6050, 1 barometer BMP280, 1 compass QMC5883L. The mpu6050, BMP280 and QMC5883L have a different addresses. ...
1
vote
0answers
51 views

Unable to import pyserial or serial in python 3.4.2

I am not able to import pyserial or serial module in a python script. Package is properly installed (I think) using the following commands: sudo apt-get install python3-serial pip3 install pyserial --...
0
votes
1answer
23 views

Systemd service not updating

I have a service on my Raspberry Pi which runs a bash file on boot. I recently updated the bash file (run.sh) but the service is not reflecting the update. So far I have tried: sudo systemctl disable/...
0
votes
0answers
10 views

using the # key to work as a enter button for 4x3 matrix keypad

I am doing a project where I require the user to enter the value on a keypad. this value is then given to the pi. I was using the pad4pi library function but I could only select a single digit ,is ...
0
votes
1answer
18 views

Autostart random video script throws IndexError

I am trying to autoplay a random video from an attached usb volume upon boot on my Pi 4 Model B Rev 1.2. The following Python 3 script works within Thonny, popping a Tk message box with the randomly ...
0
votes
1answer
64 views

Cron python job not running

I tried to automate the launch of a python script. After having tested it works in thonny, I moved to Cron and I got quite lost. I started from calling 12 21 * * * /usr/bin/python3 /home/pi/main.py to ...
1
vote
1answer
44 views

PiIR TypeError: unsupported operand type(s) for /: 'NoneType' and 'float [closed]

I use the PiIR module to record infrared light buttons and it works. But when I use piir play I get the following error. Does anyone know how fix that? Keep in mind: I use Python 3.7 and PiIR 0.2.4 ...
0
votes
0answers
20 views

Temperature and Humidity does not print on LCD

I am working with a DHT 11 and LCD. When executing the code, the temperature prints one time on the pc and freezes. It does not print on the LCD though neither. Can I have someone assist me with ...
1
vote
1answer
81 views

Trying to debug why the magnetic sensor of my MPU9250/6500 Gyroscope Acceleration Magnetic Sensor won't connect via I2C but all the other sensors will

I am trying to debug why the magnetic sensor of my MPU9250/6500 9-Axis 9 DOF 16 Bit Gyroscope Acceleration Magnetic Sensor IIC/SPI won't connect to my Raspberry Pi 4+, but all the other sensors will. ...
0
votes
1answer
18 views

Understand the plumbing behind running RasberryPI code from Freenove in Python

I have downloaded some pre-made code from Freenove - https://github.com/Freenove/Freenove_Ultimate_Starter_Kit_for_Raspberry_Pi Freenove uses WiringPi. So I downloaded WiringPi and ran build. Question ...
1
vote
2answers
37 views

Take Serial (tx/rx GPIO) Input with script running at startup

I've run lots of cron jobs and have set up scripts to run at startup. I assumed this would be an easy task because maybe I'm missing something. I have a script that when it sees a specific message ...
-1
votes
1answer
43 views

ImportError with Google Text-to-Speech(gTTs)

I am getting an error when trying to import gTTs for python 3.8. I have to use 3.8 for my project I am working on. ` I entered in from gtts import gTTs when I do this I receive an erro saying: ...
1
vote
0answers
53 views

GPIO pins not working properly

i've recently started a small project where i want to controle an LED-strip with an webapp using a respberry pi. While the webapp works perfectly fine, i ran into a problem with my pi zero w. Since ...
0
votes
0answers
59 views

Install pygame with miniconda3 on Raspberry Pi 4

Probably the solution to my problem is easy, I just do not have enough knowledge to solve it. I have a Raspberry Pi 4 with Raspberry OS on it. It comes with python 2.7 and 3.7 preinstalled and they ...
0
votes
1answer
26 views

Python - How to automaticly open first available serial port (COM/tty) [closed]

I am new at Python and I want to learn serial communication between Raspberry and other devices like PC, arduino, sensors... I often plug and unplug devices like arduino, FTDI, etc. to COM port... I ...
0
votes
1answer
38 views

Error when installing acconeer-python-exploration

I am trying to install this on my Pi https://github.com/acconeer/acconeer-python-exploration . There are some requirements written in the file requirements.txt that need to be installed first. I've ...
0
votes
0answers
23 views

Minecraft Raspberry Pi Player Position

the following code shows an if statement under a while loop where its getting the player position every time the player isn't at the specific block but when the the player goes on the specific block ...
-1
votes
1answer
37 views

What's the best way to remote control a Raspberry pi - powered robot? [closed]

I'm going to build a robot powerd by raspberry pi and i wnat to control it remotely, the principal tasks that need to have a remote exchande of data is: the streaming of 3 cameras the monitoring of ...
1
vote
0answers
85 views

Installing PyQt5 for Python 3.6.2 on RPi has missing file errors [closed]

I am trying to install PyQt5 on an RPi 4/ 4GB for use with the Oasis 3DP controller software: https://hackaday.io/project/86954/instructions?page=2 To do so I've had many problems trying different ...
0
votes
0answers
17 views

ltp305 Dot Matrix Python Library not allowing me to use display.set_character()

I am trying to display a number on a Dot Matrix ltp305 display that increases with each button press, enabled by the pressing of a normal button connected to the GPIO. I am sure everything is ...
-1
votes
1answer
56 views

Programmable ws2812 LED fail to light up on Pi Zero

I have hooked up a programmable ws2812 LED . The Datasheet says "Default power on does not light up" Using the hook up guide and a breadboard I have a single LED where ... DIN is attached ...
0
votes
0answers
255 views

AttributeError: 'NoneType' object has no attribute 'send' for my LED on off code through blynk

I am trying to run a cod for LED on and off through blynk app but every thime it is showing this error: AttributeError: 'NoneType' object has no attribute 'send' my code is import RPi.GPIO as GPIO ...
0
votes
1answer
58 views

Python print output not shown in Thonny (version 3.3.5), Python 3.7.3

When running program below, the first line ("Hello World") is shown in the shell output. Also, the Bluetooth connection is working fine (I can send "0" and "1" and they ...
1
vote
0answers
29 views

Redirecting log entries - where have I gone wrong

On a Pi Zero, I have two python scripts set up as systemd services. Each has a .service file in /etc/systemd/system. Each has a .conf file in /etc/rsyslog.d that is intended to redirect syslog ...
0
votes
1answer
28 views

Issue with installing Circuit-Python-GPS along with Blinka — incorrect version of Python

I am using a Raspberry Pi 3 B+ with nthe latest version of Raspbian (version 9). I have recently purchased the Adafruit Ultimate GPS Breakout for a project that assists Blind users around their ...
-1
votes
1answer
104 views

Can't connect to pigpio at localhost(8888) Can't create callback thread. Perhaps too many simultaneous pigpio connections

Have connected DHT11 to Rpi4. VCC--pin 1 datapin--gpio4 Ground pin--pin 6 It works fine fine but after giving the result for few times then I get this error. New to pigpio please do help me figure out ...
0
votes
0answers
57 views

Error when trying to run python scripts

I've been trying for a while now to run python scripts and everytime i try i get an error saying some package is missing. My conda environment path is set to: root /home/pi/miniconda3 where root is ...
0
votes
2answers
308 views

Raspberry Pi DHT 11 sensor not working.I get None None

Have integrated Raspberry pi4 with a DHT sensor. The data pin is connected to pin GPIO 26 Have tried connecting the VCC to both 3.3V and 5V Have tried with both Adafruit_DHT.DHT11 and Adafruit_DHT....
0
votes
0answers
321 views

What is ConnectionError Failed to establish a new connection: [Errno -2]?

I am running a 6 script and they are running at different timings using systemd service and timer. Each script access the same url at least once. When I check the log file of some scripts, they are ...
0
votes
1answer
34 views

Shutting down a LED when a script fails

I have a python3 script which is started by systemd automatically on boot. This script turns on a green LED to signal that the script has started. Now I want the LED to turn off if the script fails/...
0
votes
2answers
56 views

Controlling a light with two inputs (PIR and a momentary switch)

I am new with Python and not sure how to integrate the following. I have a setup where I am trying to control an LED strip for under-counter lighting using python and GPIO-Zero. The PIR activates the ...
0
votes
0answers
122 views

PySide2 not seen by pip

I'm trying to install PySide2 on my RPi 4, and, although the installation was successful, pip3 doesn't recognise it. This then causes issues when installing other packages relying on PySide2. I ...
1
vote
1answer
422 views

Raspberry pi interfacing with AD8232 using python

I have already seen the other post but I want a python code through with I can connect my raspberry pi and ECG sensor ad8232 I am totally new to raspberry pi interfacing so I don't completely ...
0
votes
1answer
83 views

RPi.GPIO: multiple buttons one callback function, ignore buttons while callback is executing

I have 4 buttons connected to my Raspberry Pi that call the same function when pressed. I'm using GPIO.add_event_detect to connect the buttons to the callback function. When one button press executes ...
0
votes
0answers
23 views

Trying to Run Python Scripts on the Pi remotely using bluetooth

I am trying to get a script that is currently on my Raspberry pi 3B+ to start using the Bluetooth on the Pi itself from my laptop. I have tried a few things, including pybluez (wouldn't run on my ...
0
votes
1answer
58 views

Raspberry pi cannot run an executable file created in Python

I' m new to Raspberry Pi and I created a file with the code: from tkinter import * from PIL import Image, ImageTk import board import busio from adafruit_as726x import AS726x_I2C import time import ...
0
votes
0answers
91 views

How can I make the Raspberry Pico not automount as USB storage while using Circuit Python

I am using Circuit Python on a Raspberry Pi Pico to give me hardware buttons for keyboard shortcuts. I am using Circuit Python as opposed to MicroPython because it has the USB_HID library. I don't ...
2
votes
2answers
130 views

How do I get Python 3 to work again on my Raspberry Pi?

I am running Raspbian on a Pi 3 that has one job: it runs a clock on a Sense Hat, from Python 3 source code. Recently I found I was unable to run my clock program, which generated an error stack that ...
1
vote
2answers
74 views

Problem running a Python3 script at startup with lxsessions

I have Raspbian Buster on a RPi4 and I was launching a Python3 based Kivy 2.0 app at startup. Since it is a GUI app that needs networking and bluetooth. The only way to make it work was an executable ...
-1
votes
1answer
93 views

gpiozero button to raise SystemExit / gpiozero clash with GPIO.cleanup()

TL;DR: Since this is a long question I have the following problems: I'm looking for a good way to use gpiozero Button to raise SystemExit upon button press I have an imported module to drive an E-Ink ...

1
2 3 4 5
11