-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LightSensor() no longer works under Raspbian Bookworm / Linux 6.6.20 #1135
Comments
Looks as if there is a pulldown enabled when switching the GPIO to input. Checked with bookworm on a Pi5. |
Can confirm this for both Pi Zero 2W and Pi 4. Not sure about the pull down thing though, the capacitor voltage peaks at around 3.3V as expected (measured at the GPIO pin). Previously, the capacitor immediately got discharged when the positive edge was detected. After upgrading, the library now always waits until the I've also had this issue on ArchLinux ARM. As RPi.GPIO still works there, I was able to fix it by uninstalling lgpio and letting gpiozero fall back to RPi.GPIO. The issue seems to be specific to lgpio. Unfortunately, RPi.GPIO is unusable on Bookworm because of this bug, so there seems to be no way to actually get it to work, which is kind of disappointing. |
Operating system: Raspbian Bookworm
Python version: 3.11.2
Pi model: Pi Zero 2W
GPIO Zero version: 2.0
Pin factory used: lgpio version 0.2.2.0
Recent upgrade of Bookworm that uplifted the Linux vernal from 6.1.0 to 6.6.20, the LightSensor() class no longer works. Simple test programme below, the when_light() callback is never called and the LightSensor value always returns 0.0, regardless of the light level.
Same circuit was used before and after. Also proved that the circuit still works by testing using OutputDevice() and InputDevice() to discharge the capacitor and timing how long it takes to charge based on whether it is light or not.
The text was updated successfully, but these errors were encountered: