Git Product home page Git Product logo

bme280's People

Contributors

dr4nc3s avatar frostybeard avatar iharris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bme280's Issues

Arduino compiler warnings due to - and _ chars

While building a small project with the BME280 the arduino 2.1.0 version complains about ___ and - chars in the filename and code.

Arduino\trunk\libraries\BME280/BME280_MOD-1022.h:41:21: warning: extra tokens at end of #ifndef directive
41 | #ifndef __BME280_MOD-1022_H
| ^
c:\Users\Hemtron............\Arduino\trunk\libraries\BME280/BME280_MOD-1022.h:42:9: warning: ISO C++11 requires whitespace after the macro name
42 | #define __BME280_MOD-1022_H
| ^~~~~~~~~~~~

Renaming could fix this.

Also an issue about 'register':
c:\Users\Hemtron................\Arduino\trunk\libraries\BME280/BME280_MOD-1022.h:165:33: warning: ISO C++17 does not allow 'register' storage class specifier [-Wregister]
165 | uint8_t readRegister(uint8_t register);

Don't know how to fix this

Don't ignore bus errors

Every Wire.* call ignores the return values, which may indicate errors. It would be nice as a user to know if there was an error on the bus, so that I could compensate with e.g. a retry. So maybe the BME280Class::read* and BME280Class::write* methods could instead of returning void, return a bool or directly the return code from a failing Wire operation.

Your Library Works Great! One question.

Thank you!! Working with no effort. My wiring is I2C with level convertor. Using sensors from Aliexpress. However, any idea why when running the Adafruit BME280_test Library all I ever receive is "sensor not found"? Doesn't make any sense. Thanks.

Need readCompensationParams() before each measure ?

Hi,

Do i need to execute readCompensationParams() before each measurement ?
Does it depend if i make a measure each second or every 5 minutes or once in a hour ?

BTW, i find the pressure value a bit high ( 2 hpa ) when compared to a BMP180 and to our local weather station which is at the same altitude i'm...

Can I use multiple BME280s with this code?

I'm using the breakout board of BME280, MOD-1022, but I'm wondering how I can use multiple sensors with this code.
Is there anyone who tried having multiple MOD-1022s on the same board?

Thanks,

Works perfect with Due, except with the latest IDE 1.8.2, an include was needed

I am using a BME280 (MOD-1022) with Due. At first the example would not compile, but after browsing around a while, I found I needed this include that I put into a pull request for your convenience.
After that was added, it works as-is with Due.
Great product. Now I will add my MOD-1016 lightning sensor.

Here's the pull request:
#8

Several bugs in readCompensationParams() function

Just some hints, most of them addressing already opend issues. There are massive bugs in void readCompensationParams(void)

The union compParams_u elements do not match in size, the compStruct is larger than the array. The uinion fixes this;) but a compiler will warn.

Then in readCompensationParams(void) the buffer is declared as 20 bytes, requested are 24 bytes but the loop reads 28 bytes. This just doen't crash due to the union. But there is no need for a union at all, because the compensation parameters can't be read into the struct directly! The endianess of the values has to be corrected.

The byte order of the T and P params are stored as big endian but they are read as little endian. The short bytes have to be swapped, refer to the original BME280driver by Bosch. This bug leads to very noisy measurements of T and P.

My suggestion:

#define BIG_ENDIAN_UINT16(msb, lsb)             (((uint16_t)msb << 8) | (uint16_t)lsb)

uint8_t data[26];
Wire.beginTransmission(addrBME280);
Wire.write(regCalibStart);
Wire.endTransmission();
Wire.requestFrom(addrBME280, 26); 
for (int count = 0; count < 26; count++) {  // burst read of 26 bytes (including dig_H1)
   data[count] = Wire.read();
}
compParams_ts.dig_T1 = BIG_ENDIAN_UINT16(data[1], data[0]);
// repeat swapping bytes for the remaing shorts of the struct;
compParams_ts.dig_H1 = data[25];

reading the other humidity copmensation parameters is fine.

There is no need to do a readCompensationParams(void) in every loop. These values are fixed and stored in the ROM during the production of the BME device. These values get copied from NV-ROM to the I²C registers at boot/soft reset and are read only.

.cpp line 274

I am currently translating this library for nRF52832
Could anyone explain the reason for the request for 24 bytes followed by a read for 28 bytes, is this an error?

Wire.requestFrom(addrBME280, 24);
for (count = 0; count < 28; count++) { // first 28 bytes we can process like this
compParams.compArray[count] = Wire.read();
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.