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

Troubleshooting • Re: Busy GPIO's Raspberry PI5

$
0
0
I guess 'flask' with 'debug=True' is doing something like this -

Code:

import gpiozeroimport osimport sysLED = gpiozero.OutputDevice(0)if len(sys.argv) <= 1 or sys.argv[1] != "forked":  os.popen("python3 {} forked".format(sys.argv[0])).read()
That works pre-Bookworm if not using 'libgpiod'. It doesn't with 'Bookworm', using 'libgpiod', and presumably Pi 5.

Arguably it should never have worked, only worked because of what some would describe as flaws in the way GPIO has traditionally been handled on a Pi, which 'libgpiod' no longer allows.
Sooooooooooooooooo... this is the Solution :D
I have to move on without this argument.
The solution really is ensuring your code only tries to import goiozero twice, eve when debugging is on.

I'd give it a try, but I don't have a pi 5 and I'm on the road at the moment.

Statistics: Posted by memjr — Wed Dec 27, 2023 12:45 am



Viewing all articles
Browse latest Browse all 4906

Trending Articles