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.

-1
votes
0answers
8 views

Cannot turn web streaming into a function

I'm working on a project with my Raspberry Pi 0 and a camera. I'm writing my code in Python using the PiCamera module. This file handles setting up the camera and Starting Web streaming. I had no clue ...
1
vote
1answer
83 views

Cannot Load Library “./pxcore.so” to autorun a python script on boot using systemd

I want to run a code at startup but I am getting this error below. The script works when running in python, but I am unsure how to allocate permissions or where to make a path to the pxcore.so file so ...
1
vote
1answer
2k views

Alsa lib error pyaudio on raspberry pi 3

I'm getting these ALSA lib errors when trying to use pyaudio. I know my mic works as I can live stream audio through gstreamer. Can anybody explain to me why i'm getting these issues: ALSA lib ...
-1
votes
1answer
30 views

RASPBERRY PI Error Python GUI : “no display name and no $DISPLAY environment variable”

Hi guys I want to create a basic GUI with TKinter. This is my code from tkinter import* import tkinter.font win =Tk() win.title("Test") myFont = tkinter.font.Font( family = 'Helvetica', size = 12, ...
0
votes
2answers
94 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 ...
2
votes
1answer
49 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....
1
vote
2answers
39 views

Recover from broken pi (no python)

I wanted to reinstall python but totally forgot that raspi uses python so I broke it... I restarted it ´cause nothing was running/it was frozen. I got a login screen which I never got before and ...
2
votes
3answers
352 views

Run rpi_ws281x without sudo

I compiled the rpi_ws281x Library and the neopixel python wrapper following the instructions on https://learn.adafruit.com/neopixels-on-raspberry-pi/software Link broken try https://github.com/...
0
votes
0answers
9 views

selenium.common.exceptions.WebDriverException: Message: connection refused

I ran a program with selenium from selenium import webdriver driver = webdriver.Firefox() driver.get('http://www.google.com') and this error accured Traceback (most recent call last): File "/...
0
votes
1answer
100 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 ...
5
votes
1answer
394 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 ...
0
votes
1answer
89 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
187 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
382 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
11 views
0
votes
1answer
26 views

False Contact Closures - Do I Need Physical Pull Up Resistors to Resolve?

I'm running Raspbian Jessie 4.9.35-v7+ on a Pi 3 Model B. I cobbled together a basic python script to monitor a GPIO pin and send a network signal to a remote application, made two copies of the ...
0
votes
0answers
13 views

No available Audio Device after switch from NOOBS to Raspbian Stretch

my program uses Pygame to play sounds. I used Noobs before and my program worked fine in Thonny. Now, i switched to Raspbian Full Stretch and now I get the error No available Audio Device. I already ...
1
vote
4answers
43 views

Pi - own python startup script in the wrong order

I've written a python script to connect to mysql & insert the current time then close. The use case is if my Pi browns out/restarts (often does) the time of this event will be logged. The script ...
1
vote
1answer
34 views

Speed up SPI transfer

So I need to transfer a byte on the spi interface on raspberry pi. Here's my code in python import spidev import time import binimp fhandle=open("white.txt") initial=binimp.extract(fhandle,'192','...
4
votes
2answers
15k views

How to trigger GPIO event using an active infrared sensor

Trying to get an active infrared sensor to trigger an event on a GPIO pin. I'm using python and the RPi.GPIO library on an RPi model B. Some background info, not sure how relevant it is, but I'm a ...
-3
votes
0answers
27 views

How to send an image from Raspberry Pi to mobile by using program [closed]

I am finding difficulty to send image from Raspberry Pi B to mobile phone via Bluetooth using Python program
0
votes
1answer
21 views

Pi 3 B+ sudden audio failure

A few months ago I bought a RasPi 3 B+ to act as an overglorified doorbell using reed switches to tell the Pi to play a custom MP3 with the "Playsound" Module into the Company's PA system. It worked ...
1
vote
2answers
201 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 ...
0
votes
1answer
93 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
162 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 ...
0
votes
0answers
16 views

Which screen size in Pygame for an 3.5 inch LCD?

i try to fill out my whole LCD screen in Pygame with the best sharp resolution possible. So there is a difference between computer screen and the LCD. My LCD has resolution is 480×320. So choosing ...
0
votes
0answers
21 views

Need help on how to apply arcade kit commands in Python code

I'm using Python on my Raspberry Pi to code some games for my high school finals project, and I want to play them with a arcade kit (Game DIY Arcade Set Kits Replacement Parts USB Encoder to PC ...
1
vote
1answer
120 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 ...
0
votes
1answer
107 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
95 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 ...
1
vote
1answer
63 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. ...
2
votes
1answer
33 views

Raspberry pi 3 RFID RC522 Card UID is not same with USB RFID Reader

I'm working with RFID RC522 using Raspberrypi 3B+. I'm following https://github.com/mxgxw/MFRC522-python this package and works like a charm. I can able to read the data from the card, able to write ...
0
votes
2answers
325 views

PyQt5 not found by Python3.7

I installed Python 3.7 on my raspberry pi with the help of Installing Python 3.7.0 on Raspbian tutorial and wanted to use it to start my script which uses PyQt5 but its throwing a ModuleNotFoundError. ...
0
votes
1answer
154 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
0answers
27 views

Cant upgrade Raspbian neither run Python

I am trying to upgrade my Raspberry Pi 3 B+: $ uname -a Linux plexmediaserver-pi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux But I am getting this weird error: pi@...
0
votes
1answer
103 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
116 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
268 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) ...
0
votes
2answers
128 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
3answers
939 views

Why can't I connect to my Raspberry Pi through SSH on my PC or a phone app?

I tried to SSH into my Pi using PuTTY, but I got an error: Network Error: Connection timed out I have checked my router, noted that the device is indeed connected to the network, I was able to use ...
0
votes
3answers
35 views

Use a bash file to open a lxterminal and run commands into it automatically

I have made a python application for raspberry and it needs to run into a terminal. That's totally necessary. To do that I wrote two bash files, run_.sh and launcher.sh. run_.sh execute the python ...
1
vote
1answer
206 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
4answers
56 views

How do I fix incorrect timestamps in my bash script that launches on startup?

I'll try to explain this the best that I can. I am creating a simple bash script that runs on startup. This script is supposed to create an archive based on the current date, run a python program that ...
2
votes
1answer
58 views

outb() equivalent in Python for GPIO

I am a very beginner on programming and raspberry usage, tho I think I learn fast. I am trying to convert an old program (not mine) that was written for Linux on C++ for communication with a printer ...
-2
votes
0answers
29 views

Write mode in Raspberry PI? [closed]

I try to write into a text with Python, but it does not work right when executed Thonny? with open("test.txt", "a") as text: text("Dae:" + time.strftime("%d.%m.%Y %H:%M:%S")) Does someone ...
0
votes
1answer
28 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 ...
-1
votes
1answer
158 views

Adafruit's LCD doesn't show text

I've just written small python script to operate adafruit's lcd with additional module. Almost every lcd's operation is handled by module. But when I try to print a message on screen or in console, ...
1
vote
1answer
133 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 ...
0
votes
3answers
204 views

VNC: how to manage a fleet of RPi?

I've to manage 50 Raspberry Pis remotely, e.g. via VNC over the web. The RPis are behind a router, so I can't access them by IP. I'm looking for something like a self-hosted TeamViewer. The desired ...
-1
votes
2answers
474 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 ...