On Sun, 29 Oct 2017, Stephen Graf wrote:

Date: Sun, 29 Oct 2017 22:43:44 -0700
From: Stephen Graf <s_g...@telus.net>
To: artturi....@gmail.com, arm@openbsd.org
Subject: problem connecting two BME280 sensors

Hi Artturi,

Now that I have a working NIC on my orangepi one, I turned my attention back
to the BME280 sensors.  I put a second sensor on the system, this time on
the i2c0 bus and changed the dtb to what is included below.  My first
question is, does the dtb look ok?

I am having some difficulties.  When both sensors are connected the first
sensor works, but the second gets an error reading the calibration
registers.  If I disconnect the first sensor, the second sensor works.


Stephen,

Am I mistaken, or are both the bme0 and bme1 sharing the same i2c address (0x76) on the same bus? Perhaps there are jumpers to change the address of the second sensor to a different address??

Just wondering ...

Cheers,
Rob Sciuk



Both sensors connected:

# tail -100 /var/log/messages
...
Oct 29 22:16:42 openbsdop1 /bsd: sxitwi0 at simplebus0
Oct 29 22:16:42 openbsdop1 /bsd: iic0 at sxitwi0
Oct 29 22:16:42 openbsdop1 /bsd: bme0 at iic0 addr 0x76: BME280 60
Oct 29 22:16:42 openbsdop1 /bsd: sxitwi1 at simplebus0
Oct 29 22:16:42 openbsdop1 /bsd: iic1 at sxitwi1
Oct 29 22:16:42 openbsdop1 /bsd: bme1 at iic1 addr 0x76: BME280 60: failed
to read calib24 register
Oct 29 22:16:42 openbsdop1 /bsd: sxitwi2 at simplebus0
Oct 29 22:16:42 openbsdop1 /bsd: iic2 at sxitwi2

# sysctl hw.sensors
hw.sensors.bme0.temp0=21.02 degC
hw.sensors.bme0.humidity0=55.40%
hw.sensors.bme0.pressure0=101.44 Pa


Only second sensor connected:

# tail -100 /var/log/messages
...
Oct 29 22:21:39 openbsdop1 /bsd: sxitwi0 at simplebus0
Oct 29 22:21:39 openbsdop1 /bsd: iic0 at sxitwi0
Oct 29 22:21:39 openbsdop1 /bsd: bme0 at iic0 addr 0x76: cannot read ID
register
Oct 29 22:21:39 openbsdop1 /bsd: sxitwi1 at simplebus0
Oct 29 22:21:39 openbsdop1 /bsd: iic1 at sxitwi1
Oct 29 22:21:39 openbsdop1 /bsd: bme1 at iic1 addr 0x76: BME280 60
Oct 29 22:21:39 openbsdop1 /bsd: sxitwi2 at simplebus0
Oct 29 22:21:39 openbsdop1 /bsd: iic2 at sxitwi2

# sysctl hw.sensors
hw.sensors.bme1.temp0=21.64 degC
hw.sensors.bme1.humidity0=50.11%
hw.sensors.bme1.pressure0=101.41 Pa


Section of DTB with i2c:

               i2c@01c2ac00 {
                       compatible = "allwinner,sun6i-a31-i2c";
                       reg = <0x1c2ac00 0x400>;
                       interrupts = <0x0 0x6 0x4>;
                       clocks = <0x2 0x3b>;
                       resets = <0x2 0x2e>;
                       pinctrl-names = "default";
                       pinctrl-0 = <0x13>;
                       status = "okay";
                       #address-cells = <0x1>;
                       #size-cells = <0x0>;

                       bme@0 {
                               reg = <0x76>;
                               interrupts = <0x0>;
                               compatible = "bosch,bme280";
                       };
               };

               i2c@01c2b000 {
                       compatible = "allwinner,sun6i-a31-i2c";
                       reg = <0x1c2b000 0x400>;
                       interrupts = <0x0 0x7 0x4>;
                       clocks = <0x2 0x3c>;
                       resets = <0x2 0x2f>;
                       pinctrl-names = "default";
                       pinctrl-0 = <0x14>;
                       status = "okay";
                       #address-cells = <0x1>;
                       #size-cells = <0x0>;

                       bme@1 {
                               reg = <0x76>;
                               interrupts = <0x0>;
                               compatible = "bosch,bme280";
                       };
               };

               i2c@01c2b400 {
                       compatible = "allwinner,sun6i-a31-i2c";
                       reg = <0x1c2b400 0x400>;
                       interrupts = <0x0 0x8 0x4>;
                       clocks = <0x2 0x3d>;
                       resets = <0x2 0x30>;
                       pinctrl-names = "default";
                       pinctrl-0 = <0x15>;
                       status = "okay";
                       #address-cells = <0x1>;
                       #size-cells = <0x0>;
               };



--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Robert Sciuk                                                          
r...@controlq.com
97 Village Rd.                                                            
289.312.1278
Wellesley, ON. N0B 2T0

Reply via email to