Open mamin27 opened 4 years ago
Hi Marian,
It looks like a nice project, and useful for people using Pi's. However, I would prefer to keep this library platform-agnostic if possible. For example I use this library with some different hardware (Rock960 among others) and adding a dependency on the Raspberry Pi GPIO packages would probably break things.
Actually I would suggest the same for your library too, for example you could decouple the Raspberry Pi bits from the actual I2C chip drivers (which could be run on anything).
Best, Josh
Hi Josh,
Nice to look at it from different site. I made some lib analysis and difference between both projects. I am using: Adafruit_GPIO -> Adafruit_PureIO.SMBus (mimics of SMBus) https://pypi.org/project/Adafruit-PureIO/ Adafruit_GPIO is deprecated now so I decided to integrate part of them into my project.
Your used: https://pypi.org/project/smbus2/ from smbus2 import SMBus
Your hardware is different. Maybe in the future I will test them. Please could you check if is able to load Adafruit_PureIO library into Rock960 hardware? I see that Rock960 use i2c chips directly integrated at the board. (IoT versions).
I will stay at Adafruit lib at this moment. In the future maybe I will check smbus2. Will see.
On the Rock960 I have a custom carrier board with the sensors attached for my project (e.g. I have a couple of LED drivers, a BME260 and an INA260 for power monitoring) plus an OLED. Same as a Pi - you need to use the expansion header to connect things, but the board runs at 1V8 so you usually need to level shift up to 3V3 (for some parts).
I've tried to avoid vendor libraries like Adafruit because I'm concerned they won't always be supported - as you found out, GPIO is now deprecated and their EAGLE footprint libraries have been dead for almost a decade. The actual implementation is quite simple: https://github.com/adafruit/Adafruit_Python_PureIO/blob/master/Adafruit_PureIO/smbus.py so it's not clear to me what the advantage is over e.g. smbus2 (maybe they wanted some feature that was useful for their products?)
I'm almost certain Adafruit PureIO would work though, it just emulates SMBus.
Hi Josh
My project eliminated Adafruit_GPIO library dependency (license for using part of library was not problem). I appended Adafruit_GPIO library with some missing feature. So dependent library is only Adafruit_PureIO. If you are able to install Adafruit_PureIO you are also able to test python part for pca9632. https://github.com/mamin27/ecomet_i2c_raspberry_tools/blob/master/i2c_pkg/pca9632_pkg/pca_9632_python_IIC.md
Now I finished I2C sensor hdc1080 (similar to BME260) https://github.com/mamin27/ecomet_i2c_raspberry_tools/blob/master/i2c_pkg/hdc1080_pkg/hdc1080_python_IIC.md
Probably it could work also at Rock960.
Sensor (INA260) interested me. I will order it and in the future prepare the driver.
"I've tried to avoid vendor libraries like Adafruit because I'm concerned they won't always be supported" Adafruit_Python_PureIO has MIT license. Almost without limitation, no warranty also. It is github project so, you could fork project and continue in development when current developer will stop work. So you are almost at same level as it is with smbus2.
So let stay in contact to the future.
Regards
Marian
If it helps, my implementation is here: https://github.com/jveitchmichaelis/ina260
(I misspoke, it's a BME680 - the one with the VOC sensor, I use this library: https://github.com/pimoroni/bme680-python which uses smbus I think)
Hello John,
Let's look at my similar project. https://github.com/mamin27/ecomet_i2c_raspberry_tools There is many i2c sensors that could be integrated in one platform. We could produce more code together.
Regards
Marian