Several days ago I thought I would do a seemingly basic exercise to learn how to use an i2c multiplexer TCA9548a with python on the Beaglebone Black, searching the web I have read several basic examples for the raspberry pi (nothing available for the BBB) but I was able to get a basic understanding on how it works.
I have the TCA9548a connected and it is showing on i2c buss 2, 0x70. using this repository to test it, after changing the file to use buss 2 it is working fine, I can see that channel 4 is activated and set using the example.py file
I also have an Adafruit BME280 sensor, when connecting it directly to the Beaglebone Black on buss 2, 0x77. using this repository I can get temperature readings from it just fine.
Now connecting the BME280 to the TCA9548a on channel 4 (because its the channel the example uses) I started to look over the code as to how to try to get the readings from the BME280 threw the TCA9548a. After trying several things I was unsuccessful in getting things to work.
Perhaps I am over thinking this as I soon became puzzled and extremely confuse as to how to get this to work. The file "bme280_sensor.py" from the BME280 repository uses the buss 2 as well as the address of 0x77 threw out the code, so how can I modify it to use the TCA9548a channel 4 without using an address of 0x77 on buss 2.
My first thought was to simply substitute Chanel for address, however still unsure how one would do this. in the "read.py" from the BME280 repository how would I tell it to use the TCA9548a instead of the buss and address?
Is it at all possible? could some one please show me some links or post some code for a basic example on how to achieve this, I would like to learn more about all the above however it seams I have hit a wall. It would be greatly appreciated.
Thank you for your time