I am now trying to set up the BBB, running latest image of Debian XFCE, to accept Temp/H/P sensor BME280 on i2c2 (i2c0 is being used by Ext. Real Clock)
As I have so far learned, overlays are needed. I am still pretty confused about overlay usage, but will continue researching.
For the BME280 I found the following overlay .dts: BB-I2C2-BME280.dts
In order to get it installed into BBB, would I use the following:
n /boot/uEnv.txt add:
uboot_overlay_addr4=BB-I2C2-BME280.dtbo
Or, does addr4 need to be changed to some other address (but I would not know how to select another addr)
And, would I now use pins 19 and 20?
Why not use the already configured i2c bus that the rtc.module uses ?
The only reason you might not be able to do that is if both devices use the same addresses.
I2C devices either have some pins to configure alternative addresses or they can be fixed
In order to use the RealTimeClock, nothing worked until CNelson instructed me on the overlay. Would this now be different for the BME280?
I’d rather be safe than sorry. Plus, is there a reason not to use the i2c2?
Addendum: Benedict.hewson: You are absolutely correct it seems!
I powered down BBB, attached BME280 to same pins as DC3132 and I believe both are working.
Will do a little more checking on BME with python to see if it reads out, but i2cdetect is showing 76!
TY!!!
Now confused again:
I definitely am not capable of writing an overlay or driver, is that what you mean?
I am currently writing a little python3 script to access the sensors data, that should work?
Not working so easily - guess I need more brain cells!
the python3 code I wrote for the RPi imports a BME280.py script (which was written specifically for the RPI) and includes a ‘import smbus’ line.
smbus is probably not used by BBB as it throws an error.
The smbus is used to designate which bus is being utilized (in my bbb, it is bus 1)
what would be the correct code to give it the correct bus?
Or, if it is needed to install the overlay, would my above decription be correct:
For the BME280 I found the following overlay .dts: BB-I2C2-BME280.dts
In order to get it installed into BBB, would I use the following:
n /boot/uEnv.txt add:
uboot_overlay_addr4=BB-I2C2-BME280.dtbo
Or, does addr4 need to be changed to some other address (but I would not know how to select another addr)
And, would I now use pins 19 and 20?