Stack Exchange Network

Stack Exchange network consists of 174 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

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.

0
votes
0answers
10 views

press s to start with a counter in seconds and tap photo in 0 seconds and then one in 5 seconds with counter picture

press s to start with a counter in seconds and tap photo in 0 seconds and then one in 5 seconds with counter picture. I'm not able to put a counter just my name. What this code is doing is ...
0
votes
1answer
15 views

How to remote raspberry run python file by ssh don't need type password

I just want to run a python file on raspberry pi and use terminal code ssh. So, I don't want type password to do that. What should I do?
0
votes
0answers
8 views

Error while upgrading about python unicornhat

I am having a problem while trying to upgrade my Raspberry Pi. It was a simple routine upgrade. I did update before upgrading. However, there seems to be an error while upgrading. The error is a ...
1
vote
0answers
21 views

Rasperry, flask and missing libraries

I have installed Apache2 on the Raspberry and the idea is to run a Flask app. I managed to write a very simple app: import requests from flask import Flask from flask import make_response from flask ...
2
votes
2answers
22 views

SPI xfer2 callback possible?

I would like to control 10 different devices with SPI. As there is not enough ChipSelect outputs I use GPIO to toggle a MUX on the clock. Problem is I have to wait until the SPI is done transmitting ...
0
votes
2answers
42 views

How to run a python program from a bash script on startup?

I have a python script that is located at /etc/testscripts/WebServer. I call this usually from the command line by calling sudo python3.6 /etc/testscripts/WebServer. I have a bash script that looks ...
0
votes
0answers
20 views

collaborative music creation + online interpreter for sonic-pi

I would like to create an online interpreter that can be used to run sonic-pi. The goal of this being to allow people to collaboratively control the sandbox environment to create music with sonic-pi ...
0
votes
1answer
16 views

Fade screen on sleep and brighten on wake

I'm looking for a way to control the screen brightness from code. I saw this post but this just turns the screen on and off. How can I dim the screen before it goes to sleep instead of just turning it ...
0
votes
1answer
22 views

run an py file with systemd

i am trying to make the file to run on startup with rasbian STRETCH , the file need to be execute like this "configurator.py settings.conf" with this config it doesn't work [Service] Type=idle ...
1
vote
1answer
15 views

python pointing to wrong ssl version

For a project i need to be using ssl 1.0.2. For some reason though python seems to be pointing to a wrong version. i have installed pip pyOpenSSL and upgraded libssl-dev and python3-openssl, but ...
0
votes
0answers
21 views

Omxplayer array [on hold]

I am attempting to run an array with mp4’s in a folder and play them at random through omxplayer. My result is the system looking for a mylist file and not entering the folder for the mp4’s. Any help ...
1
vote
2answers
83 views

Why does my circuit keep burning out Raspberry Pi pins?

I have a reed switch (actually several reed switches) that came pre-installed in my home as alarm sensors. When the 2 parts are together, the circuit is closed, when the 2 parts are apart, the ...
0
votes
1answer
17 views

starting up radio and one led

I'm using this in as my /etc/init.d/pirateRadio.sh the Radio does play a wav with this in the rc.local export PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/sbin:/usr/bin sleep 10 ( exec &&...
0
votes
1answer
26 views

LED pwm fading is flickering

This is how I'm fading some LEDs using a logarithmic function. But with that the LEDs are flickering somehow. I don't understand why... import time import math import RPi.GPIO as GPIO GPIO.setmode(...
0
votes
0answers
21 views

Interfacing Big SpaceBar Button with Raspberry Pi & perform certain task on pressing [closed]

I am working on a project in which I have to play 5 mp3 songs in a sequence one after another. Each song has a duration of 10s. For that purpose, I am using pygame library. All is working fine but I ...
0
votes
0answers
35 views

How to read RAW Picamera jpeg images in python

I acquired a set of images with the command raspistill -r -ss 100000 -o image.jpg, and I'd like to process the 'JPEG+RAW' images, which I already obtained, with OpenCV on python. I am aware of ...
3
votes
1answer
139 views

Multiple /etc/rc.local?

I run a Python program in a screen session which is started from my /etc/rc.local with this command: su me -c "screen -d -m /usr/bin/python /mnt/usbdrive/pgms/mypgm.py" Recently my program has been ...
0
votes
0answers
19 views

Play the video in OMXPlayer similar to python-vlc or alternative way to play mp4 files

I am using the below function to detect whether there is an object/obstacle in front of the camera and play a video accordingly. The code below is called upon by another script which handles serial ...
0
votes
0answers
89 views

How to fix, “RuntimeError: threads can only be started once” error? [on hold]

I am making a line follower Robot using Raspberry Pi. The robot will follow a black line and the 3RGB-LED will remain on and green I The robot will encounter an object along its path which will ...
0
votes
1answer
36 views

pip install is giving weird errors on a RPI 3B+ with rasbian

If I try to install something using pip it gives me a weird error. Time is set correctly and sudo doesn't change anything. For example I try installing conan pip install conan​ gives an error: pi@...
0
votes
0answers
17 views

control raspberry pi across wan using Android app

I want to monitor some dry contract sensors attached to gpio of a raspberry pi. For this I want to create an Android app in which i can setup gpio for eg(gpio-1=doorsensor). Once the gpio is setup I ...
0
votes
1answer
27 views

How to light up picamera LED without taking photo

I want to light up the picamera LED using python for a few seconds as a test to see if it works, without actually taking a photo. And yes I know I can test that by just taking a photo and watching it ...
0
votes
0answers
28 views

Remote debugging a python script fails

I am running into problems with remote debugging a Python script on a Raspberry Pi 2 Model B Version 1.1, where I followed the advices in this blog post. The script basically starts with import ...
0
votes
0answers
19 views

Picamera: set shutter_speed with RAW acquisition

I'm using a RPi zero W with a camera V2 to acquire RAW images (I used this). However, I would like to set the shutter speed; I used this to do that, but that doesn't work: import time import picamera ...
0
votes
1answer
28 views

using iso 15693 NFC tags on Raspberry with rc522

Is it possible to read/write ISO 15693 NFC tags using an RC522 chip? So far I do not have much experience with the chip, I downloaded this https://github.com/mxgxw/MFRC522-python library but ...
1
vote
2answers
37 views

Multithreading/infinite loops affecting sensor values

I run a Python script on my RPi that manages all the sensors on the board and communicates with another machine using TCP sockets. The project gained in complexity and my script now has 5 threads ...
1
vote
1answer
50 views

Trigger Python Script on Raspberry Pi from Windows

I have following situation (and problem): Setup: Raspberry Pi Zero W, connected to a Windows client via USB-OTG in Ethernet emulation mode. The Pi is controlling a single servo motor, via Python ...
1
vote
0answers
38 views

Having trouble on one of the raspi official projects “getting started with GUIs”

I have raspi 3, and working on "Getting started with GUIs". I am currently on this page (https://projects.raspberrypi.org/en/projects/getting-started-with-guis/11) and having trouble at the line ...
0
votes
1answer
43 views

How to use an ultrasonic sensor with nanpy on Raspberry Pi?

I have been trying to run the following code on a Raspberry Pi, to use the ultrasonic sensor HC-SR04 with an Arduino that is a slave to a Raspberry Pi: from nanpy import ArduinoApi from nanpy import ...
0
votes
0answers
16 views

QT5 Stylesheets not working on Raspbian

I'm using QT5 and Python to make a GUI. I have this code: self.ui.btn_light_on.setStyleSheet('background-color: green') On Windows 10 and Ubuntu it colors the button green as needed. I want to use ...
0
votes
0answers
25 views

Running python in PHP shows error. -sudo: no tty present and no askpass program specified

I want to run a python script to turn an led on from PHP. The script did not run. I used echo to print the error. It said "sudo: no tty present and no askpass program specified". What should I do? ...
1
vote
2answers
40 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 ...
1
vote
2answers
60 views

open a terminal on boot and auto-run a looping python script

When my RPI3 is booted, I would like it to automatically have the terminal open with my python script already running. Note that it loops endlessly. I want to open the terminal so I check the output ...
1
vote
1answer
45 views

Python script not running when added to crontab

I have an on_reboot.sh file that contains the following: #!/bin/bash source /home/pi/.profile workon cv cd /home/pi/reboot python pi_test.py After that I made the file executable using $ chmod +x ...
0
votes
0answers
31 views

From Python: Can I display a simple HDMI page (from a link)?

On [perhaps] a pi-zero in a box with it's own small screen. I'm attempting a mini-project in Python that displays a non-interactive HTML{5?} page hosted by a website dedicated to providing public ...
1
vote
1answer
44 views

keep reading the same value from air pressure sensor (MS5611)

I have bought a GY-86 sensor. it is comprised of an accelerometer/gyroscope (Mpu6050) a magnetometer(HMC5883L) and a barometer(MS5611-01BA01). all these sensors have I2C interface. I am reading the ...
0
votes
1answer
79 views

serial errno 25 inappropriate ioctl for device

I have raspberry pi 3 B+ running latest raspbian-strech lite. i have a max485 ic connected to uart on the gpio. import serial,fcntl, struct ser = serial.Serial( port='/dev/serial0', ...
1
vote
0answers
87 views

RPi.GPIO - Properly Wiring and Setting Up Pins for Button Inputs

Edit: Breadboard, schematic, and code updated. I accidentally fried my Pi by shorting it out through the GPIO pins, so I figured it would be a good idea to ask for some help before trying my current ...
1
vote
0answers
46 views

Python HID API's for RPi's

I realize that solutions exist for having an RPi emulate an HID device (Can the Pi Emulate an HID device with via USB?) but are there any existing API's that can achieve the same thing as https://...
0
votes
1answer
40 views

GPIO event handlers and inter-thread communication

I have a Python script using callback functions to react to GPIO events, as described here: https://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/ The description states that Python runs the ...
0
votes
0answers
36 views

Issue with running python script at start

Im currently running a python script at boot up using the rc.local method. it works great when i have my mouse, keyboard and monitor connected. However, the end goal of this project is to be able to ...
0
votes
1answer
55 views

Using the HMC5883L on the GY87

This was touched on in this question, but I was unable to get the solution to work: (Not all devices that are connection via I2C are showing) I have a GY-87 multi-sensor module and can get the IMU (...
0
votes
0answers
19 views

GPSD transfer timestamp

I am using gpsd on a raspberry pi connected to a serial GPS and transferring GPS fix to all other connected devices on the same network. Is there a way to transfer unix timestamp along with the GPS ...
0
votes
0answers
71 views

Problem with Pi Cam / Python / opencv: “Incorrect buffer length for resolution 640x480”

I want to build an animal counter based on pi zero w, pi cam, python and opencv. I read some tutorials (especially from https://www.pyimagesearch.com) how to setup all that stuff and in principle ...
0
votes
2answers
77 views

Host a website on the raspberry pi to display local sensor data [closed]

I have been enlisted by the local engineering club (as a programmer myself) to help with their hydroponics project. Basically they are needing help accessing the Pi remotely and this is as much as i ...
0
votes
2answers
42 views

How to make a service to run a python script which includes browser automation

I have python script which is using selenium web driver to do some web automation task. This python code is running perfectly fine when I am running it from the terminal. It launches firefox and does ...
0
votes
1answer
24 views

Rasp Pi, pip error setup.py egg_info

I am new to pi and I wanted to test it out on a python module for talking to building automation devices. Its called BAC0 From the documentation: https://bac0.readthedocs.io/en/latest/getstarted.html#...
1
vote
0answers
33 views

Raspberry pi controlled automated drone [closed]

I have to make an indoor drone(no GPS). The input to the drone will be the starting coordinates and the ending coordinates. I have an indoor map. How do I make this? The raspberry will be onboard the ...
0
votes
1answer
33 views

Executing multiple scripts on startup in a particular order

I am running Raspbian GNU Linux (9) Stretch, on my Raspberry Pi 3. Project Overview Python script which makes use of 2 inputs to the Pi. Calculations are performed based on these inputs, and values ...
0
votes
0answers
116 views

OpenCV : Gtk-WARNING **: cannot open display:

I got a python script supposed to load a video. My Pi set up in headless mode and I would like not to use any X server for displaying the video but instead having the video displayed to the hdmi port....