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
0
votes
1answer
19 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
0answers
5 views

How can i connect my usb/aux mic with my soundcard (alsasink) through a gstreamer pipeline?

I am working on a project where i want to talk to my microphone and have the system repeat what i was saying through soundcard. I am trying to find what is the link input i must give in order for the ...
1
vote
0answers
31 views

How to use Rpi SPI MCP3008 ADC to read visual light LED's transmit and receive signals?

EDIT: Firstly I wrote it a bit confusing way. So let me summarize my problem. This is something like answer to comment bellow. (1) I am trying to make somethin like visible light communication based ...
0
votes
1answer
32 views

Service does not start at boot time

I am running a Flask application on my RPi successfully by issuing the following command export FLASK_APP=/opt/fzwk-access-source/app.py && flask run --host 0.0.0.0 Now, my next goal is ...
0
votes
0answers
9 views

raspberry pi hq camera cant set iso or gain in opencv

in opencv i am trying to set the gain or iso. but when i do these things i notice no difference. import cv2 #Capture video from webcam cap = cv2.VideoCapture(0) cap.set(cv2.CAP_PROP_AUTO_EXPOSURE, 1) ...
0
votes
1answer
32 views

How to convert a Python / Kivy program from a Desktop Window to a stand-alone Raspberry Pi Kiosk

I have a Python program using Kivy to generate the GUI running in a window on a Raspberry Pi running the normal Raspberry Pi OS DeskTop & X Server. I want to convert this Python / Kivy program to ...
0
votes
1answer
19 views

What is the best codec and library in order to achieve wireless video and audio transmission through Raspberry and LoRa?

I am currently working on a project where i want to create 2 wireless push to talk voice transmitters. I paired 2 Raspberry Pi with 2 LoRa antennas respectively in order to achieve that. However i am ...
0
votes
0answers
28 views

What code do I need to play videos using GPIO buttons with a raspberry pi?

I am trying to make a python program that uses GPIO buttons to play videos on a raspberry pi. I do not really understand python and I need some help with the code to make the videos play. I have tried ...
0
votes
1answer
16 views

Cron job not working on python script for power monitoring - HS110

I have cobbled together a script which runs as a standalone python file. It successfully connects to the HS110 smart plug from Kasa/TPLINK and posts the power in Watts to my webserver. This all works. ...
0
votes
1answer
30 views

Raspberry pi working as a network scanner

I really want to use a raspberry pi to scan the network and to transfer the details to a web server. Apparently, I have planned on installing Nmap into the pi and use it to gather details of the ...
0
votes
1answer
343 views

SIP Generator Error Installing ROS Melodic on Raspberry Pi 4

I've been attempting to install ROS Melodic on my Raspberry Pi 4 (running Raspbian Stretch) according to the instructions on this webpage: [https://www.instructables.com/id/ROS-Melodic-on-Raspberry-...
3
votes
3answers
5k views

I am getting ghosting/bouncing on my digital input

I am meassuring data pulses from my electrical meter, giving me one pulse per Watt used. I have 4 electrical meters connected to my Raspberry Pi model B. I have connected them directly like this (no ...
4
votes
4answers
5k 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
0answers
42 views

picamera multiprocessing

I am trying to capture a raspberry pi camera image with a multiprocessing module The motion is stopped at the part being captured No error code and just the following code doesn't work. If you know ...
0
votes
0answers
32 views

Can Thonny run scripts as root?

I'm trying to use the Import keyboard library within Thonny on my Raspberrypi Zero W. However I receive an error saying "import error: you must be root to use this library on Linux." Can ...
1
vote
1answer
7k 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
180 views

How to display a tkinter window while using a push hardware button to capture images?

I have a project in which involves capturing of images. I have to display a UI while capturing an image if a button is pressed. This is the code. def create_window(self): t = tk.Toplevel(self) ...
0
votes
0answers
9 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 ...
0
votes
1answer
26 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 ...
-1
votes
1answer
32 views

Is it possible to move a stepper motor to a specific angle?

For Example: move.stepper(90°) #stepper now points to the east time.sleep(1) move.stepper(180°) #stepper now points to the south time.sleep(1) move.stepper(263°) #stepper now pointing to 263° I ...
0
votes
1answer
20 views

Camera provides striped image - what's wrong?

I've been using the raspi cam for some time now. I was using it inside a machine, to take photos from what's going on there. As far as I can tell, the cables are all attached as they should be - but ...
1
vote
2answers
382 views

Controlling Raspberry Pi GPIO with c and Python

I was searching for C and Python Libraries which support Pi4.
0
votes
2answers
28 views

Problem with crontab -e. Does not saving photos using autorun

Does not save photos using auto-launch in crontab. I use Python 3 or raspistill, they work well for photos when a monitor is connected. #!/usr/bin/python3 # BEFORE USING THIS SCRIPT. # ...
1
vote
2answers
93 views

How to use Config file between multiple pis

I have multiple pi's running a program where they listen for a broadcast message and trigger a python script. My python script that's triggered has config details that is same for all pi's. Whenever ...
0
votes
1answer
829 views

MPU 6050 Accelorometer Gyroscope code is giving me an angle of 75 degrees when it's suppose to be 90 degrees

I used a bubble level and Angle apps to verify that my MPU 6050 is actually rotated 90 degrees. Even so, my code tells me that the MPU 6050 is rotated ~75 degrees when it is in fact rotated around 90 ...
0
votes
1answer
12 views

python spidev setting bits_per_word throws an error

so i need to set the bits per word to other than the deafult (which i think is 8) import spidev spi = spidev.SpiDev() spi.open(0,1) spi.bits_per_word = 8 This compiles no problem but when i set it ...
0
votes
1answer
83 views

Raspberry PI UART doesn't work all the time

I am trying to communicate to a UART device using Raspberry Pi (Raspberry Pi 3B with Raspbian stretch) Header pins with pyserial. I have followed all the steps mentioned in https://www.raspberrypi.org/...
0
votes
0answers
14 views

write and receive image to embedded modem via txd rxd in raspberry pi 3

How can I send and receive image (page) to embedded modem via Txd Rxd in raspberry pi3 using python ? And how can configure buadrate and flow control using Cts Rts?
0
votes
1answer
55 views

How to install python module in LibreELEC installed on Raspberry Pi [closed]

Need to install PyAudio module, LibreELEC does not have PIP. Also tried to copy the PyAudio module files, but could not get its dependency 'PortAudio' library. at-least is there a option to get the ...
0
votes
1answer
19 views

Display monitor closes while running a python code on Rpi zero

I am writing a code using the Google AIY vision kit and its APIs. I have a loop which calls the face_detection model continuously every 30 secs. The loop works perfectly fine for the first 2 ...
0
votes
2answers
50 views

How can I query pull state of GPIO pin?

I am writing a script that should query if an input pin is configured as pull-up or pull-down using the RPi.GPIO package. When configuring each output I can call GPIO.setup(11, GPIO.IN, pull_up_down=...
0
votes
1answer
31 views

PSUTIL: module 'psutil' has no attribute 'getloadavg'

I'm teaching myself python with the aim of building a small, off-grid server for collecting/transmitting data on my rpi. One of the datasets I'd like to collect is the CPU load by making calls to ...
2
votes
4answers
9k views

Problem on installing Pyaudio on Raspberry Pi

I was trying to install pyaudio following the steps: 1) sudo apt-get install python-dev 2) sudo apt-get install portaudio19-dev 3) sudo pip install pyaudio Couldn't get through step 2. Error ...
-1
votes
1answer
63 views

Control Motor via Raspberry Pi connected to a Laptop (running code via PyCham)

currently working on a project with detecting objects via a Camera Module and controlling motors based on the camera detection (if object is in sector A, move motor B down, etc.) using Python. The ...
-1
votes
2answers
81 views

GPIO 3.3 V signal still readable after inputting high resistance values

I recently obtained a raspberry pi 4 (8GB) and I am trying to understand the GPIO behavior and ran into an event that I don't understand. I have set-up a simple script that allows pin 36 (GPIO 16) to ...
1
vote
0answers
16 views

Cannot Stream From WAN remote Rpi using Python Server and Client Sockets

This is the first time I've ever asked a question to any on-line group, so apologies if this is the wrong place to ask this. I am trying to use stream live video using Python Server and Client sockets ...
0
votes
1answer
589 views

Can't use my Raspberry Pi 3 B+ for I2C in high speed mode

I've been trying to use a Raspberry Pi 3 B+ to get data from an accelerometer, namely an ADXL 357, via I2C but the problem is that the data rate is about 200 Hz or even less. I tried to set the ...
0
votes
1answer
35 views

Crontab Permission Denied running simple Python Script

I've been trying to get this to work for DAYS. Its doing my head in because everything i search suggests this work. The process is Cron executes bash which executes python I open and edit the cron ...
0
votes
1answer
26 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 ...
0
votes
1answer
58 views

SSH showing “connection failed” after installing “pip”

Python3, pip3 and python was installed before on my Raspberry Pi. Today I've successfully installed pip using below command: sudo apt-get install python-pip After few hours later I'm not able to ...
1
vote
1answer
550 views

Installing Jasper runs on several errors

I'm trying to install Jasper with this guide. Now i'm hanging with the following problem: i try to use the command sudo apt-get -t experimental install phonetisaurus m2m-aligner mitlm libfst-tools, ...
0
votes
2answers
152 views

Small pulses - DHT11 relay triger

I'd like to trigger my relay to turn on my lamp when the humidity level measured is greater than 85. Here's the code I've been using. import Adafruit_DHT import RPi.GPIO as GPIO import time sensor = ...
0
votes
4answers
7k views

cannot install python-dev

I have tried to do a sudo apt-get install python-dev however I get this, Reading package lists... Done Building dependency tree Reading state information... Done Package python-dev is not available, ...
0
votes
3answers
3k views

Raspberry Streaming using VLC picamera python

I am trying to stream Raspberry Pi camera video using VLC. The code is as follows: import subprocess import picamera camera = picamera.PiCamera() camera.resolution = (640,480) cmdline = ['cvlc','-vvv'...
0
votes
0answers
33 views

3.3v Relay switches on/off/on - off fails 2nd switch off

This 3.3v .relay, link to the the >>> Datasheet As the title mentions works fine until I try to switch it off the second time round, I see the red LED turning on (it looks a touch dim) ...
0
votes
1answer
696 views

How to split the camera preview on one screen?

I have a similar idea like in Q:Split screen cloned display I am sorry that I'm creating a new question then, but I'm unable to comment the answer there (I assume that because I'm new here :) ).. ...
1
vote
2answers
883 views

Videoplayer in Kivy GUI not working. GStreamer problem?

I'm trying to create a video player GUI for my Raspberry Pi (Raspbian Linux 9 Stretch) using python 2.7 and Kivy. The GUI was created, but the video refused to load or play. I think the problem may ...
-1
votes
0answers
20 views

Python opencv Defect detection

I am trying to detect foreign substances in a round circle using opencv. However, if the threshold is increased, the area around the circle is distorted, and if the threshold is decreased, foreign ...
0
votes
1answer
112 views

encoding problem: unable to find the match text only during reboot

I have a python file that is running ok if i run it in a terminal in raspberry pi. But if i set it to automatically run after it reboots (using crontab), the file runs ok until it reaches the line ...
1
vote
1answer
34 views

how to develop an desktop application for raspberry pi? [closed]

am interested in developing a desktop application for raspberry pi. Am having a little bit of coding experience in c and python. The main thing is I don't understand where to start and how to start. I ...

1
2 3 4 5
57