The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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.

642 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5
votes
1answer
458 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 ...
4
votes
1answer
282 views

How to make sense of this Raspberry Pi project guide for building a theremin?

I have just started out using a Raspberry Pi, and for my first project, I wanted to build a pseudo theremin using an ultrasonic motion detector and other electronic components (requirements are laid ...
3
votes
0answers
82 views

ADXL345. Bits, resolution and g's

I have a Kistler type 8921 which produces 1g (10m/s2) RMS (at 159 Hz). The ADXL345/Raspberry Pi 3 setup should produce similar g's, but currently doesn't. As can be seen, it is not just about a ...
3
votes
1answer
352 views

Is it possible to connect a Minecraft Pi Edition Python script to a specific active game window?

Is it possible to connect a Minecraft Python script to a specific active game window when multiple game windows are currently open? For example, I have three different open games on one Raspberry Pi ...
3
votes
1answer
311 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....
3
votes
0answers
541 views

RPI 3B and Tiny Thermal Printer - Unable to use python library

I'm having trouble hooking up my Raspberry Pi 3 Model B to my Adafruit Tiny Thermal Printer (nb: not the mini thermal printer - this is the one with a mini-USB port built in). I've got it connected ...
3
votes
1answer
5k views

Having trouble sending audio data over TCP using Sockets to raspberry pi

I am trying to do something like a walkie talkie. 1 device is my laptop and the other being the raspberry pi. What I have working. I am able to record the microphone, transmit it over a socket and ...
3
votes
0answers
811 views

Not getting a response from a connected PIR sensor

I have a PIR sensor which I'm using connected to a Raspberry Pi 3 Model B as part of a Magic Mirror project. I'm running this module for the sensor. I've had the Motion Sensor working before, but now ...
3
votes
0answers
540 views

RPi.GPIO autocompletion

Is there any way to have auto-completion when working with the RPi.GPIO in Python? I don't see it having any Python sources that could be used for it. I'm using IntelliJ IDEA, which uses PyCharm's ...
3
votes
0answers
1k views

Raspberry Pi 3 Bluetooth Baud rate

How do I increase the available baud rate of the bluetooth module for the Raspberry P1 3 model B? I have tried editing the /boot/config.txt file with: init_uart_baud=1000000 init_uart_clock=16000000 ...
3
votes
0answers
337 views

Speech Recognition ERROR

I am using a speech recognition library on a Raspberry Pi in Python that I found here and I installed it through pip. I also had to install Pyaudio of their site here. Pip would not work for Pyaudio ...
3
votes
0answers
3k views

Jack server not working on Raspbian

I wrote a little python app (using PyDub), that plays sound files. Everytime I run it, I get the these errors: ALSA lib pulse.c:243(pulse_connect) PulseAudio: Unable to connect: Connection refused ...
3
votes
0answers
614 views

Running two cameras at the same time (Pi Camera & USB camera)

I would like for my project to have one camera (PiCamera) Streaming video. And another USB Camera (PS3 Camera) taking pictures when I execute this function: def grabPicture(self): grab_cam = ...
3
votes
0answers
280 views

Slice of Radio and Ithobox

I've got a Raspberry Pi with Ciseco Slice of Radio and I'd like to control my Ithobox LINK It has an 868 Mhz RF transmitter/receiver and I also have the optional RF remote control unit which I'll be ...
2
votes
1answer
48 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 ...
2
votes
2answers
44 views

Python script won't load on startup

I have tried like 5 methods to get this script loaded after raspi3 load. #!/usr/bin/python3.7 #sudo python /home/pi/masterBaseInterface.py import socket # Import socket module import ...
2
votes
0answers
29 views

Safe cut power supply from raspberry

I want to cut safe the power supply from the raspberry with a relay connected to the gpio. I know how to connect to relay to the board but.. When the relay turn off the power line will be cut off to ...
2
votes
0answers
66 views

Control on-board led triggers from python

I know the trigger for on-board leds can be controlled from the command-line (or a script) I have a python program that I want to temporarily take over the system led blink it a little and return ...
2
votes
0answers
87 views

Threading on Raspberry pi Serial Port

I have multiple Raspberry Pi(RPis) using which I have to send data (wireless,using Long Range modules connected to TX RX of RPi) on just one Rpi. All the RPis(Ones sending data) use different ...
2
votes
0answers
66 views

Detecting “No Mouse Movement” in python on Raspberry Pi

So this is going to be a bit confusing but using a basic loop i can detect keyboard and mouse inputs using the following: globals()['keyboardEvent'] = evdev.InputDevice('/dev/input/event0') globals()...
2
votes
0answers
120 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 ...
2
votes
0answers
232 views

Send alert message to telegram from Raspberry Pi

I am currently working with an IR sensor for paper shelves. When the sensor detects no paper, it will turn the LED light on. at the same time, it will send an alert message through Telegram for the ...
2
votes
3answers
529 views

Connecting multiple load cells Pi Zero W to read individual values

I have a project in mind where I want to measure the weight and position of an item on a shelf. The idea was to mount the shelf on a load cell in each end and then get the weight and ratio between ...
2
votes
1answer
332 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 ...
2
votes
0answers
417 views

Permission Denied as root when connecting BluetoothSocket with Bluez 5.43

I've been trying to get bluetooth working on my Raspberry Pi 1 Model B+ running Raspbian Stretch Lite 4.14 with a 3rd party USB bluetooth dongle. I installed Bluez 5.43 for python 2.7, and was able ...
2
votes
1answer
64 views

fork() Process Issue on Channel Switching via Rotary Encoder

I have KY040 rotary switcher(encoder) as shown below picture. It is the scenario that there are 5 radio stations(simple html url) in urls.txt which are read into stations list in radyoCS.py, at every ...
2
votes
0answers
825 views

Illegal instruction when running python on raspberry pi

I was doing a pi project where pi communicates with a UHF ID card reader via hardware serial and read cards. Pi gets the card information through serial and upload them to a remote database. Also some ...
2
votes
0answers
1k views

RPi camera stream to OpenCV in Python

I have been searching everywhere and tested what seems to be everything in order to get OpenCV in python to accept a video stream through gst-launch-1.0 from a RPi camera connected to a RPi. So far, I ...
2
votes
1answer
419 views

prevent GUI notification for Bluetooth Pairing

Currently, I am trying to control Bluetooth (pairing - connecting - removing ...) with my python code (by accessing to bluetoothctl through pexpect). It actually works fine but I have a problem with ...
2
votes
1answer
489 views

USB audio from Pygame

I am running Raspbian Stretch. I've connected a USB sound device and selected it through the graphic interface. This sends the sound out fine from youtube in Chrome but is silent with a Python ...
2
votes
0answers
2k views

Segmentation fault, running out of memory? PyQt5

I am programming code to display camera feed with my raspberry pi 3 and Raspbian. Strangely, sometimes the code shows the video and sometimes i get the Segmentation fault error. I used gdb to find ...
2
votes
1answer
377 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 ...
2
votes
0answers
937 views

High speed photography using RPi Camera module

I'm trying to capture high speed water flow movement in a small dark chamber with a cool white 5 W high power LED as a flasher. My target is to achieve quick exposure using 0.8 millisecond light pulse....
2
votes
0answers
92 views

How to manually adjust system clock for testing purposes

I have written a Python script that is set to run different functions at different days/times. I would like to test it by setting the system clock to 1-2 minutes before the dates/times that the Python ...
2
votes
0answers
70 views

Crontab + LCD display strange behavior

I have my Raspberry Pi hooked up to 16 x 2 character display the date on launch. The display has a i2c module on the I have placed this in crontab (without the sudo thingy, so user) : @reboot ...
2
votes
1answer
356 views

Raspberry pi freezes after 20 minutes of use

using tkinter i have made a GUI in which a video plays continuously in a loop until the ultrasonic sensor detects a person in front of it. when a person is detected it displays a messages"hi..welcome"....
2
votes
1answer
257 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....
2
votes
0answers
271 views

GPIO Edge detect setup on 3 pins, when one changes all callbacks are called

I have a PI setup with 3 sensors (reed switches) and 2 "outputs" to a relay. They are on pins (8, 10, 12) I have pin 3 setup to drive the first relay and pin 5 setup to drive the second relay. I ...
2
votes
0answers
239 views

How to use PC Joystick from Raspberry PI via TeamViewer?

I've installed TeamViewer 11 Host in my Raspberry PI 3 and I can access my Raspberry PI by using the TeamViewer. But the problem is that, I can't access my Joystick that is connected in my PC from ...
2
votes
1answer
210 views

Barcodes: Problem with OpenCV

I'm an absolute beginner with Python, but unfortunately I have to reach in a RPI project within 20 days. My task is to build a Barcode-Scanner. This is the code I want to use: github: loleg/iotcam.py,...
2
votes
0answers
285 views

Latency on a Raspberry Pi camera

I'm making a flight controller and want to stabilize the x-y plane using optical flow, which requires almost instantaneous processing thus requires almost no latency. How much latency does the Pi ...
2
votes
0answers
582 views

Failed to add edge detection runtime error

from gpiozero import Button btn = Button(4) while True: print("begin") btn.wait_for_press() print("Pressed") btn.wait_for_release() print("Released") This code worked at first but ...
2
votes
0answers
216 views

multiple DS18S20 temp sensors without using 1wire

Can anyone tell me if it is possible to connect the multiple DS18S20 sensors to different GPIO ports and pull the temperature on different ports, as opposed to a single wire option where I can only ...
2
votes
0answers
454 views

Raspbian Reboot Hangs

Having a bit of a problem on Raspbian Jesse. I have 2 switches which I use to shut down and restart my raspberry pi. Python does an os.system ("sudo reboot") and os.system("sudo shutdown -h now") on ...
2
votes
0answers
661 views

Increase FPS PiCam in Multiprocessing

Currently, my system is only producing 10 FPS out of 20, which is my target. I'm barely hit 15 FPS in single grab-and-show simple code like this: from picamera.array import PiRGBArray from picamera ...
2
votes
1answer
3k 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 ...
2
votes
0answers
702 views

ffmpeg on raspberry pi

Whenever I use ffmpeg inside a Python script using subprocess it doesn't work. Here is the code I am using: import subprocess subprocess.call('ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /...
2
votes
2answers
14k views

Raspberry PI GPIO not working

I just got a raspberry pi 3 B+ model and have wrote some scripts to create an LED pattern. Everything worked and then suddenly stopped. Now every time I run a python script through sudo python #...
2
votes
2answers
836 views

Problems with RFID-RC522 and Raspberry PI B

I'm trying to use the RFID-RC522 with my RPi. The script work but I dont get any response no matter how long or how many cards I use, the module is working because I tested with an Arduino. I use this ...
2
votes
0answers
277 views

Unexpected voltage drop on GPIO 16

I have written a sprinkler timer system (Python) for the Raspberry Pi 2B+. The Pi is connected to a 2 line LCD, 4 switch circuits, and an 8-way relay board with all 8 relays being used, and the 5V and ...