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

Can Picamera save pictures as tiff instead of jpeg?

I am new to Python and the Picamera and when reading the API there are only a few other formats to save the pictures (https://picamera.readthedocs.io/en/release-1.10/api_camera.html#picamera.camera....
0
votes
2answers
40 views

C or Python With Physical Computing [closed]

I am a professional programmer with 15 years experience in bash, javascript, Python, Java etc looking to do some projects with my pi... Physical computing. I want to involve my 13 yr old son but also ...
0
votes
0answers
11 views

Motion Detection in Split Frames using Raspberry Pi [closed]

I have a camera which is split into for frames. I'm currently trying to check for motion in each individual split frame. However, it seems that my contours is not being displayed in cv2.imshow, only ...
0
votes
1answer
34 views

Is it possible to narrow the sensor beam on a PIR motion sensor?

I recently purchased and configured two motion sensors on a Raspberry Pi 3B model. I am very excited as I am getting a reading but the sensors are very responsive. Is there a way to narrow the ...
0
votes
0answers
58 views

Python script or button failing after 20 minutes [closed]

Below I have a script I'm running on a Raspberry Pi 4 Model B - Basically I have an arcade button that triggers both a power strip and a via Gphoto2 (http://www.gphoto.org/). The script works perfect ...
0
votes
0answers
24 views

I want to create news ticker using rpi GPU [closed]

Eg. https://youtu.be/g-YD5SgDdhk I want to create overlay news ticker. which will play some scrolling text using rpi gpu and not cpu. Anyone have any idea? I have tried to write code in python but it ...
1
vote
0answers
32 views

Getting “has no 'x' member errors” for Rpi.GPIO using vscode remote ssh extension

I just set up my raspberry pi and have been using vscode (remote - ssh extension) on my windows computer to code on there but I have been getting errors like "Module 'RPi.GPIO' has no 'output' ...
1
vote
1answer
22 views

Apt-get uanble to locate package httplib and urllib

I am using Pi 4. So few days back I installed two libraries httplib and urllib to run a code. But recently I found out that both these libraries are missing. So when I try to reinstall them again ...
0
votes
0answers
34 views

How can I route all Ethernet traffic to Serial port and vice versa? [closed]

How can I route all Ethernet traffic on a Linux system to a Serial port and the opposite? I want to convert from the first architecture to the second one, as shown in the picture: picture I monitored ...
0
votes
1answer
35 views

Read serial data from multiple arduino

Please help me find problem in this code: import serial ser=serial.Serial("/dev/ttyACM0",9600) ser.baudrate=9600 ser1=serial.Serial("/dev/ttyUSB0",9600) ser1.baudrate=9600 ser2=...
0
votes
1answer
22 views

Notify Raspberry Pi from external server

I'm trying to set up a build server so that every time it completes a build, it notifies/pings my Raspberry Pi, which will then run some scripts and do some testing stuff. My first idea was to set up ...
1
vote
0answers
28 views

how to use MCP23S17 pin expander via SPI

I'm working on a custom sensor that is wired to a couple of MCP23S17 gpio expanders, which are in term connected to a Raspberry Pi 4 via the SPI pins i.e. SPI_MOSI, SPI_MISO, SPI_SCLK and CE0 pin. I'm ...
1
vote
2answers
46 views

Controlling Raspberry Pi GPIO with c and Python

I was searching for C and Python Libraries which support Pi4.
0
votes
0answers
21 views

How to install NumPy using pipenv using piwheels?

Installing NumPy on a Raspberry Pi 3 takes forever because of compilation time. I stumbled upon https://bennuttall.com/piwheels-building-a-faster-python-package-repository-for-raspberry-pi-users/. ...
1
vote
3answers
47 views

Which language to use for an application which includes a REST API?

I have an RPi which I want to use to interface to a number of different devices via I/O and/or COM. A PC will communicate with it via ethernet and a REST API. The app should be able to start up ...
0
votes
0answers
17 views

RPi and Ultrasonic Sensor

I'm new to RPi and electronics and I have a following problem: I'm trying to make app where I will count how many times a line is crossed. I'm using a Ultrasonic sensor with which I am measuring ...
0
votes
1answer
50 views

Send GPIO trigger(s) at specific video timecode(s)?

Just starting out in the wonderful world of RPi maker projects, scored a Model 2b v.1.1, installed the latest Raspbian and now ready for my first project :-) What I want to build is a video player for ...
0
votes
0answers
40 views

Writing software for the RPi without hardware (Mocking/Stubbing)

I have an IoT project that uses the Pi Zero W and at some point want to utilize the compute modules for industrial application. Currently, doing dev I may use a RPi 3/4 to copy files across and run ...
2
votes
2answers
42 views

Serial (RS232) Controled Projector

I have a raspberry pi zero W and a NEC PA500U projector, and am attempting to set up a semi-permanent slideshow installation. My main sticking point right now is getting the pi to communicate with the ...
0
votes
2answers
37 views

Why is my Python script causing 100% processor usage? While loop to monitor GPIO button

import json from gpiozero import Button from time import sleep from mpd import MPDClient button = Button(23) while True: if button.is_pressed: client = MPDClient() # create ...
-1
votes
1answer
31 views

Odd results when using RPi.GPIO's event_detected() function

I've recently been experimenting with RPi.GPIO's event_detected() function, to check if a button (connected to the gpio) has been presssed. However, for some reason events would randomly be detected. ...
-1
votes
0answers
25 views

Connect a Vandal Switch with Raspberry-Pi and register an Input/Output with a click

I want to connect a Vandal Switch(CPS) with an Raspberry Pi, there i want to register via an Python program when the Button is Pressed and change the Led light from blue to Red. How i connected the ...
0
votes
1answer
27 views

Python only saves last picture taken

I am new to programming with Python and the Raspberry Pi, and for my first project i wanted to play the official "Push button stop motion" code from the official raspberry pi camera guide (...
0
votes
2answers
48 views

GPIO 3.3 V signal still readable after inputting high resistance values

I recently obtained a raspberry pi 4 (8GB) and I am trying to understand the GPIO behavior and ran into an event that I don't understand. I have set-up a simple script that allows pin 36 (GPIO 16) to ...
0
votes
2answers
38 views

Unable to create virtual environments on my Raspberry Pi 4

I am trying to get a virtual environment for Django development but I cannot get it working. So far I have: sudo pip3 install virtualenvwrapper I have then added the following to /home/pi/.bashrc ...
0
votes
0answers
21 views

Using Adafruit RFM96W with Raspberry Pi for a end node of The Things Network

I am trying to create a Raspberry Pi 3 end node with the Adafruit RFM96W module and raspi-lora library but it seems that the library has no configurable APPSKEY, NWKSKEY, DEVADDR and etc., so I won't ...
1
vote
1answer
63 views

Serial comm to Arduino - ImportError: cannot import name Serial from serial

Trying to send a message from my Pi to the Arduino via serial communication and I'm receiving this error despite having installed pyserial ImportError: cannot import name 'Serial' from 'serial' (/home/...
1
vote
0answers
49 views

I cannot install opencv

I just bought a new camera for my pi so I installed it and then I wanted to test it out so I got a simple python program to test it: import cv2 as cv def testDevice(source): cap = cv.VideoCapture(...
1
vote
1answer
60 views

gpiozero on a pi4?

Working on getting some working samples setup for my son on his RPI4 so he can play with the GPIO's, breadboard, and some various pieces to use with the breadboard. Right now we're trying to test out ...
0
votes
1answer
36 views

How to reshape the output stream of the script to make it work for a cvlc stream using Python?

stream.py needs to be changed: import sys import cv2 from picamera.array import PiRGBArray from picamera import PiCamera import time RES_W = 640 RES_H = 480 camera = PiCamera() camera.resolution = (...
-1
votes
1answer
45 views

Detect when LED is on

I'm trying to get the status of a LED (being controlled from another Pi, but on the same breadboard). If the LED is on, to get the other Pi (GPIO 25) status to be on and vice versa. Here is the code ...
0
votes
0answers
33 views

start LED lights by GPIO

I wrote a script that works so far. If GPIO4 gets contact the LEDs go on, if the contact is interrupted the LED back value goes out again. Now the GPIO 17 should also switch the LEDs on and off in the ...
1
vote
0answers
30 views

adafruit_drv2605 AttributeError: object has no attribute 'try_lock'

I am using a Texas Instruments DRV2605 to drive some haptic motors. I am using the Adafruit library here to communicate with the DRV through Python. I need to set some bit registers of the chip but ...
1
vote
0answers
37 views

Starting Python program on boot starts but buttons do not work

Latest Raspbian on a pi zero w... I'm newish and still learning. I have a simple python program that connects to i2c lcd display that will control credits on a home arcade machine. So a momentary ...
1
vote
1answer
52 views

I am making a line following robot with obstacle detection

so I have made a code where it detects an obstacle it brakes elif it runs the trackok.py code the problem is when it starts the trackok.py code it stays in it and doesn't stop even if an obstacle is ...
0
votes
1answer
29 views

Using Python to enable camera without raspi-config

I created a Python project that requires the camera to be enabled. In order to make it user friendly, I'm trying to enable the camera automatically without the user having to do it manually using ...
0
votes
0answers
13 views

PiCamera network streaming error

I'm trying to stream camera output to an Android application this (python) code works fine: import socket import time import picamera keep_alive = True print("wait connection") camera = ...
2
votes
1answer
34 views

PiCamera stream differences

I'm trying to create a h264 stream from my Pi 3 and display it on an Android application. After several attempts I found quite a simple solution: raspivid -n -ih -t 0 -w 640 -h 480 -fps 25 -b 2000000 -...
0
votes
0answers
21 views

USBTMC library with Rasspberry pi

I'm trying to communicate with USBTMC device using raspberry pi and python. The first time i run the code it returns the right answer and everything is good, but on the second run i get no answer from ...
0
votes
0answers
17 views

Stream raspi video to php application

I have an PHP Application running on a "server" and my raspberry which is connected to a display is showing this application (chromium). Also on my raspberry is the new hd camera connected ...
0
votes
0answers
39 views

USB Audio Input failed after update, Buster, Pi 4 8gig. Extensive T/S, no luck, need help

Running a Raspberry Pi 4 8-gig, Buster, Python 3.7.3 I have been running Speech Recognition for about a year just fine (first on RPi 3B+, then 4 - 4gig, now on 4 - 8gig). Recent update seems to have ...
1
vote
0answers
43 views

i2c /IIC 20x04 lcd not displaying text

I have an 20x4 LCD and an i2c /IIC interface. If connected to the raspberry pi zero w, it looks the following: And from the back it looks like this: Interestingly, the power led of the icc/i2c ...
-2
votes
2answers
160 views

Autostart a program at boot up?

I want to autostart a Python script that starts a Tkinter GUI at boot up. The working terminal command to start the script is python3 /home/pi/Documents/slincam/slincam_menu.py. I added this command ...
0
votes
1answer
80 views

writing to GPIO [closed]

Is there a way using python (Raspberry PI 4) to write a nibble to the GPIO in one write operation. I have done a project which would benefit from that. Project details here. https://sites.google.com/...
0
votes
1answer
33 views

Python script to listen for additional GPIO events

I'm working on a simple script that detects a voltage drop on a circuit. Specifically, when a doorbell is pressed. I've wired the doorbell up to GPIO pins. The below Python script works, however, it ...
0
votes
0answers
33 views

Load cell changing over time

I'm using a 1kg load cell beam (see example at bottom) connected to a HX711 board then connected to the Raspberry GPIO. I'm running this Python3 code: https://github.com/gandalf15/HX711/blob/master/...
1
vote
1answer
56 views

Way to get signal strength from an RFID reader?

I am attempting to make a grid of RFID readers that can triangulate the position of a tag within their read range. I am currently using MFRC522 readers connected to a Raspberry Pi 4 Model B (4gb) and ...
0
votes
1answer
50 views

Running the Pi as a bluetooth host device rather than a client in python

I'm trying to find some example code for using the pi as a bluetooth device so that other devices can search for it and pair with it. Specifically I want to make it behave like a bicycle power meter ...
0
votes
1answer
36 views

Two unrelated GPIO scripts interfere with each other

I have two completely seperate python scripts involving the GPIO that runs on startup. The issue i'm having is that when I call the turn fan on or off it sometimes triggers the halt script I have and ...
0
votes
0answers
43 views

Display image in cli (with python on rpi) FBI, FIM, Pillow, Wand etc

I have managed to display an image on the screen attached to my pi using FBI with the command sudo fbi -a -noverbose -T 2 /home/pi/image.jpeg, however it seems to cause some issues where it crashes ...

1
2 3 4 5
55