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
1answer
238 views

Problem with i2c communication between arduino and raspberrypi

I have connected Rpi with Arduino using i2c communication. Pin Configuration: Rpi ---- Arduino Mega SDA SDA SCL SCL GND GND I also have an encoder attached to Rpi. Encoder `------ Rpi 5V 5V Gnd Gnd ...
0
votes
1answer
422 views

/dev/ttyusb0 cannot be find while starting script on boot for raspberrry pi

(Currently using Raspbian Jessie latest) So currently I am trying to start a script that reads from the rf receiver and gathers the data and sends it over to the cloud... I am trying to start this ...
0
votes
1answer
26 views

I need to write a program that changes a servo based on increments of 10 [closed]

I'm working on a robot that will use prewritten commands to gradually move a servo. I need to have the servo move from the value 2000, which is the highest angle, and 500, which is the lowest angle. ...
1
vote
1answer
4k 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 ...
0
votes
1answer
89 views

Rasperry Pi 4B LXterminal only runs python after python3.8 installed

I installed python 3.8 on raspberry pi 4b, now every time I open LXterminal, python 3.8 starts up, and using ctrl-D to exit only starts python up again. I am in a catch 22!
1
vote
1answer
110 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
2answers
3k views

cannot import name picamera

I bought raspberry pi camera and it works, but when i use python to use the camera return Error: cannot import name picamera. I have install python3-picamera.and this is python programming: from ...
0
votes
0answers
13 views

Pigpio for I2C slave on Pi Zero and the timing of data from the master

I'm using the pigpio library through pigpiod running on a Rpi Zero configured as a slave. The master is an ATMega328PB. On the Pi I am testing using a modified version of the python script provided in ...
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
3answers
35 views

How to run multiple files .py and .sln in Rapberry Pi 3?

I have multiple files .py and one file .sln for my gateway in Raspberry Pi 3. My question is how to run all of those files together?
1
vote
1answer
152 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 ...
0
votes
1answer
98 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 ...
0
votes
2answers
30 views

Raspberry pi run startup python script cannot send HTTP requests

I let my python script run at startup but some of HTTP requests (using requests pip module) not working. However, when I run the script manually with sudo openvt -s -w /path/to/launcher.sh, all HTTP ...
0
votes
1answer
531 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
2answers
588 views

trying to run 6 USB cameras simultaneously on a single Raspberry Pi 3B+ with add-on 4 port USB hub with external power

We are trying to simultaneously run 6 cameras on a Raspberry Pi 3B+ with an add-on 4 port USB hub that has an external power supply. The cameras are set at 15 FPS with a colour image size of 640 X 480....
0
votes
1answer
113 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
291 views

Can't use microphone with speech recognition

I'm developing a voice assistant program with python and speech recognition. On windows everything is ok and it works. But on linux i got errors.I'm running raspbian buster on pi 4. here is the code ...
0
votes
1answer
23 views

How do you run Adafruit PiTFT - 320x240 without mirroring the HDMI output

I currently have a Adafruit PiTFT - 320x240 mirroring the raspberry pis HDMI output. I have developed a GUI which I would like to run on the raspberry pi, which is designed for 320x240. The problem is ...
0
votes
1answer
128 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
0answers
33 views

Python ide for remote debugging/coding on Raspberry pi 4

Is there any Python Ide available from which we can remotely connect to pi (using ssh) and can write python script or debug from windows. I have already done this using eclipse here but this ...
3
votes
1answer
5k views

Using Pocketsphinx for voice control applications

After pocketsphinx recognizes a certain keyword or phrase, how do i make it trigger an action? For example, I want to open a simple .py script from pocketsphinx
1
vote
1answer
757 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
0answers
44 views

Installing Realsense On Raspberry Pi 4

Hi I am curious if anyone has seen this issue before? When I try to run realsense-viewer, it outputs "Could not initialize offscreen context!" PS: Followed this https://github.com/IntelRealSense/...
0
votes
0answers
17 views

What is the display variable for the PiTFT?

I am trying to run my simple GUI on my PiTFT display. import Tkinter as tk root = tk.Tk() root.resizable(height=320,width=240) tk.Label(text="FUZE",font=("Courier", 44)).grid(row=1,column=1) root....
1
vote
1answer
140 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 ...
1
vote
1answer
804 views

Rpi Python Serial Test Program

In Terminal its working but not working using python code. My Code: import serial from time import sleep ser = serial.Serial ("/dev/ttyS0") while True: received_data = ser.read() ...
0
votes
0answers
33 views

Selenium and bs4 for Raspberry Pi Webscraping?

I am about to drive myself mad with this problem. After a few days, I have gotten my Raspberry Pi up and running with Selenium using Chromium and its webdriver. It pulls up the webpage and even ...
0
votes
1answer
135 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
0answers
25 views

Configure Pi 4B to hear specific sounds and light LEDs in response [closed]

I am trying to make a sound sensor using a Raspberry Pi 3B. I would like it to be able to differentiate between a door knock and a phone ringing. When a sound is detected, i would like to light a ...
1
vote
1answer
367 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....
0
votes
0answers
24 views

Moving /home dir form sd card to USB drive on a Rasspberry pi 4

I'm trying to run Insightface package on raspberry pi 4 after struggling to install all required packages namely cv2 and mxnet but when I exit python or run my program I get “corrupted size vs. ...
0
votes
1answer
73 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
1answer
25 views

Messed up something with Python 3/pip3/Miniconda 3 Installation and Linked Directories

So I'm not exactly sure what I did but I was trying to upgrade from Python 3.4.3 (Miniconda 3) to Python 3.8.x and somewhere along the way I ended up deleting a folder or symbolic link. My main issue ...
2
votes
2answers
46 views

set specific angle in pigpio set_PWM_dutycycle

I just updated my code to use pigpio instead of RPi.GPIO, the later is working but my robot is trembling like a chihuahua, so I gave pigpio a try. In this piece of code I'm moving my servo, so to ...
1
vote
1answer
175 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
210 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
0answers
21 views

Send signal from php script to python

I am quite new in the raspberry community, but want to use my pi as garage door opener that also creates a slice if humidity outside is lower than inside the garage. Thus, I have written a Python ...
0
votes
0answers
33 views

ST7789 Display on Raspberry PI 3

I just got an ST7789 240x240 display and i can't get it to work with my PI. i'm using this library: https://github.com/DjamesSuhanko/Python_ST7789 i installed all the python dependency's When i ...
0
votes
0answers
14 views

Raspberry pi flagging on_ready() as invalid syntax

I have replaced the async def to @asyncio.coroutine, and await to yield, but my raspberry pi 4 which I'm using to run my discord bot has flagged the on_ready, although it works fine on my computer. ...
1
vote
1answer
33 views

How to pause Python script until video clip has finished playing

a bit of background info on what I am running: I have a Raspberry Pi which is listening to serial communication from a Wemos D1. When it receives a message it will play the relevant video file. When ...
2
votes
3answers
926 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
1k views

Captured image file from PiCamera is 0kb, why?

I use the following code to capture an image from PiCamera: from picamera import PiCamera from time import sleep camera = PiCamera() camera.start_preview() sleep(5) camera.capture('/home/pi/Desktop/...
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 ...
4
votes
1answer
325 views

How to make sense of this Raspberry Pi project guide for building a theremin?

I have just started out using a Raspberry Pi, and for my first project, I wanted to build a pseudo theremin using an ultrasonic motion detector and other electronic components (requirements are laid ...
1
vote
1answer
318 views

reverse-geocoder on Raspberry Pi

In a project I am currently working on, I use Python to display my current location, speed, etc. I now wanted to implement the reverse_geocoder library (https://github.com/thampiman/reverse-geocoder) ...
0
votes
1answer
486 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 ...
1
vote
1answer
38 views

Is it possible to control the 5V supply (e.g. pin 4) via python?

I want to (de)activate a fan, which is connected to the pins 4 and 6, depending on the temperature of the CPU. Is it possible to (de)activate Pin 4 (or Pin 2) at the Raspberry Pi 4 via python? I have ...
1
vote
0answers
45 views

How to add 2 RFID readers to Raspberry PI 4

I managed to install 1 rfid reader following this link tutorial but i have no idea how to read with 2 and know from which one reads
9
votes
4answers
43k views

PyQt5 on a Raspberry Pi

I have a Raspberry Pi 3 with Raspbian installed, along with a 7" touch screen. I'm in the process of creating an application in Python to read several DS18B20 Thermocouples to monitor the temperature ...
1
vote
2answers
378 views

Can't blink a LED using SPI interface on Raspberry Pi v3

As a part of my PoC project, I'm using single 5050 LED made by Adafruit. I wired it like this (LED - RPi): DI (Data Input) - SPI0 MOSI CI (Clock Input) - SPI0 SCLK GND (Ground) - GND VCC (5V) - 5V ...

1
2
3 4 5
54