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

Python - how to make non blocking terminal where every one second serial link sends packet

I can write this in C#, but now i learning python and I don´t know how program this. I want to make simple terminal where serial link sending every one second packet... In non-blocking way. In C# I ...
0
votes
1answer
20 views

Python - How to automaticly open first available serial port (COM/tty)

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
0answers
14 views

How to run python tkinter at start

I want to start my GUI app wrote in python with tkinter at start my Rpi, I set the start method in the rc.local like this: sudo bash -c 'python /home/pi/Desktop/appPython/good.py > /home/pi/...
0
votes
0answers
34 views

How can I transfer camera footage to my computer using Pico?

I am new to Pi and I am making a project which makes (live) video transfer from the camera to my computer display. Is this possible or not? Will it be possible with a Raspberry Pi Zero W? If yes, how ...
0
votes
0answers
19 views

pi zero portable mp3 player software

i am thinking about a project for which i could use some guidance. i want to build a flac/ high bitrate mp3 player with nice clicky buttons and rotary encoders. i have a raspberry pi zero, a dac hat ...
0
votes
1answer
15 views

brushless dc motor connection

i am connecting 2 brushless dc motors to a raspberry pi B and need help on connecting the correct pins . I saw a video on how to connect one motor but don’t know which ones to use to connect the ...
-1
votes
1answer
35 views

Gibberish from Raspi Serial [closed]

I am trying to run the Circuitpython code on my raspi to read the data from the adafruit ultimate GPS. I have done all of the modifications to the code as noted in the instructions. I used to have it ...
0
votes
1answer
24 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
1answer
19 views

Raspberry Pi Arduino Serial Data Sorting in Excel With Python [closed]

I have an Arduino Connected to a Raspberry Pi 4. Raspberry Pi Reads the serial from Arduino and writes the information into an excel file. The problem is that the Arduino data is not sorted. The ...
1
vote
2answers
51 views

How to use 2 GPIO pins for 3 buttons

I am using almost all the GPIO pins on a project so I had to be resourceful when adressing the pins for the buttons. But I just can’t get it to work. I don't know if something is wrong with the code ...
-1
votes
1answer
34 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 ...
-2
votes
0answers
20 views

I want to insert a command in the beginning of my .bashrc file

So I've made my raspberry pi into a beacon and it has a feature which gives it a new uuid on bootup which is placed in .bashrc. I want to modify this by adding a new feature in which a new uuid doesn'...
0
votes
1answer
28 views

Read binary data from serial port and save in file

I am link modem to pi3 via serial port and configure this port . When i receive data in my python software from serial port and save bytes in file, i note i receive too mutch data , I am receiving ...
1
vote
0answers
30 views

pySerial - UART - Determining when a message has actually been sent (callbacks?) (RTS/CTS hacking?)

For reasons (explained at the end of the post) I need to have a pin change state immediately as the UART finishes outputting a set of bytes. I'm using pyserial & pigpiod on a RPi3B+ and bluetooth ...
0
votes
0answers
11 views

Performing Rshell Commands using Python

I want to excecute rshell commands with python to code my Raspberry pi Pico using python itself. I need to automate few commands to make rshell micropython codes easily. Do you have any idea to run ...
-6
votes
0answers
24 views

Receiving sensor data stops when video streaming is starts

from __future__ import print_function import os import cv2 import numpy as np from picamera.array import PiRGBArray from picamera import PiCamera import tensorflow as tf # Import utilites from utils ...
-1
votes
0answers
12 views

Tktinter code laggs on raspberry

i am running this code on pc and its runs fine , but when i try the raspberry its lagging, i know that the pc i faster than raspberry , but can someone suggest optimizing the this code to run smootly ,...
0
votes
1answer
46 views

Is it possible to receive an FM radio's audio stream in software?

My goal is to be able to "rebroadcast" FM radio over the internet. What I mean by this is connect some kind of FM radio board to the raspberry pi, and receive the audio in software (i.e. ...
0
votes
1answer
40 views

How can i use one raspberry pi as a controller for another rPi?

I have built a raspberry pi powered rc car which i currently control through ssh on my computer. this works but it isn't great. I'd like to use a second raspberry pi with a joystick to control the car....
0
votes
0answers
18 views

Trouble with PiCamera video recording

I wrote this basic code today. I am learning still so it's not very neat. import sys import io import time from time import sleep import datetime import RPi.GPIO as GPIO from picamera import PiCamera ...
0
votes
2answers
52 views

Raspi as Remote Control for RC Receiver [closed]

I would like to use the Raspi as a remote control for an RC receiver. That means, I don't want to exchange the receiver and servo motor control with the Raspi, I would like to exchange the sender side....
0
votes
0answers
12 views

Setting resolution of DS18B20 in python

I am trying to enable remote reading of the temperature gauges in my furnace room by adding DS18B20 thermometers. Since I had some Raspberry Pis and DS18B20s, and some networking equipment on hand, I ...
0
votes
1answer
27 views

Rx buffer overwrites Tx buffer in spidev xfer2

Coming here from electronics SE as it was suggested that I post here on this issue. The electronics SE post is here. I'm setting up a comms link between an STM32F407 MCU and the Pi3B+. The Pi is ...
0
votes
1answer
31 views

Boot Pi4 using GPIO of Pi0

I am trying using Pi Zero GPIO and optocoupler to Power On(boot) my Pi4. My Pi4 is shutdown with terminal command(It is connected with power). My schematic set up: My Python code: #!/usr/bin/env ...
0
votes
1answer
38 views

Raspberry Pi Zero W as USB Keyboard

I’m having trouble setting this up on my Raspberry Pi Zero W. I am getting the error that there is no file called 'hidg0'? When I look in dev/ I do not see one either? I am running on the latest ...
0
votes
0answers
10 views

open and close different video players in loop

here is the overall flow of what i am trying to execute: when the system boots up, open a video in full screen mode and run a python3 script in background. the python3 script is a script to receive ...
0
votes
0answers
30 views

apt upgrade breaks python-rpi.gpio

There seems to be an issue in the Raspbian repository since around the start of March. My Pi running motion stopped working around then - probably due to an apt update I did around that time. Not able ...
0
votes
0answers
35 views

Pi Camera with multiple outputs

I am trying to stream and save video from Raspberry Pi Camera. I found code which provide streaming to HTML page but when I write output stream to a file I am getting MJPEG file which size is ...
0
votes
2answers
71 views

Python says its 3.8.0, but can only download python 2.7.0 packages. (Pip pointing to wrong python version?)

I am trying to install tensorflow 2.3.1 onto my pi, I currently have 0.11.0 installed. If I try to upgrade I get the following message: Looking in indexes: https://pypi.org/simple, https://www....
0
votes
1answer
32 views

Play boot sound right after splash screen

I saw many guides online to run a script at startup but all I found so far runs after logged in to the pi. In my case, I would like to run a script right after the splash screen. I saw some guides ...
0
votes
0answers
18 views

pyqt5 and opencv refuses to work together

On my raspberry pi when i try to launch my python script. import sys from PyQt5.QtWidgets import * from PyQt5.QtCore import * from PyQt5 import uic, QtGui import numpy as np import cv2 taker = False ...
-1
votes
1answer
39 views

RPi.GPIO button interrupt/callback inconsistent behavior - callback functions do not return

I have this programm that has 4 buttons (5,6,13,19) linked to the handleBtnPress callback function. The handleBtnPress function sets a busy flag, prints which button is pressed and then calls the main ...
0
votes
2answers
28 views

How to make RPI run script without WIFI

I have a RPI with a python script on it that makes the camera record every time you hit enter, and I would like to connect to the pi from my phone or laptop via Bluetooth or another way so I can run ...
0
votes
0answers
19 views

Getting an error only when trying to run kivy GUI from remote terminal

I'm testing some Kivy stuff to see how it works, and I want to edit and run the Kivy app remotely (using putty). I'm on Raspbian GNU/Linux 10 (buster) For simplicity's sake, here is the code I am ...
0
votes
0answers
33 views

Hardware accelerated JPEG encoding

I'm doing hardware accelerated JPEG conversion according to MMAL part of picamera docs. Now it works only once, for second it shows next error: "picamera.exc.PiCameraMMALError: cannot send buffer ...
1
vote
3answers
129 views

Start Python Script on Startup

I am having trouble getting what seems like a simple task to work. I have created a python file that I want to begin on startup. I have followed the steps for rc.local and init.d found here. To test ...
-1
votes
1answer
26 views

Can't connect to pigpio at localhost(8888) Can't create callback thread. Perhaps too many simultaneous pigpio connections

Have connected DHT11 to Rpi4. VCC--pin 1 datapin--gpio4 Ground pin--pin 6 It works fine fine but after giving the result for few times then I get this error. New to pigpio please do help me figure out ...
0
votes
0answers
44 views

PyAudio no sound

I have a Raspberry Pi 4 and am trying to figure out why PyAudio doesn't output any sound. speaker-test outputs pink noise to the headphone jack. aplay sound.wav also works python3 play_wave.py sound....
0
votes
2answers
38 views

How to control the brightness of an LED with or without additional hardware by setting a variable

I already know that using for example GPIO.output(led_pin, led_state) I can turn on and off an LED. What I would like to have, is to adjust the brightness of an LED, either by an absolute value (in ...
0
votes
0answers
55 views

Error when trying to run python scripts

I've been trying for a while now to run python scripts and everytime i try i get an error saying some package is missing. My conda environment path is set to: root /home/pi/miniconda3 where root is ...
0
votes
1answer
37 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, ...
0
votes
0answers
30 views

Wireless button to trigger py script on raspberry pi

I'm looking for ideas and products that would enable me to run this setup with a raspberry pi: I'm looking for a wireless wifi or bluetooth button that can be paired or connected to a raspberry pi on ...
0
votes
0answers
8 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 ...
0
votes
0answers
33 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) ...
1
vote
0answers
49 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

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
1answer
34 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
1answer
29 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. ...
-1
votes
1answer
55 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
43 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 ...

1
2 3 4 5
58