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

problems installing deepspeech on a pi 4

Ive been trying to get Mozillas deepspeech installed but i keep running in to the same problem. here is the terminal output pi@raspberrypi:~/dev/deepspeech $ pip install deepspeech Looking in indexes: ...
0
votes
0answers
28 views

Generate Barcode in python [closed]

I wish to generate barcode from a string by using Python program in Raspberry Pi. I encounter the issue below even I am testing with sample source that I found online. This is the sample source: from ...
0
votes
1answer
57 views

Pi Camera 1.3 not detected despite v4l2-ctl listing it

Before you say that I haven't searched the internet, whenever I type "pi camera not detected" I literally don't see a single unclicked result. I am slowly breaking apart. PI 4 (8gb), V1.3 ...
0
votes
0answers
21 views

How to setup webserver?

Good day, I know this has been asked A LOT, but everything I've tried doesn't work at all. I've tried using Geany and python code to create the webserver as well as apache2, but neither of them work. ...
0
votes
1answer
14 views

RF433 Rpi Serial cannot read signals in Python

I am running this code. import serial import time serialport = serial.Serial('/dev/serial0',baudrate=1200, timeout=3) t = "ttt" while True: serialport.flush() serialport.write(t....
0
votes
0answers
17 views

Unable to open pycharm on raspberry pi 4

when i type ./pycharm.sh in terminal it throughs the following error: "Error occured during intialization of VM java/lang/ClassFormatError: Unknown constant tag 101 in class file java/lang/...
-1
votes
2answers
86 views

How can I resolve this error? SSLError("Can't connect to HTTPS URL because the SSL module is not available.")

I can't figure this out. I've now researched and tried for hours but I can't solve this so hear me out. I have a Raspberry Pi 3 B+ and installed Raspbian OS on it. Raspbian came with Python2.X and ...
0
votes
0answers
39 views

picamera: Incorrect buffer length error when resizing in picamera.capture

I am trying to use picamera to record and save a high resolution video, and capture low resolution images for processing using openCV. import picamera import picamera.array import cv2 import numpy as ...
0
votes
2answers
38 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
32 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
1answer
24 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
62 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
44 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
92 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
114 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
34 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
28 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
67 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
128 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
13 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
45 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
256 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
25 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
18 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
44 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=...
1
vote
0answers
27 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
35 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
30 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
25 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
20 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
51 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
75 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
35 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
21 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
66 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
213 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
41 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
14 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
125 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
241 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
22 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
160 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
78 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
59 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
82 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 ...

1
2 3 4 5
11