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
1
vote
1answer
38 views

Is it possible to control the 5V supply (e.g. pin 4) via python?

I want to (de)activate a fan, which is connected to the pins 4 and 6, depending on the temperature of the CPU. Is it possible to (de)activate Pin 4 (or Pin 2) at the Raspberry Pi 4 via python? I have ...
1
vote
0answers
46 views

How to add 2 RFID readers to Raspberry PI 4

I managed to install 1 rfid reader following this link tutorial but i have no idea how to read with 2 and know from which one reads
9
votes
4answers
44k views

PyQt5 on a Raspberry Pi

I have a Raspberry Pi 3 with Raspbian installed, along with a 7" touch screen. I'm in the process of creating an application in Python to read several DS18B20 Thermocouples to monitor the temperature ...
1
vote
2answers
378 views

Can't blink a LED using SPI interface on Raspberry Pi v3

As a part of my PoC project, I'm using single 5050 LED made by Adafruit. I wired it like this (LED - RPi): DI (Data Input) - SPI0 MOSI CI (Clock Input) - SPI0 SCLK GND (Ground) - GND VCC (5V) - 5V ...
0
votes
1answer
314 views

Text overlay over video stream when saving to file system

I'am using raspberry pi zero as controller which communicate over UART with external board with five sensors. What I need is a way to save video stream from raspicam to filesystem with embedded text (...
2
votes
1answer
172 views

Showing an image on screen attached to Pi via SSH

I am running a raspberry pi3b+ via ssh. There is a hyperpixel4 screen by Pimoroni attached to the Pi and it's working fine. I am trying to display an image on the screen attached to the Pi with a ...
0
votes
0answers
41 views

Playing audio on Bluetooth speaker using pygame

I know there are already posts related to this question, but there aren't any I can find that have worked for me. I am attempting to get an iHome B66 Bluetooth speaker to play sound coming from my ...
4
votes
3answers
4k views

Raspberry Pi camera doesn't work only displays red light

When I run my code, I get this error: No data received from sensor. Check all connections, including the Sunny one on the camera board The red light on the camera module glows, but doesn't ...
0
votes
1answer
289 views

How can I stop this script (date an time with I2C LCD)

I found this script to show date an time on this site: http://www.circuitbasics.com/raspberry-pi-i2c-lcd-set-up-and-programming/ Once is running how can be it stoped? I like the idea of showing the ...
0
votes
0answers
22 views

How to make cameras take picture simultaneously with a single button?

How can I make my pi's take pictures at the same time whenever I push a button? I've connected GPIO pin 2 to my button and a ground pin to the other end of the button for every pi. This is how I've ...
0
votes
0answers
30 views

Relay is behaving differently from tutorial

Given: Raspberry Pi3 Sunfounder 2 channel relay plugged into 3.3v plugged into ground plugged into pin 18 import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.OUT) GPIO....
1
vote
3answers
7k views

Serial to USB, no ttyUSB0

I'm trying to open a Serial communication between a Raspberry Pi 3 (model B, running on Raspbian) and a device (a traffic counter to be precise). I've a USB to Serial cable, using the rs232 standard. ...
0
votes
2answers
840 views

How do I Install Kivy for python 3.4 on my raspberry? Is that possible?

The question is on the title XD How do I Install Kivy for python 3.4 on my raspberry? Is that possible? I tried using the https://kivy.org/docs/installation/installation-rpi.html guide but thats only ...
1
vote
0answers
18 views

Data logger with SenseHat and timelapse Pi Camera code not running

I am trying to use a SenseHat and Pi camera to do some data logging. What I want my program to do is when run, it should collect sensor data and take a photo every 10 seconds. The issue that happens ...
0
votes
1answer
330 views

feh can't display image

I have written a python script that displays the image from the URL. def image_func(link_image): img_cmd = "feh -F %s" %(link_image) os.system(img_cmd) os.system("pkill feh") If I ...
2
votes
1answer
215 views

Stepper Motor Not Responding. Wiring Issue?

I am following the tutorial: But I am using a pi t-cobbler and a Pi 2. I am also using the ULN2803 driver. When plugging a button into the appropriate gpio spots on the breadboard, I am able to run a ...
3
votes
3answers
450 views

Play multiple mp3 files

I need to be able to play up to 8 mp3 files at the same time. Is this possible with the raspberry pi 3b+? They need to be started in python code.
0
votes
0answers
27 views

Multiple LED strips over Pi4

I am trying to control 3 LED strips independently over Pi using python. As Pi4 only has 2 PWM channels, 0 and 1, I have only been successful in controlling 2 LED strips. I even tried the software ...
1
vote
2answers
54 views

.txt files become empty

I have few .txt files I use to store configuration information for some python and shell scripts on my Pi. They are occasionally read from and very rarely written to. The Pi runs 24/7 mostly but will ...
0
votes
1answer
227 views

Activate Python Script through POST request

I installed and have running the google home + raspberry pi from: http://www.instructables.com/id/Google-Home-Raspberry-Pi-Power-Strip/ I modified the sw1_on.py and sw1_off.py codes to turn on an led ...
0
votes
0answers
20 views

rpi3b+ pip install psychopy HDF5 not found

I'm trying to install psychopy on Raspberry Pi3b+ with Ubuntu MATE 18.04.04. Here's the error I'm getting while installing pytables. The command I'm using: sudo python3 -m pip install psychopy ...
1
vote
1answer
89 views

Unable to control and count RPM of 2 motors in single python code in raspberry pi

I'm trying to count rpm of dc and controlling its rpm using PID controller motor which I have done successfully in my code as shown below. But when I try to count RPM of 2 DC motors simultaneously in ...
2
votes
1answer
278 views

Button isn't triggering in python script

Software guy here, first time doing hardware. Here is my breadboard setup (yellow is GPIO-8, green is ground): Here is my Python: import RPi.GPIO as GPIO from time import sleep GPIO.setmode(GPIO....
1
vote
1answer
57 views

Raspberry PI random connection interruptions

i am running a raspberry pi B+ headless and losing network connection irregulary. I am living with that since a few years, but now want to fix the problem. What would be a good approach to find out ...
1
vote
3answers
261 views

Temperature measured using “psutil” and the “CPU Temperature Monitor” are different

I need to read the temperature using the python program. I am reading the CPU temperature of the Raspberry Pi using psutil module. When I call psutil.sensors_temperatures() it is returning the ...
0
votes
0answers
7 views

dbus and qdbus not working suddenly

I am using dbus and qdbus to control my phone from a pi using Bluetooth to pause play etc. songs and all of a sudden dbus and qdbus dont work anymore All other functions work i can head music from he ...
1
vote
1answer
97 views

PIGPIO bit banging UART - SLR to plaintext

I've managed to read UART input by SLRO and SLR commands from pgpiod, however, SLR returns UART bit-banged data in the following format: [number of read bytes] [bytes] http://abyz.me.uk/rpi/pigpio/...
0
votes
1answer
44 views

Unable to locate package python3-bluez

I'm stuck at the installation process for openhabian , I realized I couldn't get package python3-bluez to install. script ran : needed_packages() { # Install apt-transport-https - update ...
2
votes
1answer
500 views

SPI only returning zeros with Raspbian (It works with IoT core)

I am using this ADC connected to the channel 0 of my Pi3 board for reading values from a sensor. In IoT core, I was using a very simple code for testing the my device, and it worked fine. The C# code ...
0
votes
2answers
436 views

Ending a camera video stream in Python / threading

I’m very new to Python and have been struggling with the code for a wildlife camera project on the Pi. I’ve managed to get the PIR sensor and automatic camera capture working, but I’d like to have a ...
0
votes
0answers
33 views

Problem I2C when using BH1750 photoresistor

(Raspberry Pi 2, model B, V1.1 - buster OS - all updated / upgraded - smbus loaded on) Hi, I am quite new to the Raspberry Pi and recently I have hit a brick wall. I am trying to link the Raspberry ...
0
votes
2answers
26 views

How to pass argument/file name using a for loop to a command line instruction in a Python script?

I have following the link: to incorporate a command line command into my python script and it is working fine. but i want o run the command over all the files present in a folder. How to send the ...
0
votes
1answer
440 views

Tkinter application window in front of Chromium in Kiosk mode

On my Raspberry Pi I have created a tkinter application with one button and configured Chromium to start in kiosk mode. In my python application I set the following: root.lift() root.wm_attributes("...
0
votes
1answer
694 views

WHY my Python BLE device discover codes don't catch as many devices as Raspberry Pi OS panel does?

I developed some BLE device discovery python codes from the example given in https://github.com/pybluez/pybluez/blob/master/examples/ble/scan.py which are run on a Google AIY Raspberry pi. from ...
0
votes
1answer
77 views

measuring phase difference in 3 phase power

For my ceramics oven I had 3 phase power installed. But power consumption according to the meter is way higher than the nominal 7KW the oven consumes. A friend told me that if the phase (or sinus) is ...
0
votes
0answers
22 views

Using RPI to control analogue VIDEX intercom system

I'm getting to grips with Python and RPI with the view to replacing one of the VIDEX 3311 intercoms at my workspace with an RPI device to answer the buzzer, see who's at the door (using extant systems)...
1
vote
1answer
319 views

Parallax RFID Serial Not reading tags

I am a complete newbie with Raspberry Pi and any type of hardware prototyping. I have been trying to get a Parallax RFID working with my Pi 3. I currently have it wired to the GPIO using BCM and the ...
0
votes
1answer
328 views

Pi Camera recording function needs to loop each hour

I have made good use of this forum over the past year as I have been creating a birdbox with camera for my mother. Until now I have been able to find an answer to all of my questions but this time I ...
0
votes
1answer
893 views

Raspberry Pi error when connecting to Firebase

When I tried from firebase import firebase running in the Python 3 (IDLE) and Thonny Python IDE, it gives an error likes this at the first line: Traceback (most recent call last): File "/home/pi/...
1
vote
1answer
36 views

Run Python RPi.GPIO as sudo

I'm trying to use the RPi.GPIO Library in a python-script with root-privileges. I essentially need to run it with sudo because other stuff in my script require root-privileges. When i try the ...
0
votes
2answers
2k views

play audio stream when bluetooth connects

I have a Raspberry Pi Zero W and want it to use as an Internet Radio. So I wrote a Python script that connects to my bluetooth speaker and starts a stream. Everything works fine, but i always need to ...
0
votes
2answers
3k views

Cannot import name 'PiCamera'

I'm trying to use my PiCamera, and while doing that (writing some python code to use it), I keep getting this error message: Traceback (most recent call last): File "/home/pi/Desktop/picamera.py", ...
1
vote
1answer
6k views

Selenium - Firefox - OSError: [Errno 8] Exec format error

I'm trying to run selenium on a Raspberry Pi 3. I've installed geckodriver and added it to my path. $: which geckodriver /bin/geckodriver echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/...
0
votes
1answer
1k views

Minimize active window

Is it possible in python to minimize an active window by name or by focus state and, if so, how? For example: I have an open Chromium browser and run a script in python and for five seconds my ...
0
votes
1answer
22 views

Installing Python Modules globally using pip

I'm doing a Udemy course using Python, and I recently created a fresh copy of Raspian for my Raspbery Pi 3B+. I have attempted to install the module pyfiglet, and used the terminal command sudo pip ...
0
votes
1answer
481 views

Lighttpd running FastCGI script hangs and give 500 internal error

I'm attempting to use lighttpd and fastcgi to run a small flask application. When I try to start lighttpd, it starts the server just fine, but when I try to connect in the browser, it hangs without ...
0
votes
1answer
353 views

webiopi write to log when button is pushed

Trying to learn the webiopi and python. I have a simple button to turn off and on a relay. Here is the HTML <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/...
1
vote
0answers
23 views

Multiple NFC PN532 Using I2C interface with Raspberry

At first im only using 1 NFC PN532 and libnfc as the library, but when im trying to connect it to 2 same devices, it still gives the same address which is 0x24(because of libnfc). Since controlling it ...
0
votes
4answers
1k views

boot up rasbian into gui program, no interaction

I have a project I want to do, and I got an SPI touch screen (tontec 3.5") for it. I want to start up into some sort of GUI application. I only have roughly 950mb left on my micro SD (8gb, install ...
0
votes
1answer
304 views

gamepad/joystick-> raspberryPi->nrf24l01->arduino; variable confusion between cpp and python

I'm trying to operate an r/c robot with joystick and a raspberry pi running Debian and an nrf24l01 to communicate the joystick commands to the arduino on the robot. I only really need forward/back ...

1 2
3
4 5
54