Questions tagged [python]

Python is a general-purpose, dynamically typed, object-oriented high-level programming language. Interpreters for versions 3.x and 2.x come installed on the Raspberry Pi's most popular operating system distributions.

Filter by
Sorted by
Tagged with
3 votes
1 answer
198 views

Problem sending analog read values over serial

Ok I apologize as I have edited this quite a bit, but I have narrowed down the problem a bit more. For some reason I can't transfer values from my arduino analog pins?? I am trying to send values ...
0 votes
0 answers
5 views

Attributeerror :’ none type ‘ object has no attribute ‘add_widget’

File "/home/ecprmfg/Sterizone/medizone-pi/src/medizone-pi-kivy/usr/local/sbin /medizone-pi-kivy/main.py" line 92, in modules MedizoneApp().run() file "/home/ecprmfg/.local/lib/python3.9/...
1 vote
1 answer
1k views

NoIR V2.1 camera auto white balancing

I have a Raspberry Pi NoIR V2.1 camera. I am working with the NIR (940 nm) LEDs and I saw that I was getting funny/weird colors, so I assumed that it is due to the white balancing, so I switched off ...
0 votes
0 answers
28 views

Run 2 raspberries simultaniously with precise timing [closed]

For my project i would like to make 2 dataloggers with 2 raspberries that read out data simultaniously with very precise timing. I already have the code for one a logger, but i can't really find ways ...
0 votes
1 answer
3k views

pure python mjpeg streaming?

I tried the mjpegStreamServer from here but it doesn't seems to work... First of all, most times, after run it throws errors: — Exception in thread Thread-1: Traceback (most recent call last): File ...
1 vote
1 answer
531 views

Error when installing Flexget

Having some problems trying to install flexget. I get the following error when I run the command: pi@rpi:~$ sudo pip install flexget Requirement already satisfied (use --upgrade to upgrade): ...
0 votes
0 answers
22 views

how to run terminal commands with python [closed]

I am trying to run this terminal command from a python script export DISPLAY=:0 here is my code import subprocess subprocess.call('export DISPLAY=:0') I am getting this error Traceback (most recent ...
0 votes
1 answer
882 views

Use MCP23017 pin for read data

I just get an MCP23017 circuit and wired it to my raspberry pi like in datasheet. I am able to set pins for hight/low (tested with leds) using this code: import wiringpi as wiringpi from time import ...
0 votes
1 answer
566 views

Concurrent task handling on Raspberry Pi specific applications

I'm hoping that this is more relevant to the RPi exchange as a lot of my key concerns relate to issues with GPIO/PWM/serial bus usage with concurrency. I'm currently writing software for a robotics ...
0 votes
0 answers
20 views

RPI and SNMP with python script [closed]

I am encountering some problems that I need some help figuring it out what is going on. After creating an example given on another forum I decided to create my own OID on my Raspberry Pi SNMP service. ...
0 votes
0 answers
16 views

How to read files from a SD card connected to ESP32 an then transfer/upload/send them with Micropython to Raspberry Pi?

I am working on a project, basically my proposal consist in a solution designed under server/client paradigm, on host side I have mounted an Ubuntu Server 20.4 LTS (64 Bits) on a raspberry pi and ...
0 votes
1 answer
966 views

Raspbian Picamera web stream and record

I've been searching this for a while and I found a few posts that look interesting but it doesn't do what I really want. I am trying to set up a Raspbian security camera that records the video to a ...
0 votes
2 answers
36 views

How to set PWM to actual 0

I am controlling a stepper motor using PWM on a RPi 4 and python. The motor has a controller/driver (BLDC-8015A) that accepts 0-3.3V to set the rotational speed. According to the documentation, this ...
-1 votes
0 answers
26 views

apscheduler ModuleNotFoundError: No module named 'apscheduler.schedulers'

Hello i am trying to import apscheduler on my RPI but i always get an import error. I already have tried installing it with pip and pip3, and also installing previous versions (2.1.2) but i always get ...
0 votes
2 answers
258 views

Pi 4 not reading the QMC5883L magnetometer

I am trying to set up my magnetometer QMC5883L with my raspberry pi 4. But the pi is somehow not reading the magnetometer. I ran the command i2cdetect -y 1, but there is no detection. My connections ...
2 votes
1 answer
454 views

Control on-board led triggers from python

I know the trigger for on-board leds can be controlled from the command-line (or a script) I have a python program that I want to temporarily take over the system led blink it a little and return ...
0 votes
1 answer
64 views

Button.when_activated event is not firing even though Button.is_active is setting correctly

Thanks in advance! I am using a Pi 3B to detect activation of a sensor on my model railroad layout. The sensor by default only offers a rising edge detection scenario. I decided to go with gpiozero ...
0 votes
1 answer
91 views

How to transmit hand gesture data from a laptop to Raspberry-pi

I am making a hand gesture bot. In this hand gestures are detected from a laptop using image processing (used OpenCV & Python). I don't know how to transmit real-time output wirelessly of image ...
0 votes
1 answer
571 views

ShiftBrite - running on Python

I was wondering if anyone can help me out with converting the example Shiftbrite Arduino code into Python so I can run it on my RPi. Here is the example code in question: int datapin = 10; // DI int ...
0 votes
2 answers
684 views

mq5 gas sensor not alerting of leakages

I'm currently using an mq5 gas sensor in my kitchen with the MCP3208 ADC. my code shows a continuous loop of the voltage charge. in the mq5 as it detects gases in the air. It is supposed to print ("...
0 votes
1 answer
24 views

Using the microUSB Port over the 4 pin for Neo-6M GPS Module on Raspberry PI

Just a quick question, what is the difference between using the microUSB port over the 4 pins for data input for the Neo-6m gps module by ublox? or for any other sensor. Does this affect the current/...
0 votes
1 answer
18 views

Pass serial port readings on RPi to remote for automated testing

The objective of my current RaspberryPi test setup is to read from/write to hardware, and constantly monitor the state/log message stream for test scenarios. The testing code runs on the RPi, and ...
0 votes
2 answers
4k views

smbus write_word_data command

I am trying to use the smbus write_word_data command which takes three arguments addr, cmd, value - all of the documentation that I can find tells me that I need to specify cmd, but gives no clue as ...
0 votes
3 answers
1k views

Python Script that handles Bluetooth doesn't work when loaded on startup

Background I am using my Raspberry Pi B+ to control a 32x32 LED matrix and I am trying to send commands from an Android app to my Pi over bluetooth to display text on the LED matrix. I am using ...
0 votes
1 answer
862 views

Raspberry Pi - Press for on / Press for off switch

I've begun tinkering with using electronics and am also new to using Python. I was wondering if someone could help me please? What I'm trying to achieve is to use an on/off switch to run a motor - ...
0 votes
1 answer
280 views

Bullseye pipenv and Python 3.9 issues

I have a pipenv environment which uses Python 3.7. Version 3.7 is unavailable by default in bullseye so I have tried upgrading to 3.8 and 3.9.5 with no success. The virtual env fails to install RPi....
0 votes
1 answer
52 views

Audio cuts out periodically when using audio hat

I am currently live streaming some audio to and from a raspberry Pi Zero W using the waveshare audio hat however I have found that the audio periodically cuts out when I do this. When I used my logic ...
2 votes
1 answer
442 views

Pygame.mixer does not play sound when started in cron

I have written a small python script that plays a track after the press of a button (and ignores further button presses until the track has completed). The script works perfectly fine when started ...
0 votes
0 answers
35 views

python script does not start at boot

I follow this blog to the t to start a python script on startup. (Rasperi pi4B OS 64bit) my launcher.sh works fine she trying sh launcher.sh the file looks like: cd /home/pi/Documents PYTHONPATH=/home/...
0 votes
1 answer
23 views

launcher.sh behaves differently @reboot than calling with sh

I was send here from Stackoverflow. Thank you for your help. I am using a launcher.sh for a raspberrypi 4B with Raspi os x64 to start a python script in a python env on startup. But setting the ...
3 votes
1 answer
7k views

Red LED on the Camera is not turning off?

The red LED on my Pi Camera is not turning off. Does this mean the camera is still on even after the camera.stop_preview() command is executed? def setup_camera(): camera = picamera.PiCamera() ...
0 votes
3 answers
2k views

Using Gpiozero for Relay Device

I am writing a Python app on my RPi to manage an 8-port Sainsmart relay. All that I need to do operate a port on that relay is to change the state on a GPIO pin to either low or high. I cannot find ...
0 votes
1 answer
312 views

How to communicate between multiple Raspberry Pi using Python

I am looking to buy some Raspberry Pi computers to do various tasks. For example, maybe one could water a plant when requested. The part I am struggling to find help with is creating a server where a ...
1 vote
1 answer
947 views

py-spidev and ADNS3080

I have been trying a lot to deal with the flow-motion sensor but I couldn't arrive to a clear result. It might be I can't understand the procedure.. I'm using cs1 on raspberry Defining the spi by ...
0 votes
1 answer
6k views

Active Long Range RFID system for Raspberry Pi 3

I have bought those cards: UHPPOTE 2.4Ghz RFID Active Card for Long Distance Range Reader Vehicle Parking System. I need to buy certain RFID readers to be able to read data from those cards and work ...
0 votes
1 answer
101 views

OLED 128x128 is not displaying correctly the colors

I'm having trouble using the OLED SSD1351. I'm running python programs with the luma.oled library. When I run a program that uses colors, these are displayed incorrectly, red is displayed like blue, ...
0 votes
0 answers
24 views

Can I use the PI Camera Stream in Python on a PC and use OPENCV?

So I got a Raspberry Pi with the Pi camera and I would like to use the camera with OpenCV in Python. The problem is, I know I can do this easily on the Pi itself but I highly doubt the Pi will be able ...
2 votes
1 answer
751 views

Fullscreen GUI App on Raspbian startup

i'm working on a Simple DIY Home Control project Language is Python, and GUI is PyQT5 The project is just some ESPs connected to a main Raspberry Pi (3B+) controller The problem is that I'm trying to ...
0 votes
2 answers
50 views

Autostart python programm

i prefer ask you that i'm French ^^ So I will be very simple. I would like, when i start my raspberry a execution of my python file. That is to says, I want that when my pi starting the programm is ...
3 votes
1 answer
2k views

Raspberry Pi 3 & Arduino: [bluetooth.btcommon.BluetoothError: (112, 'Host is down')]

I am trying to send informations from Raspberry Pi 3 to Arduino Uno with bluetooth. I managed to connect the Arduino's bluetooth module with the Raspberry Pi. But I have this error when I execute my ...
0 votes
1 answer
368 views

Pigpio on callback get value

I currently have some code that I found that constantly outputs a value from a digital caliper. However, I want to modify this so that it is inside a function that can return that is returned from ...
0 votes
1 answer
172 views

unable to install drawnow package

when I try to install the drawnow package, there are some mistakes. I type sudo pip install drawnow it returns pi@raspberrypi:~ $ sudo pip install drawnow Looking in indexes: https://pypi.org/simple, ...
1 vote
1 answer
11k views

Can I use the PI Camera Stream in Python on a PC?

So I got a Raspberry Pi Zero Wireless with the Pi camera and I would like to use the camera with OpenCV in Python. The problem is, I know I can do this easily on the Pi itself but I highly doubt the ...
1 vote
1 answer
664 views

How do I get a list of only bluetooth audio devices?

I'm currently using pexpect in python to use bluetoothctl. I can get a list of all bluetooth devices, but is there a way to narrow down the list to only audio devices (bluetooth speakers, headphones). ...
0 votes
1 answer
560 views

Listen for certain keyboard input and insert to SQL Server DB

I have a USB NFC reader (acts as an emulated keyboard that types out the 10 digit ID number on the card when scanned). I want an app to listen for this input and when it sees 10 digits, I want it to ...
0 votes
1 answer
1k views

How can Rpi Python control motor drivers L293D or L298N?

It is dangerous to run motors directly from the Pi, hence we need a motor shield. I own an Adafruit arduino motor shield clone: https://learn.adafruit.com/adafruit-motor-shield Note: I'm aware about ...
0 votes
1 answer
496 views

Access the display from a python app running as a service

Problem: The code below can't access the display when running as a service. I have my raspi hooked up to a touch screen monitor in the kitchen and I've attached a Passive Infrared sensor to the GPIO ...
1 vote
2 answers
2k views

BlueZ BTGATT-client.py WriteValue

I had a successful attempts with BlueZ-5.50 > test > example-gatt-client.py with ESP32 set as HeartRate Sensor Server.I am able to read from ESP32 which i modified to suit the BlueZ example. ...
0 votes
2 answers
34 views

Can't get Cron to run python script

I'm trying to set up porkbun dynamic dns python script to run at reboot via Cron (later I'd like to run it hourly, but baby steps...) following porkbun's tutorial https://www.youtube.com/watch?v=...
1 vote
1 answer
3k views

Problems Connecting to Bluetooth devices through python

I am trying to write a simple python script that connects any bluetooth audio device to the raspberry pi 4. I keep getting "bluetooth.btcommon.BluetoothError: (111, 'Connection refused')" Here is ...

1
2 3 4 5
62