I have a Raspberry Pi with six LEDs and button (also with LED) on the custom circuit board that is connected to GPIO pins. This RPi previously had an AdaFruit Neopixel with LEDs, but later my client decided to switch to that custom board. I have to modify a Python application to turn off all lights, but the problem is that it doesn't work. Any light change is discarded when my application is closed and all lights are turn on. What to do with it? Another interesting thing is that two of LEDs are turned on after plugging power cable into RPi and after shutting down the system. It seems that default state of at least two lights is "on", but why only two lights are in "on" state during and after boot, but before running my application? Turning things like active_high for a LED in gpiozero don't help as it's discarded at the end.
Can I do something with it or I just should tell my client to rework a circuit board? I have zero knowledge about electronics, but it seems that they messed something up with high/low states on that circuit board.
I found a way to turn off lights, at least for a few seconds before the system is fully shut down:
import subprocess from gpiozero import LED led = LED(8) led.off() led.close() subprocess.run(['raspi-gpio', 'set', '8', 'ip', 'pd'])
I had to close LED first, and then use subprocess to run raspi-gpio command to really turn off the light.
But the problem remains, after shutting down the system, it lights up again.