Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

3
votes
0answers
264 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
488 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
0answers
760 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
517 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
310 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
2k 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
585 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
279 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
0answers
39 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
39 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
38 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
88 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
85 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
0answers
61 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 ...
2
votes
0answers
262 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
0answers
716 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
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
0answers
872 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
82 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
62 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
0answers
243 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
232 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
0answers
270 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
562 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
210 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
402 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
616 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
0answers
654 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
0answers
266 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 ...
2
votes
0answers
1k views

Emulate a Bluetooth Keyboard with a Raspberry Pi 3

Raspberry Pi 2 Model B (Raspbian Wheezy and bluez 4.99) Executes perfectly using a Bluetooth dongle. Raspberry Pi 3 Model B (Raspbian Jessie and bluez 4.99) Attempting to pair with Windows laptop ...
2
votes
0answers
7k views

Using Python with Bluetooth on Raspberry Pi 3

Following this tutorial I successfully ran PiTooth on the RPi2MB (Wheezy). Following the same tutorial on the RPi3MB (Jessie) I get the following message "Could not configure bluetooth. Is bluetoothd ...
2
votes
0answers
400 views

Raspberry Pi Robotics: How to follow line?

I'm making a raspberry pi robot in Python and it moves, but it does not follow the line and I am using an infrared line sensor. I think that I have done everything properly. Here are some results by ...
2
votes
0answers
1k views

SpiDev - spi.xfer([xxx]) -> Invaild argument error -> what?

I got trouble with a seemingly dumb-proofly simple code: import time import pigpio import spidev DS = 17 STCP = 27 SHCP = 22 MR = 5 spi = spidev.SpiDev() spi.open(0, 0) spi.xfer([0b10011011]) ...
2
votes
0answers
704 views

Low-latency SPI for MCP 3008

So, I am using the SPI interface on the Pi 2 model B to communicate with a MCP 3008 ADC chip, following the tutorial on http://www.raspberrypi-spy.co.uk/2013/10/analogue-sensors-on-the-raspberry-pi-...
2
votes
0answers
936 views

OpenCV. Can't open video from usb camera on the screen

When I'm trying to start simple code, the frame opens and don't respond. import numpy as np import cv2 cap = cv2.VideoCapture(0) while(True): ret, frame = cap.read() cv2.imshow('AIR',frame) ...
2
votes
0answers
567 views

Error running a simple python script at boot

I am attempting to create a button on my Retro Pie emulator case (A gutted NES), using the old reset switch, to exit out the of current game and go back to the menu. Then I realized it just required ...
2
votes
0answers
118 views

GPIO goes high on first initial run of script - please help get my ECTO 1 on the road!

I am having a few problems with my script, on a fresh boot of my pi, the GPIO Port goes High and switches my relay when I run this script, however, it doesn't do it after I initially run the script, ...
1
vote
0answers
20 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 ...
1
vote
0answers
30 views

PiCamera vs VideoCapture

So I have a project that requires Computer Vision (video stream). But when I want to try my Pi Camera (not USB), there's two method that I can use. They are PiCamera.capture_continuous and cv2....
1
vote
0answers
11 views

Launch a python script in a lxterminal window using supervisord

I'm trying to launch a python script in a lxterminal window using supervisord. I'm stuck on using supervisord than a .desktop file. I'd like to keep the process running on loop Below is my config: [...
1
vote
0answers
13 views

PICamera white balance difference between preview and capture

Below is a screen shot of the preview and the captured image of the same scene taken from a single PICamera at the same time. As you can see the one on the left (the capture) is noticeably bluer than ...
1
vote
0answers
26 views

efficiency of python sleep function to set a raspi pin HIGH and pause the script

I am continuously measuring some parameters using Raspberry Pi. I am using Python. When the measured value is higher than a particular value, I want to set a GPIO pin high (for some LED indicator) and ...
1
vote
0answers
30 views

Mouse Control Function in Python for Raspbian

Does anyone tried to control mouse cursor position and click in Python application for Raspbian before? I am refering to this website: https://pyautogui.readthedocs.io/en/latest/mouse.html#mouse-...
1
vote
0answers
11 views

Can I use the hostname of my Smart Plug in my Python script throughout different WiFis?

I have a Python script which retrieves the measured data from a smart plug so that I can visualize it on my Rasbperry Pi. This command gets the data send_hs_command("192.168.1.26", 9999, b'{"emeter":...
1
vote
0answers
14 views

Running mongodb as as service increases boot time by 30 seconds

Title says it all. I have an RPi 3 with Raspbian that has a web app running at start up in chromium. It took 20-30 seconds from powering on to the app appearing before I added mongo, and after I ...
1
vote
0answers
94 views

Error opening USB Cam with OpenCV4: GStreamer-CRITICAL **: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed

After installing OpenCV4.0 on my RPi, i tried a simple script below with a Logitech USB Cam (720p) but at "cam = cv2.VideoCapture(0)" it gives me an error "(python:num process): GStreamer-CRITICAL **: ...
1
vote
0answers
52 views

Getting Error: ImportError: No module named 'cv2' in Geany python editor

I'd finally installed OpenCV 4.1.0-dev in my raspberry pi with success, I checked that in Terminal by : pi@raspberrypi:~ $ python3 Python 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]...
1
vote
0answers
24 views

How to set access rights for lighttpd using python scripts (cgi) which uses temporary files

My problem is: I have a running lighttpd web server. The files are stored in \var\www, also a python script, which can be executed to get an image from the raspi camera. Every time the script is ...