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
19 views

Temporary failure in name resolution/Python

I have following code I am running on a Raspberry Pi Zero. It completes couple of iterations without any issues, after which it throws Temporary failure in name resolution error. All subsequent ...
0
votes
1answer
29 views

Wierd output in python from serial connection output

Output: b'00000-000000\r\n' b'450302198011281530\r\n' b'' b'' b'+\x00--To--\r\x12-\x00000800\r\x12-\x00000800\r\x12' b'-\x00000800\r\x12-\x00000800\r\x12' b'-\x00000800\r\x12-\x00000800\r\x12' ...
0
votes
1answer
45 views

How to clean up gpio pins properly?

I'm a newbie with Raspberry Pi as well in python and node red. So my goal with my project is to make a DIY irrigation systemm. I have an RPi, which reads value from the soil moisture sensor and ...
0
votes
0answers
35 views

on/off button GPIO python

I'm working on a project from Marcel on instructables: https://www.instructables.com/id/Raspberry-Pi-Radio/ Right now I'm modifying the code a bit and trying to add the on/off button. When I run the ...
0
votes
1answer
31 views

Unable to read serial port with python script but can write [closed]

I have a microcomputer that is initiated from a pico terminal script establishing a ttyUSB0 and baudrate. The micro is programmed only to respond to a small list of alphanumeric inputs. Enter x into ...
0
votes
0answers
13 views

How to make a Led Visualizer with USB audio input

I've been trying to figure how to get this to work or a while now, I've found a GitHub for a led strip visualizer called ledvis and it supposedly works with audio input, but the depository is very ...
0
votes
1answer
25 views

MG 996R Micro servo Using Raspberry

I have a MG 996R micro servo which I am using with a Raspberry Pi and Python. It seems that this servo is not working with Python. I have tried experimenting the values, increasing and decreasing of ...
0
votes
0answers
56 views

Powering capacitive soil moisture sensor from 5V Pin

I'm completely new to RPi, and I'd like to make a garden project, at first I would like to measure the soil moisture. I purchased one of these sensors https://www.amazon.com/Analog-Capacitive-Moisture-...
0
votes
1answer
33 views

Opening multiple serial port slows down USB speed

note that this is a duplicate of my question on stackoverflow I am currently working on a software that use Python3 (pyserial) to interface with a lot of serial port (~24) on a Raspberry Pi Compute ...
-1
votes
0answers
8 views

PHP requesting shell to run Python script failer (err int==1)

Script 1 (bash): checks if there is internet. Yes -- 1 to Q.txt No -- 0 to Q.txt Script 2 (php) if Q.txt == 0 go to wifiSetup.php wifiSetup.php Takes SSID, and encodes password as PSK, saves at wifi....
0
votes
1answer
19 views

playing music from stream [closed]

I have a raspberry pi 2 model B and a raspberry pi 1 (I think, it doesn't have any version number on it and I have had it for a long time and I don't quite remember exactly the version). I think the ...
1
vote
3answers
47 views

How can Rpi python GPIO 5V relay control a 12V solenoid door Lock? [closed]

I am trying to connect a 12V AC/DC lock to my Raspberry PI 3B+ so I can control it using python3 on the raspberry pi. Does anyone know anything I can do. Here are my parts: Electric lock: https://www....
0
votes
1answer
35 views

Generating single-frequency sound with Python, but no sound is produced

I just got a new Raspberry Pi 4 and am trying to write a Python program that generates a sound that's just one frequency. However, I am having a problem that I cannot hear any sound coming out of the ...
0
votes
0answers
33 views

AttributeError: 'module' object has no attribute 'face'

I installed openCV on my pi following this install guide https://www.murtazahassan.com/opencv-raspberry-pi-installation/ My goal is to use facial recognition however I am having no luck getting it to ...
0
votes
1answer
50 views

Concurrent task handling on Raspberry Pi specific applications

I'm hoping that this is more relevant to the RPi exchange as a lot of my key concerns relate to issues with GPIO/PWM/serial bus usage with concurrency. I'm currently writing software for a robotics ...
0
votes
0answers
18 views

Playing videos based on GPIO input Python

I am making a Raspberry Pi(with model 3B) video player that pays a video when an button(from GPIO) is RELEASED. So what I would like to do is when a button is released the video would play. And when ...
0
votes
1answer
14 views

Audio cuts out periodically when using audio hat

I am currently live streaming some audio to and from a raspberry Pi Zero W using the waveshare audio hat however I have found that the audio periodically cuts out when I do this. When I used my logic ...
0
votes
1answer
27 views

Controlling LED using PWM

When I run this code I’m expecting to get a led that brightens but I get a led that dims. import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BOARD) GPIO.setup(11,GPIO.OUT) dc=0 LED=GPIO.PWM(11,...
0
votes
0answers
34 views

Reading, converting Object Array

I am trying to compile : new_value = int(1500).to_bytes(2, byteorder='little') but it throws error in Python 3.5 and 3.8. I am new in python and couldn't find an explanation on this. And also how to ...
2
votes
2answers
59 views

i2c communication problem with SSD1327 OLED display on a Pi 4

I have the following 128 x 128 OLED display: http://www.lcdwiki.com/zh/1.5inch_OLED_Module_SKU:MC01503 which is driven by a SSD1327 module. I'm trying to use this with a Pi 4 and the Luma.oled python ...
1
vote
2answers
104 views

BlueZ BTGATT-client.py WriteValue

I had a successful attempts with BlueZ-5.50 > test > example-gatt-client.py with ESP32 set as HeartRate Sensor Server.I am able to read from ESP32 which i modified to suit the BlueZ example. ...
0
votes
2answers
75 views

PWM issues with pigpio and RPi.GPIO

I am using Pi Zero W with latest Raspberry Pi OS. I have a backlight of an LCD that I am trying to control via PWM. If I use RPi.GPIO I get flicker at anything other that 100% (or 0%) duty cycle. As ...
0
votes
1answer
21 views

Service in systemd dies when logging rotated

I have a Python program that I start on boot with a service in systemd. It works fine until Unix tries to rotate the system log file, and I get an error: "Journal has been rotated since unit was ...
0
votes
0answers
26 views

Create Overlays with DispmanX in Python

How can i create preferably dynamic overlays using Dispmanx in Python on a Raspberry Pi (3B)? My goal is to overlay custom images containing current information on top of a Picamera Preview. The ...
1
vote
1answer
96 views

Scripting bluetoothctl causes it to fail after connection

I'm connecting to a custom BLE enabled board. Running bluetoothctl, I can pair and connect no problem from the command line. I've been attempting to script it using Python and pexpect. Pexpect spawns ...
0
votes
0answers
61 views

Play a mp3 file on USB Speakers

I've been trying for several months to play music on my Raspberry Pi 3 or 4 with 0 luck finding a stable player for Python 3. I can get pygame to play until it crashes which is multiple times a day so ...
1
vote
1answer
30 views

Cannot pip install adafruit-circuitpython-mlx90640

I am trying to install adafruit-circuitpython-mlx90640, a library for the MLX90640 thermal camera. When I run sudo pip install adafruit-circuitpython-mlx90640 I get an error that no matching ...
0
votes
1answer
28 views

pyModbusTCP: which IP address should be specified on a server?

I'm trying to make my Raspberry Pi 3B+ as ModbusTCP server and for testing purposes my PC as a client. I'm using pyModbusTCP module for this. My server script (RPi) is: from pyModbusTCP.server import ...
0
votes
1answer
26 views

Installing Gattlib error

Like many others, I've had problems installing gattlib using pip. I've followed the steps outline in this question to no avail: Pybluez and Gattlib error The steps that give me the error: hg clone ...
0
votes
1answer
26 views

Not getting a full 3.3V instead getting like 0.7V on a GPIO pin

Okay so I ran the following code and I am seeing ~0.70V on the GPIO pin and not 3.3V. Why could that be? #import the GPIO and time package import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) ...
0
votes
2answers
39 views

Using PWM with RPi.GPIO in Python

Scenario: I want to control a PC fan using the Raspberry Pi. The 4-wire-fan (MGT9212UR-W25) has its own power supply (12V) and can be controled via PWM. I would like to control it with a Python script ...
1
vote
0answers
36 views

Python - run Flask webserver parallel from main code?

For the Raspberry Pi i am developing some home automation tools. At one side i have my main application that reads a CSV file, that consists of date+time entries with a GPIO port nr and a duration. My ...
1
vote
2answers
36 views

Python3 Pip Not Working on My Pi

So I was having some trouble with python package incompatibilities. I was tired of troubleshooting and decided that I would remove all of the packages that I had installed using pip3. In an attempt ...
0
votes
2answers
25 views

Scheduling a interactive session to start at bootup to access python script having dynamic web server [closed]

I remote onto a PI and run a Python script using simpleHTTPServer which continues to run as long as the PI is active. The command I run is: sudo Python3.7 /home/pi/myscript.py 80 In conjunction with ...
0
votes
1answer
37 views

Is PiFace Digital 2 compatible with Raspberry Pi Zero W rev 1.1?

Can anybody definitively say if the "PiFace Digital 2" is compatible with the "Raspberry Pi Zero W rev 1.1" or not ? I cannot find any Information on the web - besides a mention in ...
0
votes
1answer
47 views

sudo apt-get install python3-pip not working

Getting 404 Not found when trying to install python-pip3. Error persists even after update and upgrade. Any idea?
2
votes
2answers
53 views

Can't run python script on startup. Raspberry Pi 4

I am trying to run a python script when my Raspberry pi 4 boots. THis python script works when I run it directly, with no errors. I have edited the crontab file to do this as can be seen below: # ...
0
votes
2answers
272 views

How can Rpi change Neo-6M GPS update rates?

Hi i'm tryng to change the update rate of my gps tracker(neo 6m ublok) i know the byte that i need to send are 0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A i've tried echo -e &...
0
votes
1answer
31 views

Performing multiple separate actions in Python with callback to main class instance

I am making a smart nightstand using a Raspberry Pi and Python. It should be able to: Have settings being controlled by a mobile app communicating through TCP requests to the Raspberry Pi Have an ...
1
vote
1answer
22 views

Exceptions not caught properly in while loop [closed]

I am trying to implement a RESET button, so when pressing the button, the code restarts. However, I am getting some strange behavior. First I tried raising a custom Reset Exception: class Reset( ...
0
votes
0answers
30 views

How to display an image full screen on my second monitor (raspberry pi 4)

I am using RPi 4 and running two monitors. I want to display an image on the second screen using Python or Linux command line. I have tried but I couldn't do this with fbi(it displays on the both).
1
vote
2answers
112 views

Trouble running a python script at startup

For context, I am using a Raspberry Pi 2 model B, and I am trying to run a continuous python script when the pi boots up. The script uses the GPIO Pins, and with the data it recieves, it changes ...
0
votes
0answers
30 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
3answers
43 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?
0
votes
2answers
33 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
25 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
0answers
35 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 ...
0
votes
0answers
19 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....
0
votes
0answers
79 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
46 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 ...

1
2 3 4 5
54