Hi Folks
I realize this is probably the worst possible weekend to be looking for help, but I have a somewhat urgent problem. I’m trying to use a peripheral ADS1115 board from Adafruit with my Pi4+Navigator setup. I know there is an ADS1115 built in to the Navigator but I need to use it differently than it allows. In any case, the trouble is that the CircuitPython libraries supplied with the board can’t see beyond the default I2C bus on the Pi, specifically they can’t see the I2C-6 bus where extra peripherals attached to the Navigator now live. Does anyone know a way to create an alias on a specific I2C bus for an I2C device living on a different bus? Or create virtual GPIO pins for the SDA and SCL lines on the I2C-6 bus that the CircuitPython libraries would be able to access? Or some other solution? Any help much appreciated as always. As a fallback it looks like I’ll have to reinstall an old Pi 3 and Pixhawk combo.
I realize this is pretty niche since this pertains only to running CircuitPython/Blinka boards from Adafruit, but in case anybody else runs into this problem, here’s the solution:
First install the adafruit extended bus package:
pip3 install adafruit-extended-bus
then in your code, instead of using the usual busio way of opening your i2c connection, like this:
i2c = busio.I2C(board.SCL, board.SDA)
use this line instead, with the 6 here indicating the /dev/i2c-6 where external things connected to the Navigator board end up:
from adafruit_extended_bus import ExtendedI2C as I2C
i2c = I2C(6)
then go ahead and connect to the board or boards as usual:
ads1 = ADS.ADS1115(i2c, address=0x48) #or 0x4a or whatever you've set the board to
1 Like