I had a Pi Zero. I broke it and the SD card, then bought a Pi Zero 2 and installed raspbian v 12 (bookworm).
Now when I try to import devs.py
in separate processes, I get lgpio.error: 'GPIO busy'
.
devs.py:
from gpiozero import OutputDevice
devs = (
OutputDevice(2),
OutputDevice(3),
)
shell.py
:
import code
import devs
code.interact(local={ 'devs': devs })
The daemon that starts at boot via /etc/rc.local
:
import devs
while True:
do_something()
This is extremely inconvenient. Now every time I need to ssh into the pi and open a shell, I have to comment out the rc.local file and reboot.
I never had this problem when I was using the Pi Zero, so it must have something to do with configuration or the newer OS install.
How can I import devs.py
in separate, running processes?
rc.local
on asystemd
OS? What isdo_something()
?