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
0 answers
194 views

No module named RPi.GPIO even though it's installed

When running code import RPi.GPIO as GPIO import MFRC522 import signal continue_reading = True # Capture SIGINT for cleanup when the script is aborted def end_read(signal,frame): global ...
user avatar
  • 105
1 vote
1 answer
186 views

Reading data from GPS module using Python on Raspberry PI

I am using a NEO-8M Satellite Positioning Module on a Raspberry PI. I am trying to read data off the device using python. I am new to the Raspberry PI and Python. I can read data from the NEO-8M GPS ...
user avatar
1 vote
0 answers
26 views

Detect an unconnected pin on an MCP3008 [closed]

I have a couple moisture sensors loosely connected to an MCP3008 and was wondering whether it was possible to detect if a sensor is unconnected. I then tried to detect it with the channel voltage in ...
user avatar
  • 11
0 votes
1 answer
52 views

Can a raspberry pi get the video feed of another through a NFS server between the two?

For my project, I need to get the feed (preferably simultaneousely) of 2 pi cameras (one on each pi 4). As of now, both are communicating through ssh over wifi. It's very slow, not reliable and very ...
user avatar
  • 3
0 votes
0 answers
21 views

Running script from cmd for bluetooth connection

my project requires data transfer with android app via bluetooth. I’ve tested the code by running it in thonny and it works fine. Since I want to run the script as soon as raspberry pi boots up, I ran ...
user avatar
0 votes
0 answers
56 views

Using the camera on 64bit vs. 32bit from Java

I have Raspberry Pi 3 B. And a camera module v. 2.1. I have installed the Raspbian OS 64bit, the latest - "bullseye" Tried to record some video in any way, and after some experimentation, I ...
user avatar
0 votes
0 answers
112 views

How to use Raspberry Pi 4 with an USB to RS232 adapter cable over the serial port

I would like to use a Raspberry Pi4 to control a syringe pump [(see datasheet here and in particular the quick start manual on page1)][1] The connector cables I used are RJ11 from the Pump to RS232 (...
user avatar
1 vote
3 answers
71 views

Rpi GPIO code not working

Following commands work well as full speed PWM. echo "s 18 2000" >/dev/pigpio pigs s 18 2000 But following code do nothing. I am using Raspberry Pi4 8G B model import RPi.GPIO as GPIO ...
user avatar
0 votes
0 answers
237 views

Problem using OpenCV and Raspberry PI camera V2

I had been using the following code for the past two months with no problem whatsoever, however, just yesterday I have been getting errors using the code which I will detail as follows. The code in ...
user avatar
0 votes
0 answers
49 views

how to read keystrokes in RPi and send something else to PC?

I found this thread and a few others but they don't seem to consider that a keyboard is attached to the pi and that the primary data is sent from it -- rather, the pi just emulates. What I'd like to ...
user avatar
  • 1
2 votes
1 answer
226 views

How to PID control a heater with SSR, Raspberry Pi and python

I would like to PID control the temperature of a water bath using a RaspberryPi4, a solid state relay (SSR) and a heater (200W, 230VAC) using python. The IVMech library seems a good starting point. As ...
user avatar
1 vote
0 answers
37 views

SpiDev xfer not working when called from inside function

I have been working on integrating an absolute encoder using SPI (link to datasheet) into my project and have run into a problem with the SpiDev library for Python. When running the test script below,...
user avatar
  • 11
0 votes
1 answer
47 views

How to decrease RPi image capture time?

I have two camera connected to RPi (1 USB camera and 1 RPi camera). I need to capture both images to do some processing on them right after image capture I have this code: file1 = 'imagecapture' + '...
user avatar
  • 109
0 votes
1 answer
80 views

How to aggregate time-synced data from one RPi to another over bluetooth

I am currently working on a landslide-detection project coded in Python for a research group. At present we have two different sets of sensors running on two different RPis. One RPi has a strain gauge ...
user avatar
0 votes
0 answers
39 views

Background Python Script Stops Running After A While

I'm trying to use my pi as a temperature monitor. The purpose of it is to sense the temperature and humidity via a sensehat, log it to a database and a local csv and if it meets a certain range then ...
user avatar
0 votes
0 answers
48 views

Code works in Windows but not Raspberry pi (opencv)

I'm new to coding and using a raspberry pi. I've searched through many tutorials online and found a how to get OpenCV library into the pi itself and downloaded VSC on my laptop and the pi. The issue ...
user avatar
0 votes
0 answers
182 views

two raspberry pi 4 communication via BLE

I need to pass a stream of data from raspberry pi 4 to pi 4. and I downloaded /home/pi/Downloads/bluez-5.50/test/example-advertisement,and can successfully run it,two pi can connect,but I don't know ...
user avatar
-1 votes
1 answer
32 views

How to assign one input when matrix keypad key is held down?

I have a simple matrix 3x4 keypad that executes a function based on the code entered. However I'm running into the issue when someone holds down a key. I would like it to where only one value is ...
user avatar
  • 1
0 votes
0 answers
62 views

Playing video programmatically

How to play a video triggered by an external event (e.g. button push)? Previously, one could use omxplayer and DBUS but apparently that is not longer an option on Pi 4 and newer systems. From what I ...
user avatar
  • 111
0 votes
1 answer
156 views

Can we get the path of a USB drive programmatically(Python) when connected to a raspberry pi?

I am currently working on a small project on Raspberry Pi. I want to make my project as automated as possible. I have a code that saves videos to a USB drive. However, for it to work, I have to ...
user avatar
0 votes
0 answers
42 views

Raspberry Pi split screen with two connected screens to spi

Good day. I'm fairly new at raspberry Pi and would like to connect two SPI displays. After connected I want to make use of a camera to project the video on both screens. Therefore the one screen needs ...
user avatar
0 votes
0 answers
55 views

Raspberry pi camera coding questions

I've been coding a little portable Pi camera using a raspberry pi zero, the HQ camera module, and a waveshare 1.44-inch screen. I've succeeded in programming a button to take a photo, and a button to ...
user avatar
  • 109
0 votes
0 answers
147 views

Setting up a path for chromedriver with selenium

I'm very new to Raspberry Pi and Python and installed version 98 of the Chrome browser to my Raspberry pi and set up some this code to make an attempt at opening the Chrome browser in full screen mode....
user avatar
0 votes
0 answers
52 views

python module 'spidev' not found

python software from pi plates doesn't work with python 3.10. One specific is that 'import spidev' cannot find spidev module. Any suggestions?
user avatar
0 votes
0 answers
11 views

Why does my Raspberry Pi 4 restart my script, and then turn it off?

I run a Discord py script on my Raspberry Pi 4, but after a while (around 45 minutes) it just restarts when I haven't done anything. After some time it just turns off without an error. Why does this ...
user avatar
0 votes
1 answer
56 views

delay Without Sleep functions error

Sleep without sleep python3 --version Python 3.7.3 import time last_millis = 0 time_period = 1000 # 1 = 1 millsec , 1000 = 1 sec def do_somthing(): print(last_millis) while True: ...
user avatar
0 votes
0 answers
86 views

How to use Arducam's camera & opencv for live inference?

I have a pi 4 model B and using this camera, after setting everything up I tried to capture some images with opencv but failed, most "casual" guides assume that I use either a pi camera ...
user avatar
  • 101
2 votes
1 answer
66 views

Python multicast network unreachable with static IP

i have encountered the following problem on a Raspberry PI4 B. I have a python program which communicates with PLCs. I run this program on my Windows machine with no problems. The program, after ...
user avatar
1 vote
2 answers
205 views

Changing i2c ports and busio.py

thanks in advance for any help, this is quite the sticking point for me unfortunately, Basically I'm coding a program in python for my raspberry pi 3 to read values from two voltmeters, through an ADC,...
user avatar
0 votes
0 answers
22 views

No module named 'google' - OR - "The hard and long way it is to develop in Raspberry PI" [duplicate]

... Short story: I have a Python program with just one line: from google.auth.transport.requests import Request When I run it from the python3 command or from Thonny, I get this message: ...
user avatar
  • 101
0 votes
0 answers
53 views

How to write the Raspberry Pi's autostart directory using python?

I am using Raspberry Pi4 Model B with buster os in it. I am trying to write a python script for running the webpage at bootup. On entering sudo nano /etc/xdg/lxsession/LXDE-pi/autostart in the ...
user avatar
1 vote
2 answers
119 views

How to send data to a Pervasive eink display via Python?

I got a 5.8" eink display from Pervasive Displays and cannot get it to work, I feel that only a little bit is missing. After a lot of struggle I managed to run it via their sample C code, but the ...
user avatar
  • 63
0 votes
1 answer
63 views

Button.when_activated event is not firing even though Button.is_active is setting correctly

Thanks in advance! I am using a Pi 3B to detect activation of a sensor on my model railroad layout. The sensor by default only offers a rising edge detection scenario. I decided to go with gpiozero ...
user avatar
1 vote
1 answer
63 views

Inconsistent error using HQ camera

I have been having some issues using the HQ pi camera. I am running Rasbian 11, latest apt update 11 march 2022. I use libcamera-still to take images and I call this command using python subprocess....
user avatar
  • 21
0 votes
3 answers
51 views

Trying to run a python program on boot - error file location?

I have edited rclocal to include this line: python3 /path/to/my/program.py & I used an ampersand as my program has an infinite loop. The program never runs though. The program: import RPi.GPIO as ...
user avatar
0 votes
0 answers
188 views

Raspberry Pi can't install any packages with pip

So the other day, while trying to install a pip package for a project, I noticed that I was getting error messages. I tried anything that I could think of, even uninstalling python and pip, and ...
user avatar
0 votes
0 answers
40 views

Can I run two python script using the same pi camera in raspberry pi?

I am currently working on a project where I need to have a live stream video and a motion detection that when a motion is detected, records a 10 second video. I have put each functionality in ...
user avatar
0 votes
0 answers
98 views

Vulnerability Scanner for IoT Devices using raspberry Pi

It's my final year project to develop a Vulnerability Scanner for IoT Devices, Here is the proposal of that project "The goal of this project is to put a vulnerability scanner on a Raspberry Pi ...
user avatar
2 votes
2 answers
72 views

Erratic GPIO event callback

I have a Raspberry Zero connected to the SO pulse output of an energy meter (ABB C13) using a direct connection to GND and GPIO13 configured as input with pull-up resistor, and a Python program with ...
user avatar
  • 123
0 votes
0 answers
106 views

Unable to register account on yowsup

I've been working with a library called Yowsup, which helps a user send whatapp messages to a number using the raspberry pi, so I have a 4 GB version, running debian... Now to start the registration I ...
user avatar
0 votes
0 answers
66 views

Using Tkinter GUI to control the GPIO pins on Raspberry Pi when GUI isn't stored in Pi

Using Tkinter to control the GPIO pins on Raspberry Pi is easy and trivial, but can it be done when GUI is not stored in pi, but to another device. granted the device and Pi are connected to the same ...
user avatar
0 votes
1 answer
268 views

How to communicate between multiple Raspberry Pi using Python

I am looking to buy some Raspberry Pi computers to do various tasks. For example, maybe one could water a plant when requested. The part I am struggling to find help with is creating a server where a ...
user avatar
0 votes
0 answers
39 views

PiCan 2 Data Logging on higher frequency problem

I have a project that logs data from a vechicle's OBD 2 port (using PiCan2 on top of RPi3B) and combines that data with data from sensors connected to an external Arduino. The Arduino communicates ...
user avatar
0 votes
0 answers
83 views

Consistent Motor control - specifically 180 degrees

I am struggling to get my motors to perform the same on each run. The first time I run the program, they will perform the same movement about 8/10 times. The second time I start the program, the ...
user avatar
0 votes
2 answers
175 views

How to run a python script on raspberry pi from an android application?

I am currently working on a project where I have to develop a Camera Security system and an android application. The camera system provides live streaming videos and also has the ability to detect ...
user avatar
0 votes
0 answers
38 views

Conflict between UART and cv2 Video Capture

I am attempting to communicate with an Arduino through UART using an Raspberry Pi 4 Model B. The Python script is grabbing frames from a Raspberry Pi Camera Module v2, pre-processes them and checks if ...
user avatar
-1 votes
1 answer
104 views

Problem using adafruit-rfm96w Lora transceiver

I'm new in programming and for a project I actually need to deal with 2 adafruit-rfm96w to transfer data between 2 Raspberry Pi(one Raspberry Pi 3, and one Pico). But I don't understand how to use the ...
user avatar
  • 1
0 votes
0 answers
177 views

Raspberry pi and nextion touch screen communication using python

I have tested several python codes to set up the communication between raspberry pi and nextion touch screen (I used TTL serial GPIO 14 and 15). Unfortunately, the communication is not stable, the ...
user avatar
0 votes
0 answers
40 views

Additional SPI bus raspberry pi 3b+

I'm trying to read 2 devices from SPI bus nRF24 module and MAX31865. I read the MAX module constantly every second and need to read the nRF24 module from time to time in other binary, but when I just ...
user avatar
-1 votes
1 answer
27 views

ENOSPC error, but camera is working

I'm using a home security system which seems to be working well, but when I type python alarm.py in terminal, I get this error: pi@raspberrypi:~ $ python alarm.py mmal: mmal_vc_port_enable: failed to ...
user avatar
  • 1

1
2
3 4 5
62