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
2answers
23 views

Pyserial, Python3, and RPi not working together

I'm trying to get a TTY to USB converter hooked up with my Raspberry Pi. I'm using Pyserial to setup the connection and write data to the port in a script called pc_test.py. For some reason the script ...
0
votes
0answers
27 views

Not Able to Change Volume with Cron (tried Python)

Alright, I've been trying this for several days and I'm just dying here... I am putting together a kiosk that should play video. I'm using a NUC with Raspberry Pi Desktop. Everything works but ...
0
votes
0answers
17 views

Raspberry Pi 4 b+ with SIM900A Module Error

I'm working on a project that includes send a SMS message. I have tried connecting my raspberry pi with sim900a. Having problems with communication with sim. I've tried using AT commands with minicom ...
0
votes
1answer
48 views

Raspberry Pi Zero W taking 38 seconds to boot, how can I speed it up?

I'm using Crontab to start a python file with the code: @reboot sleep 5 && Sudo python3 /home/pi/file.py The file uses the internet to retrieve some JSON data and display it on a screen ...
0
votes
0answers
41 views

How to control door opener from raspberry pi?

I am trying to control a 6V DC door opener which requires 660 mA current supply. Since the Pi only tolerates a maximum of 5V without a relay. As per my research I need a solid-state relay with ...
5
votes
1answer
89 views

raspberry pi 4 using SPI 4 & 5 at the same time causes kernel oops and crashes the whole system

intro i want to use multiple SPI busses at the same time. but when i use to use SPI 4 and SPI 5 at the same time it crashes the whole system it doesn't crash instantly sometimes it takes 10 seconds ...
0
votes
0answers
6 views

is that a way we can boot Fast Compute module 3+ using QT5 Application on start

i am working on compute module 3 plus. and os is respbian buster. I need only wifi and usb services . so please could you please help me how can i boot the fast. because compute takes more than 20 sec ...
-1
votes
2answers
88 views

Raspberry pi 4 gpio pins not working

My Raspberry pi 4 gpio pins are not working for some reason I tried uninstalling and reinstalling rpi.gpio and gpio and it did not work here is the code import RPI.GPIO as GPIO import time led = 26 ...
0
votes
0answers
32 views

How to enable guests to join a captive portal in a new local network?

I am reading online tutorials about setting up captive portals for my raspberry pi using python, they all require an active internet connection to setup. My question is: If I setup the Pi in my own ...
0
votes
0answers
27 views

i need execute code when user input number in terminal in python3

I have this python3 code. import RPi.GPIO as GPIO import requests payload = {} headers = {} GPIO.setmode(GPIO.BCM) GPIO.setup(14, GPIO.OUT) string = input() def buclick(event): url = "http:/...
-1
votes
1answer
44 views

How can I use pigpio to "sniff" and collect data exchanged along an existing USB connection between two devices?

A controller module (power supply) for piece of scientific equipment in our lab uses a Windows program on a PC for a human interface via USB connection. I have a list of the "set" and "...
0
votes
1answer
62 views

How to transfer large amount of data (100Kbytes) over SPI?

Related/previous question here. I'm looking to do a data logging project that involves transmitting data from an FPGA to a Raspberry Pi 4 through SPI. The FPGA will transfer 250,000 bytes ...
0
votes
0answers
12 views

how to install onnxruntime on raspberry pi 3 [duplicate]

I want to setup onnxruntime python library on raspberry pi 3 and I tried some ways to install it but I couldn't . the ways that I followed are : 1 - way1 2 - way2 3 - using pip3 I want to know is ...
0
votes
0answers
36 views

HELP - Bluetoothctl Scan in Python3

I'm new to python and with bluetoothctl and I need to automate the bluetoothcl scan on process in python so that I just need to open the python file and start scanning right away. I've been doing a ...
0
votes
4answers
154 views

Crontab won't run python script

I'm trying to run two simple python scripts from crontab: crontab file: @reboot /usr/bin/python3 /home/pi/init_server.py @reboot /usr/bin/python3 /home/pi/scheduler.py crontab log: Aug 12 10:07:11 ...
0
votes
1answer
24 views

Servo control issue

I have written a small program that controls two servos: to start the recording process one servo opens a shutter (servo1), then the second one lifts a sky camera out of a housing (servo2). To stop ...
0
votes
0answers
13 views

Calling pulseaudio: paplay - p record.wav from python script doesn't work

Objective: run a wav file from python on a Bluetooth headset paired to the raspberry Pi. So far my code works well when I run it on the raspberry pi in python. Once I call the same python script from ....
0
votes
0answers
43 views

PIP3: Install Offline & Update Older Library

Tried these commands to install an uncompressed package with pip3: pip3 install --no-index --find-links=/home/pi/Downloads/GitHub/cryptography cryptography sudo pip3 install -U --no-index --find-links=...
0
votes
0answers
24 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
25 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 ...
0
votes
1answer
29 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
23 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
18 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
48 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
66 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 ...
0
votes
0answers
30 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
19 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
60 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. ...
0
votes
0answers
156 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
31 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
12 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
21 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
106 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
196 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
21 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
2answers
133 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
23 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
39 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
60 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
56 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
78 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
29 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
56 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
24 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
38 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
162 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
18 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
110 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
279 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
120 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
2 3 4 5
11