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

i2c communication problem with SSD1327 OLED display on a Pi 4

I have the following 128 x 128 OLED display: http://www.lcdwiki.com/zh/1.5inch_OLED_Module_SKU:MC01503 which is driven by a SSD1327 module. I'm trying to use this with a Pi 4 and the Luma.oled python ...
1
vote
1answer
458 views

Develop a communicattion between a Raspberry with BLE server and a Raspberry with BLE client

I have been developing an small project which requieres a communication between two Raspberries, the first one acts as a Beacon and the second one tries to connect to that beacon and obtain the RSSI ...
0
votes
2answers
113 views

Take a picture when a light source is disturbed

I would like to use a Raspberry Pi camera to take a picture when a light source sent to the camera is interrupted. I have one Arduino (transmitter) sending an ON-OFF Keying (OOK) signal through an LED ...
1
vote
1answer
53 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
1answer
49 views

How to make more efficient reading of GPIO

My (python) program (on Raspberry Pi zero W) turns on/off a GPIO pin (connected to a relay module) depending on the RSSI signal of my phone (connected via bluetooth) and the status of one more GPIO ...
0
votes
1answer
3k views

Which camera settings does camera.exposure_mode = 'auto' dictate / supersede?

For example, if I want to change camera ISO with the Pi Camera Module 2, I don't see any difference in images between: camera.iso = 100 camera.exposure_mode = 'auto' camera.capture(filename) and ...
0
votes
1answer
19 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
54 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
64 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
328 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
21 views

How to set up bluetooth broadcasting on a pi 3 b v1.2

um new to working with bluetooth on linux or on a raspberry pi but i have managed to set up the controllers. What i want to accomplish now is using python to connect or broadcast my raspberry pi as a ...
2
votes
1answer
176 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 ...
1
vote
1answer
73 views

Scripting bluetoothctl causes it to fail after connection

I'm connecting to a custom BLE enabled board. Running bluetoothctl, I can pair and connect no problem from the command line. I've been attempting to script it using Python and pexpect. Pexpect spawns ...
5
votes
1answer
644 views

Rasberry Pi zero and 3 bluetooth transfer speed is slow RFCOMM

I am trying to send a series of bytes from the Raspberry Pi zero W to the Raspberry pi 3 via bluetooth. Im using the PyBluez python package. I believe that Raspberry Pi Zero has Bluetooth 4.1 and ...
2
votes
3answers
4k views

Optimising raspbian performance for python script

(I know this is probably the most overkilled question but) I've designed a pretty heavy code/script in python, which yes would have been better implemented in c, but in saying that short of over ...
1
vote
1answer
317 views

Error Installing TensorFlow on Rasperry Pi 3 B

I'm following this guide to create an AI chatbot which requires Python 3.6, TensorFlow etc. So I installed Python 3.6.8. To install TensorFlow I tried sudo pip install tensorflow I also downloaded the ...
0
votes
1answer
38 views

PWM issues with pigpio and RPi.GPIO

I am using Pi Zero W with latest Raspberry Pi OS. I have a backlight of an LCD that I am trying to control via PWM. If I use RPi.GPIO I get flicker at anything other that 100% (or 0%) duty cycle. As ...
0
votes
0answers
25 views

TCPDUMP stops reading after 20 minutes [closed]

Raspberry wifi is configured as monitor and after launch a tcdump for reading beacons, 20 minutes after launch read stops but tcpdump is running... There ir no reason on console, log or .cap that can ...
0
votes
2answers
221 views

How can Rpi change Neo-6M GPS update rates?

Hi i'm tryng to change the update rate of my gps tracker(neo 6m ublok) i know the byte that i need to send are 0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A i've tried echo -e &...
16
votes
4answers
92k views

How to correctly install the python RPi.GPIO library

I downloaded RPi.GPIO 5.3a from here: https://pypi.python.org/pypi/RPi.GPIO I extracted the tar file, cd into the folder and ran: sudo python setup.py install It ran through a bunch of stuff and ...
0
votes
1answer
19 views

Service in systemd dies when logging rotated

I have a Python program that I start on boot with a service in systemd. It works fine until Unix tries to rotate the system log file, and I get an error: "Journal has been rotated since unit was ...
-1
votes
0answers
15 views

Which board should one use for a specific task [closed]

I'm emulating the Philips hue bridge in a way where instead of it only being able to control only Hue lights, it can control any smart home device, so that I have everything within one app nicely ...
0
votes
1answer
49 views

Pi 3 B+ sudden audio failure

A few months ago I bought a RasPi 3 B+ to act as an overglorified doorbell using reed switches to tell the Pi to play a custom MP3 with the "Playsound" Module into the Company's PA system. It worked ...
0
votes
1answer
159 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-...
0
votes
0answers
14 views

Create Overlays with DispmanX in Python

How can i create preferably dynamic overlays using Dispmanx in Python on a Raspberry Pi (3B)? My goal is to overlay custom images containing current information on top of a Picamera Preview. The ...
0
votes
0answers
23 views

how to simulate raspberry pi interfacing sensors in visual designer, proteus? [closed]

I've made a schematic ( raspberry pi interfacing PIR] on my proteus (visual designer) and wrote a code source on python also in visual designer to simulate a raspberry with PIR, when i build project ...
1
vote
2answers
660 views

GPIO Inputs Update Priority

What I'm wondering what is the update rate of each GPIO when used as inputs. What I'm actually doing with the Raspberry PI 3 is a pulse counter. I basically have 7 GPIOs set up as inputs and ...
0
votes
0answers
50 views

Play a mp3 file on USB Speakers

I've been trying for several months to play music on my Raspberry Pi 3 or 4 with 0 luck finding a stable player for Python 3. I can get pygame to play until it crashes which is multiple times a day so ...
0
votes
1answer
156 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) ...
1
vote
1answer
21 views

Cannot pip install adafruit-circuitpython-mlx90640

I am trying to install adafruit-circuitpython-mlx90640, a library for the MLX90640 thermal camera. When I run sudo pip install adafruit-circuitpython-mlx90640 I get an error that no matching ...
0
votes
1answer
101 views

At what instances do we use the Board mode and BCN mode in Raspberry Pi?

I know about the two modes of working in Pi using python, Board and BCN. However, I am really confused as to the instances or situations where I should use them. An example demonstrating their use ...
1
vote
2answers
79 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
2answers
47 views

Installing opencv on a raspberry pi zero

I have been trying to install opencv on my raspberry pi zero loaded with buster. I have followed a couple of tutorials online with no success. I thought this tutorial worked until I tried to import ...
0
votes
1answer
21 views

pyModbusTCP: which IP address should be specified on a server?

I'm trying to make my Raspberry Pi 3B+ as ModbusTCP server and for testing purposes my PC as a client. I'm using pyModbusTCP module for this. My server script (RPi) is: from pyModbusTCP.server import ...
0
votes
1answer
585 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
57 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/...
4
votes
1answer
1k views

One channel relay control

I'm trying to connect a small one line relay to my Raspberry Pi but the relay doesn't react. The red light on the relay is on the whole time. #!/usr/bin/python import RPi.GPIO as GPIO import time ...
0
votes
1answer
55 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 ...
0
votes
1answer
413 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
47 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 ...
6
votes
2answers
58k views

ImportError No module named thread

I want to make a simple thread that listens if a Button is pressed or not. I receive the error ImportError No module named thread. import RPi.GPIO as GPIO import time import thread GPIO.setmode(...
1
vote
1answer
457 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, ...
4
votes
1answer
512 views

Started picamera.start_preview() in Raspbian but don't see anything

I started picamera.start_preview() in Raspbian but I don't see the preview window which I thought was supposed to appear. import picamera cam = picamera.PiCamera() cam.start_preview() <picamera....
0
votes
1answer
17 views

Installing Gattlib error

Like many others, I've had problems installing gattlib using pip. I've followed the steps outline in this question to no avail: Pybluez and Gattlib error The steps that give me the error: hg clone ...
0
votes
2answers
131 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
1answer
30 views

Is PiFace Digital 2 compatible with Raspberry Pi Zero W rev 1.1?

Can anybody definitively say if the "PiFace Digital 2" is compatible with the "Raspberry Pi Zero W rev 1.1" or not ? I cannot find any Information on the web - besides a mention in ...
5
votes
2answers
375 views

Can the Raspberry Pi 4 better distribute Python scripts to all four cores?

This relates to previous questions regarding the GIL (Global Interpreter Lock) for Python on the Raspberry Pi. My question has to do with the new processor on the Pi 4 - does it still have the same ...
0
votes
3answers
2k 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'...
1
vote
0answers
31 views

Python - run Flask webserver parallel from main code?

For the Raspberry Pi i am developing some home automation tools. At one side i have my main application that reads a CSV file, that consists of date+time entries with a GPIO port nr and a duration. My ...
0
votes
1answer
26 views

Not getting a full 3.3V instead getting like 0.7V on a GPIO pin

Okay so I ran the following code and I am seeing ~0.70V on the GPIO pin and not 3.3V. Why could that be? #import the GPIO and time package import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) ...

1
2 3 4 5
54