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

how to simulate raspberry pi interfacing sensors in visual designer, proteus? [closed]

I've made a schematic ( raspberry pi interfacing PIR] on my proteus (visual designer) and wrote a code source on python also in visual designer to simulate a raspberry with PIR, when i build project ...
0
votes
0answers
27 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
17 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
0answers
26 views

Automatically connect with the wifi network that has internet [closed]

I am seeking the best and easiest way to automatically/programmatically check for the network with internet connect with pinging for example google and then after checking 2/3 networks already defined ...
0
votes
1answer
19 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 ...
-1
votes
1answer
10 views

Run PyQT from CLI while booting [duplicate]

i have a working pyqt python file. which i have to run on startup. To do that I edited bashrc file and added following line cd path python3 code.py the code works fine and it runs whenever i am ...
0
votes
1answer
15 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
34 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 ...
0
votes
0answers
29 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
28 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
28 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
38 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
50 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
208 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
29 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
20 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
16 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
101 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
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
3answers
36 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
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
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
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 ...
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....
0
votes
0answers
46 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
34 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
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
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 ...
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
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
46 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
0
votes
0answers
41 views

Playing audio on Bluetooth speaker using pygame

I know there are already posts related to this question, but there aren't any I can find that have worked for me. I am attempting to get an iHome B66 Bluetooth speaker to play sound coming from my ...
0
votes
0answers
22 views

How to make cameras take picture simultaneously with a single button?

How can I make my pi's take pictures at the same time whenever I push a button? I've connected GPIO pin 2 to my button and a ground pin to the other end of the button for every pi. This is how I've ...
0
votes
0answers
30 views

Relay is behaving differently from tutorial

Given: Raspberry Pi3 Sunfounder 2 channel relay plugged into 3.3v plugged into ground plugged into pin 18 import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(18, GPIO.OUT) GPIO....
1
vote
0answers
18 views

Data logger with SenseHat and timelapse Pi Camera code not running

I am trying to use a SenseHat and Pi camera to do some data logging. What I want my program to do is when run, it should collect sensor data and take a photo every 10 seconds. The issue that happens ...
0
votes
0answers
27 views

Multiple LED strips over Pi4

I am trying to control 3 LED strips independently over Pi using python. As Pi4 only has 2 PWM channels, 0 and 1, I have only been successful in controlling 2 LED strips. I even tried the software ...
0
votes
0answers
20 views

rpi3b+ pip install psychopy HDF5 not found

I'm trying to install psychopy on Raspberry Pi3b+ with Ubuntu MATE 18.04.04. Here's the error I'm getting while installing pytables. The command I'm using: sudo python3 -m pip install psychopy ...
0
votes
0answers
7 views

dbus and qdbus not working suddenly

I am using dbus and qdbus to control my phone from a pi using Bluetooth to pause play etc. songs and all of a sudden dbus and qdbus dont work anymore All other functions work i can head music from he ...
0
votes
1answer
44 views

Unable to locate package python3-bluez

I'm stuck at the installation process for openhabian , I realized I couldn't get package python3-bluez to install. script ran : needed_packages() { # Install apt-transport-https - update ...
0
votes
0answers
22 views

Using RPI to control analogue VIDEX intercom system

I'm getting to grips with Python and RPI with the view to replacing one of the VIDEX 3311 intercoms at my workspace with an RPI device to answer the buzzer, see who's at the door (using extant systems)...
0
votes
0answers
33 views

Problem I2C when using BH1750 photoresistor

(Raspberry Pi 2, model B, V1.1 - buster OS - all updated / upgraded - smbus loaded on) Hi, I am quite new to the Raspberry Pi and recently I have hit a brick wall. I am trying to link the Raspberry ...
0
votes
2answers
26 views

How to pass argument/file name using a for loop to a command line instruction in a Python script?

I have following the link: to incorporate a command line command into my python script and it is working fine. but i want o run the command over all the files present in a folder. How to send the ...
1
vote
2answers
54 views

.txt files become empty

I have few .txt files I use to store configuration information for some python and shell scripts on my Pi. They are occasionally read from and very rarely written to. The Pi runs 24/7 mostly but will ...
1
vote
1answer
37 views

Run Python RPi.GPIO as sudo

I'm trying to use the RPi.GPIO Library in a python-script with root-privileges. I essentially need to run it with sudo because other stuff in my script require root-privileges. When i try the ...
0
votes
1answer
22 views

Installing Python Modules globally using pip

I'm doing a Udemy course using Python, and I recently created a fresh copy of Raspian for my Raspbery Pi 3B+. I have attempted to install the module pyfiglet, and used the terminal command sudo pip ...
1
vote
0answers
23 views

Multiple NFC PN532 Using I2C interface with Raspberry

At first im only using 1 NFC PN532 and libnfc as the library, but when im trying to connect it to 2 same devices, it still gives the same address which is 0x24(because of libnfc). Since controlling it ...

1
2 3 4 5
54