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

Raspberry pi - Run python on boot problem

I have a python script which runs every time the pi starts up, it moves a stepper motor for a timelapse camera. However for some reason it doesnt run the command in the PY script after the camera is ...
0
votes
1answer
936 views

Add own program to Panel Applets

I have a small python program that prints the temperature every second. How can I add this program as a Plugin to my Panel? I can see that in the file ~/.config/lxpanel/LXDE-pi/panels/panel there ...
0
votes
0answers
207 views

Crontab doesn't work after reboot by cable plugging out

I have a crontab task for python script (IOT hub by microsoft) launch. It launches properly after "sudo reboot" and by manual script launch, but doesn't launch properly after reboot by cable plugging ...
0
votes
1answer
516 views

`crontab` fails to run Python3 code at boot (no GUI involved)

After searching for some time- I can;t find the reason that my python3 code won't execute during boot. I'm using Rpi Zero, using StrechLite OS. Code run OK when is executed from command line. crontab ...
0
votes
0answers
91 views

python error from RPi.GPIO

Im getting an error "Error waiting for edge" In this script: import RPi.GPIO as io import time from picamera import PiCamera from datetime import datetime #PIR setup pir_pin = 4 io.setmode(io.BCM) ...
0
votes
1answer
638 views

Use RFID reader AND a 4x4 matrix keypad with breadboard

I am trying to set up a pi to use rfid to scan a card and if the card is correct, the user will enter in a 4 digit code into a 4x4 matrix keypad. Each device works perfectly fine independently however ...
0
votes
0answers
205 views

Python, RpiZero and gpiozero

I'm coding on Rpi3 using python3. When trying to run a code, containing a gpiozero lib - it fails when running on RpiZero, while succeeds on Rpi3. RpiZero contains gpiozero lib Trying to find the ...
0
votes
1answer
3k views

OpenCV VideoCapture.isOpened() always returns False?

I followed the installation tutorial at https://www.pyimagesearch.com/2017/09/04/raspbian-stretch-install-opencv-3-python-on-your-raspberry-pi/#comment-451314 , and everything installed fine. But I ...
0
votes
1answer
299 views

Pigpio not closing

I have a program that is meant to read data: import pigpio pi = pigpio.pi() if not pi.connected: exit() h = pi.i2c_open(1, 0x5a) c, data = pi.i2c_read_device(h,0x09) print(data) pi....
0
votes
1answer
172 views

Python requests.post - intermittent failure when connected to Huawei E5330 MiFi

I have a python script running on startup on a number of Raspberry Pis (model 3). The script watches a serial port for data from an air quality monitor then posts this data to a web server using the ...
0
votes
1answer
215 views

Accessing terminal running in background [duplicate]

I have a python script running on my rpi, which is starts from rc.local file. The script itself is working fine as it should, silently in background without opened terminal window. But in case I want ...
0
votes
1answer
242 views

Python GPIO.add_event_detect works the wrong way around

I have a problem working with some IR Sensors. They are supposed to trigger "my_callback" when they do not sense an IR signal. At the moment they trigger as soon as they DO recieve an IR signal. I ...
0
votes
0answers
2k views

Connecting Raspberry Pi 3 to MSSQL Server using pyodbc

I am currently trying to get my raspberry pi 3 with Raspbian Stretch Lite (November 2017) connecting to an MSSQL Server. I was following this guide and replaced the Driver and the Setup fields with ...
0
votes
1answer
43 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
2answers
2k views

Raspberry Pi Camera uv4l stream a recording at the same time with Picamera

Im using uv4l to stream from my raspberry pi, and it works perfectly but if i wanna use a python script to record while streaming i'm getting this error: mmal: mmal_vc_port_enable: failed to enable ...
0
votes
1answer
704 views

Raspbian Picamera web stream and record

I've been searching this for a while and I found a few posts that look interesting but it doesn't do what I really want. I am trying to set up a Raspbian security camera that records the video to a ...
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
0answers
1k views

UART connection between STM32 an Raspberry Pi

i'm trying to establish an UART connection between STM32F4 and Raspberry Pi 3 to send motion sensor data. STM32 C code: /* Includes --------------------------------------------------------------...
0
votes
1answer
490 views

Lighttpd running FastCGI script hangs and give 500 internal error

I'm attempting to use lighttpd and fastcgi to run a small flask application. When I try to start lighttpd, it starts the server just fine, but when I try to connect in the browser, it hangs without ...
0
votes
1answer
106 views

Converting value from light sensor into picamera shutter speed

I'm trying to make a shutter speed variable based on a reading from an adafruit TSL2561 lux sensor. Lux is converted to an Exposure value using the equation in my code below, and then an shutter speed ...
0
votes
1answer
507 views

camer.start_preview() not working?

When I run my python script the contains: import picamera from time import sleep camera = picamera.PiCamera() camera.start_preview() sleep(10) camera.stop_preview() The script just runs and shows no ...
0
votes
1answer
355 views

webiopi write to log when button is pushed

Trying to learn the webiopi and python. I have a simple button to turn off and on a relay. Here is the HTML <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/...
0
votes
0answers
271 views

Why can't my Pimoroni HyperPixel display detect multiple fingers correctly?

I recently bought PIMORONI HyperPixel Display (3.5 Capacitive 800x480 display, driven by internal ADC) The driver is written in Python using the EVDEV lib but there are some problem reading multiple ...
0
votes
2answers
148 views

Can't turn on LEDs through terminal with PWM

I wrote a crappy Python script that should turn on LEDs connected to the GPIO interface. import RPi.GPIO as GPIO import time, sys, json GPIO.setmode(GPIO.BCM) GPIO.setwarnings(False) gpioPorts = [...
0
votes
1answer
330 views

Pi Camera recording function needs to loop each hour

I have made good use of this forum over the past year as I have been creating a birdbox with camera for my mother. Until now I have been able to find an answer to all of my questions but this time I ...
0
votes
0answers
552 views

Want to find difference between two frames, but get a lot of noise because of the auto changing on exposure, brightness…(not sure) of the webcam

As title, I tried to use Raspberry Pi + logitech webcam to find the difference between two frames, the following is the code that I used: import cv2 #capture from camera at location 0 cap = cv2....
0
votes
2answers
873 views

RPi-iOS communication over WiFi

Here’s my plan: have a python script running hardware pwm code for a brushless motor im using. The idea is to have an iPhone have an app where 1. The python code can be interacted with to adjust a ...
0
votes
0answers
584 views

cron job not starting on bootup

I've created a cron job and it does seem to be running. This is the line I've put in cron file : @reboot python /home/pi/Pimoroni/bme680/Indoor-Air-Quality-MQTT.py & I ran the command grep CRON ...
0
votes
1answer
236 views

Can´t run 192.168.45.34/cgi-bin/script.py from another pc

I can run my python script locally from console terminal, but when I try to run it from another pc I get Internal Server Error-500, This is the script I tried to use os, commands and subprocess and ...
0
votes
3answers
4k views

Variable which can be used between a python and php file

I need 14 variables globally whose value can be manipulated by both php and python program. The python program just wants to read the value of the variable. The PHP program should write the value of ...
0
votes
2answers
2k views

function button.is_pressed from gpiozero do not work

Im working on a university project with raspberry and gpiozero. I need to manage the button response to take diferent actions. The problem is that de function button.is_pressed its always true (even ...
0
votes
1answer
1k views

RPI Run a Python script fan speed control while loop until shutdown

So I have recently created a VPN server on a raspberry Pi 2 Mobel B, and I would like to create a script that will read the CPU temperature and change the PWM signal that is fed into a transistor to ...
0
votes
0answers
399 views

waveshare 3.2" LCD touchscreen touch functionality stopped working

I'm using this touchscreen on a raspi zero w and I'm currently working on a python application. I was working with the python serial module since some time and everything was working fine, but since ...
0
votes
1answer
351 views

Very simple flashing 8-LED ring and button on Raspberry Pi 3

This is my first Raspberry Pi project that involves an LED ring with button control, and I have some very basic questions. I am making a halloween costume with a Raspberry Pi and this SparkFun ...
0
votes
1answer
659 views

Multi-User In-Memory Database

For a project I'm currently working on I collect data from different sources (e.g. GPS Dongle, OBD-II, etc.) and displaying them on a small touchscreen display using PyGame and TSLIB. The whole ...
0
votes
0answers
427 views

RP3 to Arduino - Why am I receiving unwanted bytes with pySerial?

I'm new to RP3, but fairly comfortable with Arduino. Maybe this is an easy one. I am trying to use pySerial to send a single byte from a Raspberry Pi 3 to an Arduino Mega 2560, like so: #RP3 python ...
0
votes
2answers
3k views

smbus write_word_data command

I am trying to use the smbus write_word_data command which takes three arguments addr, cmd, value - all of the documentation that I can find tells me that I need to specify cmd, but gives no clue as ...
0
votes
0answers
1k views

GPIO callbacks throw segmentation fault

I am using callbacks to sense obstacles in a small robot. A left sensor and a right sensor. Therefore I add an event twice. Now when the callback is called I remove the event and then later add it ...
0
votes
1answer
316 views

Text overlay over video stream when saving to file system

I'am using raspberry pi zero as controller which communicate over UART with external board with five sensors. What I need is a way to save video stream from raspicam to filesystem with embedded text (...
0
votes
1answer
86 views

How can I get the set attribute of each “device” in an array

What I am wondering is how I can loop through paired_devices and get the "name" attribute for each device. This is only a short amount of the code, if more is needed, feel free to comment below. def ...
0
votes
0answers
204 views

After python3 script run I can't run any program anymore

From time to time when breaking a python3 program I encounter a very strange problem. To illustrate it I have taken the screenshot: Started program works (like the htop in the another terminal window)...
0
votes
2answers
114 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 ...
0
votes
1answer
1k 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 ...
0
votes
1answer
140 views

Python: fail to execute gpiozero Button command inside Class

while this code succeeds: def press_on(): print('press') HWButs = gpiozero.Button(21) HWButs.when_pressed = MainApp.init_buts.press_on inside a class, pressing the ...
0
votes
1answer
525 views

PI2 Reading data from RFID RC522 Mifare

so i am trying to get the data from a mifare card and i can't get the same reading i get on windows. On windows my card data is a 10 digit code like: 4852658522 Even though i can dump the data on the ...
0
votes
1answer
2k views

Problems installing Scipy stack for Python3.6 on Pi-2

I am faced with an apparent time consuming problem or something else when I try to install scipy with pip for python3.6 on my RPi2 model B. OS is Raspbian minimal (jessie). I am using a RPi2, and I ...
0
votes
0answers
4k views

Flask running python scripts with different html buttons

I'm trying to build a web page using Flask and Python on my Raspberry pi which has about 20 different html buttons which when clicked will play a different sound file each. So far I have created a ...
0
votes
1answer
129 views

GPIO button to complete input prompt

I would like to prompt the user for input, then with the push of a GPIO button, submit the input value. This is tricky since the GPIO button polling is typically done in a loop. I was thinking that ...
0
votes
1answer
544 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
0answers
3k views

programming a robotic arm

i want to programming my robotic arm (5 servo motors) with python ,so i wrote a python code but my problem is that when i try the code lines separately from terminal window it works fine and robot ...

1
46 47
48
49 50
54