Chat freely about anything...

User avatar
By Cosmic Mac
#57693
Glyphi wrote:Thank you! I had exactly the same problem and your code has fixed it. Now I'm very tempted to dig and find out why Adafruit's code didn't - it would be nice to give something back for a change, cos I bet the same fix would work for BMP180 and 280.


Adafruit library uses 0x77 as default address for the module.
See https://learn.adafruit.com/adafruit-bme280-humidity-barometric-pressure-temperature-sensor-breakout/wiring-and-test

Changing 0x77 into 0x76 did the trick for me (simply edit Adafruit_BME280.h file).

Sorry if this post comes a bit late but I hope this will save some time to the next reader in the same situation.
User avatar
By Satsatt
#61104
reaper7 wrote:nice to hear :)


Hi reaper,
i must admit that your code is the only one i found working.
At least i got some data but what means that line ?
sprintf(bufout,"%c[1;0H",ASCII_ESC); is there a typo? "%c[1;0H"
i replaced it to sprintf(bufout,"",ASCII_ESC);

The Temperature is at least 3C to high and the Altitude never changes.
I was looking in your github but could not find it.

maybe you can give some hints - thanks
User avatar
By reaper7
#61110 @Satsatt

Code: Select allsprintf(bufout,"%c[1;0H",ASCII_ESC);

this is a command for real terminal program like putty
and it's something like "back to left top terminal corner" or "home"
with this command each loop execution prints values in one place without scrolling lines.

------------

higher temperature is a probably bme problem, reported in many places, for eg.:
http://hackaday.com/2017/01/03/humidity ... -shootout/
(read comments)

------------

altitude never changes in my example because as You see, it is calculated from relativepressure:
Code: Select allSerial.print(BMESensor.pressureToAltitude(relativepressure));
and relativepressure is calculated from declared MYALTITUDE:
Code: Select allfloat relativepressure = BMESensor.seaLevelForAltitude(MYALTITUDE);

it's look like this pseudo code:
Code: Select all#define MYALT = 3

//calculate relative pressure
relativepress = 1 + MYALT     //result -> 4

//calculate altitude
altitude = relativepress - 1    //result -> 3 :) calculated altitude == defined MYALT :D


...so, do not use relativepressure for altitude calculation, instead use a pressure.
User avatar
By Sirquil
#63275 You may need to change the BME280 address in Adafruit_BME280.h:

Code: Select all/*=========================================================================
    I2C ADDRESS/BITS
    -----------------------------------------------------------------------*/
    #define BME280_ADDRESS                (0x76)  // popular ebay BME280 address
// otherwise will need to run I2cscanner.
/*=========================================================================*/


William