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
2answers
252 views

Python on raspberry pi with proxy

I can config my Pi3 to connect to internet via proxy settings but I can not connect my python script to internet with socket lib Return result always fail Is there any lib can support this ? Note: I ...
4
votes
3answers
8k views

How to Connect 6 ultrasonic sensors to a raspberry pi?

I need to connect 6 ultrasonic sensors to one raspberry pi and all six sensors should take the distance measurement same time. I have written the code and made the thread also but only two sensors ...
1
vote
1answer
482 views

Why is PIR motion Sensor always on?

I'm trying to make an alarm system but the motion sensor is always on as soon as the script is run. I've posted a question about a different problem i was having with this project so it'll confusing ...
4
votes
5answers
16k views

gpio library on windows while developing

I am new to Python so maybe this is not an appropriate question. I am working on a project on Python that will use GPIO functionalities of the raspberry Pi. Right now, I am developing the python code ...
-2
votes
0answers
26 views

Refresh Tkinter GUI

I'm using tkinter and trying to make a gui that will display data and refresh, however the master.after function is not working as intended. Wondering if anyone can tell me why. My goal is to have the ...
0
votes
1answer
118 views

Problem with LED blink program on Pi

I am completely new to RPi and stuck unexpectedly. I am trying to create a simple python program to make my LED blink. Here are the two programs which are giving same outputs on terminal when I ...
-1
votes
0answers
15 views

speedtest-cli: download speed 0 Mbit/s

I used a small python script to monitor download speeds at different times. I deactivated it for some weeks and wanted to start again today. Before I run my script I wanted to test if everything is ...
-1
votes
1answer
110 views

Piezo sensor to pick up acoustic instrument signal using Rpi and ADC

I want to read analog inputs from piezo sensors like these on Raspberry using python, which ADC do you advise me with 8 or more channels and how to wire and program it to get digital values?
0
votes
1answer
91 views

Piface Digital Master and PiFace Relay Plus Slave

I wish to control four state reconfigurable antennas in a propagation measurements using RPis at both ends of the propagation channel. The headless master RPi has a PiFace digital to control the start ...
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,...
0
votes
1answer
416 views

Lego EV3 infrared sensor to raspberry pi 3 direct connection via UART?

I connected this sensor with raspberry via UART( I have found that this IR sensor is one of few Lego sensors that connects via UART), and make serial_read and serial_write python scripts, just to test ...
0
votes
0answers
5 views

Pi Camera v2 Capture Photo without warm-up

I want to a project that capture some photos at a time. After taking photos i will send theese pictures to a windows platform to encoding. I saw so many examples about taking photos but i every code ...
-1
votes
1answer
41 views

Stepper motor vibrates, does not turn

I´m working on a simple project for school now and I have to use a stepper motor, but it doesn´t turn. The LEDs go on, the motor gets hot and the motor vibrates. When I adjust the sleep/function, the ...
1
vote
1answer
499 views

Running a Python Telegram bot at startup and 24/7

I would like to use my Raspberrry Pi (Raspbian Stretch) for running a Telegram bot. I already wrote the script and it works perfectly, when run in the 'Thonny Python IDE', because there it doesn't ...
1
vote
2answers
570 views

Runtime error A PWM object already exists for this GPIO channel

iam new to raspberry pi and i got an error while a running servo motor in my object detection script i need to run the servo whenever my if condition is true so the same pin run multiple times if ...
24
votes
2answers
40k views

How to get Python to work with Lighttpd?

I've got Lighttpd setup on my Raspberry Pi, but I'd like to get server-side code working now. I'm familiar with PHP, but I figure I should try Python as it's supposed to be the "go to" language for ...
0
votes
1answer
97 views

Error With Taking Time Lapse Photos

I'm trying to take a time lapse using my pi camera but whenever I try and run the code using python the following error pops up: mmal: mmal_vc_component_create: failed to create component 'vc.ril....
0
votes
1answer
257 views

error trying to set up RFIDIOT on raspberry

I am new to raspberry and python in general. I followed different guides to set up RFIDIOT (even the documentation and the installation guide on the repository on Github). So far, when I run pcsc_scan ...
1
vote
1answer
45 views

upgrade B+ to python 3.7

I have a B+ running rasp stretch and I am attempting to follow this tutorial to upgrade to 3.7 but I have an issue at the this step: ./configure –prefix=/usr/local/opt/python-3.7.0 make -j 4 Any ...
0
votes
1answer
119 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
105 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 ...
2
votes
2answers
351 views

Opencv VideoCapture much faster than PiCamera

I am trying to process frames from my V2 RPI Camera at high framerates and am stuck with the picamera module. The VideoCapture class from OpenCV seems to be much faster than using PiCamera....
3
votes
2answers
8k views

raspberry pi hangs after 2-3 days of continous use

I am using latest the Raspbian Wheezy release with kernel 3.10. I am running four Python programs 24 hours/day on the Raspberry Pi. Three programs out of four are like background services, which ...
3
votes
4answers
237 views

Raspberry Pi run commands on boot

I thought that running commands on raspberry pi on boot was the easiest thing in my project. But it seems that it is complex enough not to work. I've searched a lot on the internet on a simple ...
1
vote
1answer
29 views

PIGPIO problem with delay on scripts

I am trying to run an old Raspberry Pi 2011.12 as a server to control a RGB LED strip. To this I am using PIGPIO since this is the best solution (RPi.GPIO is software based, which creates flickering). ...
1
vote
1answer
213 views

How to toggle button on and off with gpiozero?

I can't seem to find a solution of doing this using gpiozero. I've done it using rpi.gpio with add_event_detect and call back to change state but I was under the impression gpiozero is much simpler. ...
0
votes
1answer
168 views

time.strftime working on windows but not on raspberry pi

I am working on a project that requires pyqtgraph library of python on raspberry pi. It functions well until I added a system time axis on my graphs. What also weird is that the script I am using ...
0
votes
1answer
42 views

How to send data from a raspberry pi zero to my Mac [closed]

So I am working on a project where I need to send data to a Raspberry Pi Zero(no wifi) from my Mac using python. The raspberry pi also has to send data back to my Mac. this process has to be very ...
0
votes
0answers
24 views

Python app scheduler issue on Raspberry pi, i got error like this “python[2132]: WARNING:apscheduler.scheduler:Execution of job”

I an using Raspberry PI zero W and connected 5 sensors to getting reading from sensors. i used services for start the sensors scripts and i installed python apscheduler for time sequence. Sometime ...
1
vote
2answers
23 views

How can I install numpy on a headless REMOTE Raspberry Pi Zero?

I need to install numpy on a remote Raspberry Pi Zero. I know how to do it on a local machine, but my Zero has already been deployed as a surveillance camera running MotioneyeOS. I can SSH to the Zero ...
0
votes
1answer
118 views

Rasberry Pi LED GPIO using Python

In my project I invoke a python script via node.js on my Rapberrypi B+ model and what the python script does is that it turns on the BCM GPIO ports as per the python arguments passed through the ...
0
votes
1answer
126 views

generated pulse with delay time before it generated

I want to generate about 16 square wave with delay time initial as the following figure .It mean each pulse generated must delay with a value of delay time before it generated with frequency about ...
0
votes
1answer
70 views

RPi4B PCA9685 PWM Controlling Servo Problem

I have this RPi3 that I am running a bunch codes on it. It is communicating with a server and also I have python supervisor running on it. Now I am trying to set up the same system on RPi4. For some ...
0
votes
1answer
317 views

Voltage High, low with 0 and 1 using python on a GPIO

Mind the variable creations as they are handled. My questions are the following. 1) Why do we have 2 whiles here? Does the sleep at the end of the first part does really anything significant? 2) ...
1
vote
1answer
261 views

GPIO Input Not Detected Within While Loop

Hi I'm having a problem with trying to detect GPIO input on a PIN within a while loop. Turnstile B Entry button is what I am troubleshooting the statement if tsB_entry_button == False: import RPi....
1
vote
2answers
7k views

Running Multiple Programs at once

How can I run various programs at once. I have a DHT22 sensor sending info to Pubnub, and the LED's program running so I can control the form Pubnub. How can I run both programs at the same time? the ...
0
votes
1answer
42 views

Wireless doorbell using gpiod

Good Morning, I have a non issue that I am just curious how its working. So I have a wireless doorbell that I built. It works using the gpiod and remote gpio. So I have a chime unit that I built with ...
0
votes
2answers
269 views

How to wire a Raspberry Pi to a 16 channel relay module? It won't work

A am using working on a project that requires a camera analyzing some images and activating the appropriate GPIOs to control a relay board. I currently have a touchscreen display, a Raspberry Pi Cam ...
0
votes
1answer
22 views

Callback parameters to GPIO.add_event_detect?

I have a button object that when pressed needs to perform something, and for this I'd need to get a property of the button. I'd like it to work like: ... GPIO.add_event_detect(button, GPIO.RISING, ...
1
vote
1answer
149 views

Start pi_video_looper from Python

I am new to Python so please be kind ;) I am trying to start the Adafruit Video Looper from a python script. Basically I have this code: from pi_video_looper.Adafruit_Video_Looper.video_looper ...
1
vote
1answer
178 views

Python Code for Home Automation times out

I was making a python script for home automation using Adafruit IO as a conduit between IFTTT and the Raspi, and it works great for a while. But after a few hours, it just stops working. I have no ...
0
votes
1answer
112 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 ...
11
votes
2answers
14k views

PiGPIO Library Example for Bit-Banging a UART

The PiGPIO library http://abyz.me.uk/rpi/pigpio/index.html mentions that one of it's features is "software serial links using any user gpio". I take this to mean that you can use it to generate a ...
0
votes
1answer
131 views

Run a python script when start up and SSH not log in

I am new to programming and doing a simple academic project with Raspberry Pi, I have a script which will monitor the changes of database and output the change with 2 different color LED. I want it ...
2
votes
2answers
544 views

Raspberry Pi to Arduino Serial (UART Using GPIO Pins TxD, RdX ) Communication Not Working

I'm trying to connect my Arduino to my Raspberry Pi using the GPIO pins. I understand that the Pi uses a 3.3V signal while the Arduino uses a 5V signal so I bought a bi-directional logic level ...
0
votes
2answers
30 views

How to run a raspberry pi program without connected to a desktop screen

I want to be able to run a raspberry pi program without being connected to a desktop screen so the whole idea is to make an object tracking robot using raspberry pi and a camera. This should be able ...
3
votes
1answer
309 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....
2
votes
3answers
520 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 ...
0
votes
1answer
220 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
1answer
239 views

running python script as service and calling functions from another program

I have a python script to control some LEDS. In a compiled c++ program I have been calling python scripts like so in various places: system("python /home/pi/leds_flash.py") system("python /home/pi/...