Closed dewhisna closed 6 years ago
I had the same issue with ALL-IN-ONE module based on CH341A (my exercise: https://systemembedded.eu/viewtopic.php?f=19&t=26). It's working perfectly if you know I2C address which you should use. It's not so hart do find address for any device... I like this driver, good work Tse Lun Bien!.
It's interesting to know that the CH341A does it too (mine was the CH341T chip on the YS-CH341T I2C/UART adapter). I'm suspecting it's a peculiarity with all the CH341x chips in how they report data, meaning there may not be a way to "fix it" (or should I say "work around it") in the driver.
And yes, one should know the address of the device they are using. But the scan feature is often convenient when troubleshooting connectivity and pull-up resistor issues, when your device isn't responding at all in your application or is giving bad/unexpected data, especially with multiple devices on the bus. Often the first question is whether or not it's responding to the 'read byte' commands normally.
Otherwise the driver is working perfectly for me. And I agree -- good work Tse Lun Bien!.
Overall, this driver seems to work very well. The only issue I've found so far is that running i2cdetect to probe for I2C devices reports devices present at every address regardless of how many I2C devices are really connected. For example:
In this particular case, I had a single I2C device at address 0x76, but it also reports that there's devices on all addresses even when no I2C devices are even connected.
I don't know if this is an issue in the driver or in the CH341 interface chip. I suppose it could be either. I haven't dug into it, but I'm suspecting this could be a simple pull-up vs. pull-down or default high vs low issue and may not be easily solved in the driver. But that's just my guess.
Otherwise, it seems to be working correctly, at least on the BME280 sensor I'm using it for.