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

What's the best way to remote control a Raspberry pi - powered robot?

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 ...
0
votes
2answers
403 views

Ubuntu 20.10 and GPIO

I have trouble installing RPi.GPIO library on Ubuntu 20.10. I run apt-get update and apt-get upgrade then apt-get install python python3 python3-pip python3-dev everything went ok. Then I run pip ...
2
votes
1answer
909 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
1answer
214 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
1answer
36 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
1answer
2k views

“404 not found” error when requesting Python with Lighttpd through CGI

I've installed lighttpd and gotten it to serve /var/www/index.html just fine, but I haven't gotten it to run a Python script yet. I enabled CGI and set it's match case and directory as instructed in ...
1
vote
1answer
230 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). ...
-2
votes
0answers
19 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
537 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 ...
1
vote
1answer
450 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
1answer
384 views

Read Incoming Bluetooth Audio On Pi With Python

this is my first post on here! I am trying to make my raspberry pi 3 a bluetooth speaker which synchronizes beat of the music being played from a phone to an LED light strip. For the LED light ...
1
vote
2answers
621 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. ...
1
vote
1answer
1k 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 ...
0
votes
1answer
3k views

Scan Distance from Eddystone Beacons

I would like to read an Eddystone Beacon using my Raspberry Pi 3 to calculate distance from the beacon. I can't find any resources to do this from the official Eddystone documentation. How should I go ...
2
votes
1answer
332 views

Rpi Zero W - How to automatically accept bluetooth pairing and log mac and info request?

I am using Raspbian Stretch 9.4 on a Zero W. The goal is to deploy it headless for long periods of time where it will broadcast a specified bluetooth signal. When someone tries to connect to it, it ...
0
votes
1answer
2k views

Play different videos with omxplayer depending on reported sonar distance

I am a new to Python. What I want to do is that playing different videos depends on distance using Ultrasonic sensor. For example, if the distance <= 20, play movie1. if the distance > 20, play ...
3
votes
9answers
14k views

how to turn on and off an led with only a tactile button

I'm a beginner to the raspberry pi and python. I want the pi to act like a flip flop to the led so that when i push the button once, it will turn on and if I push it again, it will turn off and so on....
1
vote
1answer
2k views

Kivy on Raspberry Pi: Mouse cursor not showing

I'm running kivy on a Raspberry Pi. I accepted that apparently you can't get around the fullscreen, but I can't get the cursor to show either. I tried by adding touchring = show_cursor=true to the [...
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
22 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 ...
0
votes
1answer
5k views

Different Frequencies with Piezo Buzzer - Python

I have a multiple choice question game, and I'm wondering how to hook up a piezo buzzer to make a sound when someone puts in an answer. Basically, I need two functions - a sound for when they get it ...
1
vote
1answer
2k views

RFID RC522 Reader & Chromium Web Page

I'm having a bit of difficulty locating a specific example, however I have found people referencing that they have accomplished what I am looking for. At a basic level, I have a webpage being served ...
1
vote
1answer
5k views

Error trying to install python-firebase on Raspberry Pi 3

I have installed requests but I'm unable to install the python-firebase package. I want to fetch data from firebase on my Raspberry Pi 3. I have used the following code to do the same on my PC. from ...
1
vote
0answers
27 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 ...
1
vote
2answers
2k views

Raspberry pi 3 reading serial port

I have a python code that reads the serial port of the raspberry pi 3to obtain GPS positions from a fona808. The code works for some time and then throws this error. Traceback (most recent call last):...
-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 ...
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 ...
2
votes
3answers
894 views

Python GPIO script not sensing falling edge

I have the following script I used for testing: #!/usr/bin/env python2.7 import RPi.GPIO as GPIO, time, subprocess, threading, socket, signal GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) button=21 ...
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
2answers
218 views

time.strftime working on windows but not on raspberry pi [closed]

I am working on a project that requires pyqtgraph library of python on raspberry pi. It functions well until I added a system time axis on my graphs. What also weird is that the script I am using ...
0
votes
1answer
45 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 ...
0
votes
1answer
71 views

How to best handle Raspberry Pi 4 and Smartphone connection over Bluetooth and Python

I would like to accomplish the following task: Interact via a python script with my Raspberry Pi and a Smartphone. For me it doesn't matter so much whether to use Classic Bluetooth or BLE but for user ...
0
votes
1answer
711 views

Understanding struct.unpack code

Hello great community of helpers! We new programmers greatly appreciate your continuous help. Thank You! Can you explain this 1 line of code below... - Or break it down into separate chunks. I ...
-1
votes
0answers
11 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
43 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. ...
2
votes
2answers
1k views

Problems connecting XMega-A1 Xplained via USB

I am trying to connect a Atmel XMega-A1 Xplained board to the RPi via USB and reading out data with Python (PySerial). OS is Wheezy-Raspbian. After trying a lot of different things, I'm out of ...
0
votes
1answer
48 views

Modifying what is shown in the uART

I am working on establishing user communication (one may say a basic UI) from the user's PC to my Raspberry Pi, where the RPI would accept pre-defined commands from the user via uART and then process ...
0
votes
1answer
149 views

I want to Read out the news out loud using feedparser

I have a RPi 4B running RaspberryPi OS buster and I want to be able to speak out the news using ./speech. I have been following a tutorial and I got everything up and running but I am having some ...
5
votes
4answers
13k views

How to use JSN-SR04T on a Raspberry Pi?

I want to try out JSN-SR04T, which is an ultrasonic distance measuring module, that is also supposedly water proof. The main reason that i want to try this module over the HC-SR04, is because the JSN-...
0
votes
1answer
847 views

ultrasonic sensor stops after giving some reading when running in thread on tornado websocket python

I am using Ultrasonic sensor to get reading and am using python program for getting reading. And am using Raspberry pi for this. when am running python program independently its giving me reading ...
1
vote
2answers
2k views

Kivy won't listen to “fulllscreen” setting

Working on a Raspberry Pi Model 3 B, running raspbian. Running Kivy v1.9.2-dev0 and Python v2.7.3 Trying out one of the Kivy examples but for some reason the application won't come up in "Windowed ...
0
votes
2answers
44 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....
6
votes
3answers
18k views

Debouncing buttons with RPi.GPIO — too many events detected?

I'm using RPi.GPIO to handle events from a simple pushbutton. Pushing the button connects the associated GPIO pin (4) to ground. I would like to trigger an event when the button is released (e.g., ...
1
vote
1answer
2k views

Problem with GPS module and Python

I copied a program from the Adafruit webpage to test my GPS module and before running it I installed the Python gps with sudo apt-get install python-gps but when I run the program I get this error: ...
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
1answer
569 views

Kumantech 3.5" LCD Touch Display, Python Library

I've a Kumantech 3,5" LCD Touch Display in front of me. I'm trying to find a python library to controll the LCD, because i don't want to use x or just to console. I couldn't find any. And I couldn't ...
0
votes
1answer
547 views

sudo pip install packagename not working

sudo pip install packagename not working... I am not able to install python package using pip.
0
votes
1answer
90 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 ...
0
votes
1answer
1k views

Audio Processing Issues in PyAudio in RPi

Basically, I want to analyse the spectrum of the input audio stream to my Raspberry Pi. I have configured my Audio USB Adapter and ran sample tests on Play and Record. I am using PyAudio to take ...
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 ...

1
2 3 4 5
58