-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
I2c package needs to be update to work on bookworm #1177
Comments
Removing the old driver and install the new one only changes that one package; all the other related packages are not affected. That is good news.
|
Branch: https://github.com/autorope/donkeycar/tree/1177-update-i2c-driver-for-bookwork
|
I've tested main (donkey 5.1dev1) and it works fine on a RaspberryPi 5 with RaspberryPi OS bookworm. So I am closing this issue because we do not need it right now. I'm closing the associated PR #1178 as well. That code has some bug i the throttle output, but is mostly complete, so I'll keep the branch around in case we decide we want to do this work in the future. |
Users have indicated that PCA9685 is not working on RaspberryPi OS Bookworm. This is likely because we are using a very old an deprecated library that was not updated to handle the change in how gpio is addressed in RaspberryPi OS.
The old dependency is Adafruit_PCA9685, which is marked as deprecated and suggests using Adafruit_CircuitPython_PCA9685.
Adafruit_CircuitPython_PCA9685 has two pieces we need, the PCA9685 class which initialized the PCA9685 bus, address and frequency, and the PWMChannel class, which controls a specific servo channel on the board.
We need to update the code in two places to use the new classes. The first is in the pin specifiers code, pins.py. The pins.py:PCA9685 class should now import the Adafruit_CircuitPython_PCA9685:PCA9685 class to initialize the board. Then for each pin that is created, it will instantiate a [Adafruit_CircuitPython_PCA9685:PWMChannel]((https://github.com/adafruit/Adafruit_CircuitPython_PCA9685/blob/874545d908077baed0be8055cbbc63280a00c034/adafruit_pca9685.py#L51C7-L51C17) to control the pin.
The other place to update is the legacy donkeycar/parts/actuator.py:PCA9685 actuator class. Here we can eliminate duplication by instantiating a pwm pin using the pin providers PwmPinPCA9685 function, calling it with the pca9685 factory method to get the shared driver. If we do that then all the PCA9685 code is in one place.
The text was updated successfully, but these errors were encountered: