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

How to read files from a SD card connected to ESP32 an then transfer/upload/send them with Micropython to Raspberry Pi?

I am working on a project, basically my proposal consist in a solution designed under server/client paradigm, on host side I have mounted an Ubuntu Server 20.4 LTS (64 Bits) on a raspberry pi and ...
user avatar
-1 votes
0 answers
22 views

apscheduler ModuleNotFoundError: No module named 'apscheduler.schedulers'

Hello i am trying to import apscheduler on my RPI but i always get an import error. I already have tried installing it with pip and pip3, and also installing previous versions (2.1.2) but i always get ...
user avatar
  • 21
0 votes
1 answer
17 views

Pass serial port readings on RPi to remote for automated testing

The objective of my current RaspberryPi test setup is to read from/write to hardware, and constantly monitor the state/log message stream for test scenarios. The testing code runs on the RPi, and ...
user avatar
  • 1
0 votes
1 answer
24 views

Using the microUSB Port over the 4 pin for Neo-6M GPS Module on Raspberry PI

Just a quick question, what is the difference between using the microUSB port over the 4 pins for data input for the Neo-6m gps module by ublox? or for any other sensor. Does this affect the current/...
user avatar
0 votes
0 answers
35 views

python script does not start at boot

I follow this blog to the t to start a python script on startup. (Rasperi pi4B OS 64bit) my launcher.sh works fine she trying sh launcher.sh the file looks like: cd /home/pi/Documents PYTHONPATH=/home/...
user avatar
  • 3
0 votes
1 answer
23 views

launcher.sh behaves differently @reboot than calling with sh

I was send here from Stackoverflow. Thank you for your help. I am using a launcher.sh for a raspberrypi 4B with Raspi os x64 to start a python script in a python env on startup. But setting the ...
user avatar
  • 3
0 votes
0 answers
22 views

Can I use the PI Camera Stream in Python on a PC and use OPENCV?

So I got a Raspberry Pi with the Pi camera and I would like to use the camera with OpenCV in Python. The problem is, I know I can do this easily on the Pi itself but I highly doubt the Pi will be able ...
user avatar
0 votes
2 answers
33 views

Can't get Cron to run python script

I'm trying to set up porkbun dynamic dns python script to run at reboot via Cron (later I'd like to run it hourly, but baby steps...) following porkbun's tutorial https://www.youtube.com/watch?v=...
user avatar
  • 1
0 votes
0 answers
25 views

Interrupt Exception in thread Thread-1: and I2C read failed using pigpio

im writing a sensor program with python 3 that has a GUI and if the accelerometer detects motions it goes into an interrupt routine and saves and plots the data for a specific timeframe. Now onto the ...
user avatar
0 votes
0 answers
14 views

Tensorflow vehicle detection on Raspberry Pi 2B

Here is the finished project I have in mind. Raspberry Pi 2B with a USB webcam connected, running some sort of object detection python program (using tensorflow or tflite), detecting vehicles going by ...
user avatar
0 votes
0 answers
17 views

PROJ_DIR is set, using existing PROJ installation

I got this error on rapberry pi 3b, when I run pip install -r requirements.txt PROJ_DIR is set, using existing PROJ installation.. Python 3.9 pyproj 3.3.1
user avatar
1 vote
0 answers
33 views

HQ camera hanging after gpu_mem is increased

I just recently got a Raspberry Pi HQ camera and wanted to operate it using a python script. I initially tried to take full resolution pictures using the default gpu_mem=128, but the program crashed ...
user avatar
  • 111
1 vote
2 answers
51 views

In what way can I connect my two raspberry-pi to a INA219 sensor at once using GPIO? This is more of a hardware question/ No Code was used

I am trying to figure out how to connect a INA219 sensor to two Raspberry Pis. I am currently using 4 wires that connect the main raspberry pi and the INA219 sensor. There is no code, I am connecting ...
user avatar
0 votes
2 answers
35 views

How to set PWM to actual 0

I am controlling a stepper motor using PWM on a RPi 4 and python. The motor has a controller/driver (BLDC-8015A) that accepts 0-3.3V to set the rotational speed. According to the documentation, this ...
user avatar
0 votes
0 answers
25 views

Touch screen driver installed but mouse pointer not working with PyQt

My hardware setup is a Raspberry Pi 4B with a Waveshare 5 inch SPI touch screen display attached. The touchscreen is detected as "raspberrypi-ts" and sends events as expected, which I have ...
user avatar
  • 211
1 vote
2 answers
462 views

What model of Raspberry Pi is good for a local web server?

I need some useful information about running a local web server in a Raspberry Pi and the best embedded system that can handle my device. What do I mean? Well I've created a website using django + ...
user avatar
-1 votes
1 answer
25 views

How to control (angle specific) a continous 360degree servo?

I want to control a "Servo motor analoog Micro Servo 9g SG90 360°/continous rotation" with a python script. I do understand the control of a 180° servo but somehow the 360° is not reacting ...
user avatar
  • 1
0 votes
1 answer
65 views

How to get Python binding to recompiled libcamera?

I am trying to recompile libcamera, as I will be changing some stuff in it and I would therefore like to install it manually. The compilation and installation are successful, but I am not able to ...
user avatar
0 votes
1 answer
30 views

Python script that set baud rate in raw

I need help for python script that set baud rate in raw. Because on my raspberry after use sudo stty -F /dev/ttyUSB0 2400 raw and then reboot I lose baud rate and should execuse manually that command.
user avatar
  • 3
0 votes
0 answers
112 views

How to add libcamera to pyenv

I am running a pyenv with 3.10.5 for a RPi 4 b. RPi OS version if important: pi@raspberrypi:~ $ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)" ... The pyenv was simply ...
user avatar
  • 1
0 votes
0 answers
21 views

Raspberry Pi becomes unresponsive when using OpenCV

I'm using Raspberry Pi 4B and running OpenCV on it. I have attached webcam for video steam to detect objects using OpenCV, also, a mouse and keyboard. I'm facing a very unique problem here, when I run ...
user avatar
1 vote
1 answer
41 views

Using I2C/SMBus with Sense HAT and Output stays the same

I have a problem while reading the my lsm9ds1 acceleratorsensor registers . It always displays the same values. My setup is a raspberry pi 4 and the sense HAT which has this sensor integrated. I dont ...
user avatar
0 votes
2 answers
50 views

Autostart python programm

i prefer ask you that i'm French ^^ So I will be very simple. I would like, when i start my raspberry a execution of my python file. That is to says, I want that when my pi starting the programm is ...
user avatar
0 votes
0 answers
32 views

Why does my self-written camera in picamera output only 27 bytes in the specified .h264 file?

Using the documentation for picamera, I am trying to write my own video capturing pipeline on a Raspberry Pi Zero W. The reason for this is that i want to insert a processing step in the pipeline ...
user avatar
0 votes
0 answers
37 views

Logging data from High Precision AD/DA board using Raspberry Pi 3B

I have a High Precision AD/DA board from waveshare with Raspberry Pi 3B (running on Raspbian). With this setup, I get a sampling rate of above 20KPS at my terminal display. However, I can write only ...
user avatar
0 votes
1 answer
52 views

hc-sr501 goes high every minute

So I bought three HC-SR501 PIR and all of them keep trigging (high) every single 60 second on the dot. I don't know what I am doing wrong. The PIR does detect motion when a person is moving but it ...
user avatar
  • 1
0 votes
1 answer
23 views

Python program runs successfully through Thonny IDE but I get ModuleNotFoundError when I run the same through Terminal

I have a python code for attendance system which I'm trying to run in raspberry pi. I'm using python 3.9.2 and have installed all the required libraries through terminal. The code runs fine in Thonny ...
user avatar
  • 3
0 votes
1 answer
50 views

How to decode struct data sent from an Arduino via NRF24L01?

So basically I'm sending this struct data from my Arduino to my RPi, both fitted with an NRF24L01 module. Library on the Arduino is tmrh20, and on the RPi, BLavery. struct values{ char ...
user avatar
0 votes
0 answers
43 views

I2C sending data from arduino to python gives gibberish data

It's my first time working with SMBUS and I've read the docs of arduino and the Wire object. It states that I can send a string. To quote the docs: string: a string to send as a series of bytes. https:...
user avatar
-1 votes
1 answer
30 views

Wrong sound output when using pygame

I am using a raspberry pi 4 and am having issues with the sound output. I am trying to run a program in python using pygame to play an audio file when I run the program. The program works and it plays ...
user avatar
0 votes
0 answers
34 views

GPIO script that counts each time a reed switch is activated

My goal is to attach a magnet to a hamster wheel and use a reed switch to determine the distance traveled and speed of my hamster over a long period of time (several weeks/months) and output it as an ...
user avatar
0 votes
1 answer
35 views

I am trying to make a camera turn on and off with the press of a button, but the GPIO ports are not working, and it is not acknowledging the button

I am using python, and I am getting an error where it says "GPIO.output(24, False)" in the else statement. I don't know what it means, or how I fix it. from picamera import PiCamera from ...
user avatar
0 votes
0 answers
24 views

How to autorun a python script running ssl on raspberry pi startup

I am working on a project on a Raspberry Pi. I am trying to autorun a Python script automatically when the Raspberry Pi is powered up. However, this Python script generates an HTTPS link to access a ...
user avatar
1 vote
0 answers
75 views

Python code not working: Programming a motor to turn on using a switch (Raspberry Pi)

HELP! Ideally within the next 24hrs PLEASE!!!!! We have a simple circuit where we have a button, that when pressed, starts a motor that needs to run at a certain speed for a certain amount of time. (...
user avatar
  • 11
0 votes
0 answers
67 views

Back and forth communication between Pico and PC

I am making a Pico powered PWM fan controller, and I currently have 2 potentiometers to control the fan speed. I am however thinking about writing some software in Python to modify the speed. The ...
user avatar
0 votes
0 answers
63 views

pybluez bad install

Yesterday I installed my Raspberry Pi OS Lite (Debian Bullseye) using Raspberry Pi imager on my Mac. Everything in the most straightforward, up-to-date version. Today I began working with Python. ...
user avatar
0 votes
0 answers
74 views

Help! GSM/GPRS/GNSS HAT - SIM 868

have be struggling for a while with this bit of Python. I have not wrote this code it got installed with the the tracker from this website (https://medium.com/@onehitwonder/how-to-build-a-raspberry-pi-...
user avatar
1 vote
1 answer
112 views

I'm unable to install FLAC on my Raspberry Pi 3

I'm trying to make a tts program on my Raspberry Pi 3 and I'm using Googles TTS API which requires that I have FLAC installed on the Pi. When I attempt to install FLAC, I'm thrown this error- pi@...
user avatar
0 votes
0 answers
26 views

How to use 'bcm2835' to control 'PmodAd1' so that he can at least 500KSPS sample rate?

my device is 'raspberry pi 3' I am using 'PmodAD1', a 12bit ADC with 1Msps sampling rate https://digilent.com/reference/pmod/pmodad1/start Due to linux's 'spidev' system, my sample rate is compressed ...
user avatar
0 votes
1 answer
33 views

bcm2835_spi_begin failed. Are you running as root?

I use bcm2835's mcp3008 sample program to export to .so Then use ctypes to draw .so in python But in the process of compiling python, the following error is thrown bcm2835_spi_begin failed. Are you ...
user avatar
0 votes
0 answers
62 views

How do I calculate the transmission of a mobile robot?

I have some questions about implementing a mobile robot. I have an old construction mobile robot wherein this robot the main controller has been removed, and I put in its place a Raspberry Pi 4. I ...
user avatar
0 votes
1 answer
29 views

Storing Database or installing program on USB drive

I am planning to use by old Raspberry Pi Model B for webscraping with a python script. The data stored will eventually get huge (in GBs). So my SD card will run out quickly. I have a larger capacity ...
user avatar
0 votes
0 answers
28 views

How can I modify my sampling rate using methods other than DMA?

The ADC module PmodAD1 I am currently using with 1M sampling rate and 12bit resolution I use spidev as a library to connect to ADC But it seems that he can only sample up to a sampling rate of 20KSPS ...
user avatar
0 votes
0 answers
21 views

How to use adc to receive 40khz and 43khz modulated signals?

I am currently using thePmodAD1 in this mod for signal reception This is my code from DesignSpark.Pmod.HAT import createPmod import numpy as np import pandas as pd import matplotlib.pyplot as plt adc =...
user avatar
0 votes
0 answers
20 views

Connecting to mysql server with python tls

I am trying to implement TLS in mysql and everything works with in connecting to it except a python code in the raspberry pi. the code looks like this: import mysql.connector import mysql.connector....
user avatar
  • 1
0 votes
0 answers
31 views

Detect motor running physcially

I'm using the pigpio library to run my motor in my Raspberry Pi like below. ESC = 18 esc_pi = pigpio.pi() esc_pi.set_servo_pulsewidth(ESC, 2000) I'm wondering is there any way to detect the motor is ...
user avatar
0 votes
2 answers
73 views

GPIO detects rising edge but does not change status to 1 [closed]

I am really confused: I have a lightbarrier connected over an optocoupler (ACPL-827) with my Raspberry Pi. When the lightbarrier gets triggered (detects a rising edge), it calls the scan-function. ...
user avatar
0 votes
1 answer
443 views

How to run libcamera-still in python trough crontab?

I'm trying to make a time lapse using crontab to manage time intervals. The camera I use is an arducam Autofocus imx519. The libcamera-still command works normally when run via terminal. But when I ...
user avatar
0 votes
1 answer
223 views

AttributeError: module 'RPi.GPIO' has no attribute 'ChangeDutyCycle'

Starting Day 2 troubleshooting this error. Code used to work on a previous rasp pi 4B but doesn't on a new one so I'm assuming I'm missing some breaking change. Problem: Using import RPi.GPIO as GPIO ...
user avatar
  • 143
1 vote
1 answer
60 views

How to check on which OS system the python program is running to import rpi.gpio?

Is there an easy way to let a python program check if it running on the raspberry Pi or the pc running windows? I would like to use this to automaticly use the rpi.gpio functions in my code. I am ...
user avatar
  • 13

1
2 3 4 5
62