-->
Page 4 of 8

Re: Connect BME280 sensor to NodeMCU or WeMos D1 via I2C ?

PostPosted: Thu Feb 18, 2016 10:40 am
by Gawan
Hm, now it says:

BME280 test
ChipID = 255
Could not find a valid BME280 sensor, check wiring!
Soft WDT reset

Re: Connect BME280 sensor to NodeMCU or WeMos D1 via I2C ?

PostPosted: Thu Feb 18, 2016 2:41 pm
by martinayotte
Really strange, it should have read 0x60 ...
Are you sure that your BME280 is not defective ?
I don't have much other clues ...

Re: Connect BME280 sensor to NodeMCU or WeMos D1 via I2C ?

PostPosted: Thu Feb 18, 2016 5:55 pm
by Gawan
Hi,
finally I found some code that works.
(5.96 KiB) Downloaded 946 times

Unfortunately it has 2 disadvantages.

1. it is quite low-level and I dont understand everything, e.g. the calibration-functions or why does it write to Wire ??
2. I did not find a possibility so far to do sea level calibration (its 1013.25 here)

Can you - without too much effort - find out why it works and why the other library did not ?
Seems to be something with Wire.h but I do not understand the details :(

BR
Gawan

Re: Connect BME280 sensor to NodeMCU or WeMos D1 via I2C ?

PostPosted: Thu Feb 18, 2016 7:24 pm
by martinayotte
Maybe you should try, using this lib, to add a new readChipID() function to see if it still giving wrong ID.
If it still wrong, then, maybe your BME280 is a clone and simply commenting the check in Adafruit lib will be the trick.
Code: Select allint readChipID() {
    Wire.beginTransmission(BME280_ADDRESS);
    Wire.write(0xD0);
    Wire.endTransmission();
    Wire.requestFrom(BME280_ADDRESS,1);
    return Wire.read();
}

and in your sketch :
Code: Select allSerial.print(readChipID());