Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8013

Beginners • gpiozero error

$
0
0
Background
For the past 6 months I have had a Raspberry Pi 4 python3 program monitoring a door using a magnetic door switch. I made up a lead to connect between the magnetic door switch and GPIO4 (pin7) of the Pi. This program uses the gpiozero function. (I use 'from gpiozero import Button as gButton' at the beginning of my program)
I recently decided to add a similar system to a letterbox on another door. Again I used a magnetic switch. I made up a lead to connect between the magnetic switch of the letterbox and GPIO4 (pin7) of the Pi, exactly the same as the door switch. I moved the RPi4 to its new location near the letterbox. This works perfectly.

The Problem
I have now loaded a new Raspberry Pi 4 with exactly the same Python program and located it at the door with the existing lead to the magnetic door switch.
However, as soon as the program is run, it reports a 'GPIO busy' error at line 458 in the program lgpio.py which must a program that is loaded from the beginning of my program.
I performed a package list update to ensure I have installed the latest gpiozero.

Could someone please advise why the same program will not run on what I think are 2 similar applications.

Thanks in anticipation.

Statistics: Posted by RDS — Fri Mar 21, 2025 12:16 pm



Viewing all articles
Browse latest Browse all 8013

Trending Articles