-
Notifications
You must be signed in to change notification settings - Fork 460
Description
First off, THANK YOU for creating and maintaining the dji firmware library.
I'm working on querying some "dead" DJI batteries.
I bought and am using one of those generic CP2112 USB cards from Amazon, attached to a Linux laptop. This CP2112 card doesn't support PEC, and while this is revealed as not supported with using IC2Detect....
sudo i2cdetect -F 2
Functionalities implemented by /dev/i2c-2:
I2C yes
SMBus Quick Command no
SMBus Send Byte yes
SMBus Receive Byte yes
SMBus Write Byte yes
SMBus Read Byte yes
SMBus Write Word yes
SMBus Read Word yes
SMBus Process Call yes
SMBus Block Write yes
SMBus Block Read yes
SMBus Block Process Call yes
SMBus PEC no
I2C Block Write yes
I2C Block Read yes
... when the Smbus connection is instantiated, any reference to "pec" in python, whether trying to use "bus.pec" or set the value, results in an Operating System error which complains "OSError: SMBUS_PEC is not a feature" and crashes the associated python script (in this case, comm_sbs_bqctrl.py).
The immediate work around is to eliminate references to, and logic related to, "PEC" in the python script. But the error is rather confusing, and escapes various AI agents, as despite having all the i2detect results, those "experts" couldn't figure out the underlying driver treats "PEC" as NULL for this card, and thus trying to query or set a value generates the OS error.
The test interface of Raspberry Pi doesn't have this issue, as it obviously has support for PEC.
Thank you again for this project. It has been immensely helpful.