The solution really is ensuring your code only tries to import goiozero twice, eve when debugging is on.Sooooooooooooooooo... this is the SolutionI guess 'flask' with 'debug=True' is doing something like this -That works pre-Bookworm if not using 'libgpiod'. It doesn't with 'Bookworm', using 'libgpiod', and presumably Pi 5.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()
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.![]()
I have to move on without this argument.
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