diff --git a/README.md b/README.md index a6a37f6..2b263f3 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,7 @@ ____________________________________________________ ____________________________________________________ ## Timeline (Versions): +- 2024.06.07 Dynamic Height Correction of the BME280 Pressure readings. - 2024.05.21 WEMOS ESP32 Battery Holder + LoRa SX1278 + GPS Module support added. - 2024.05.16 all boards now work with Radiolib (LoRa) library from @jgromes. - 2024.05.13 BME modules will be autodetected (I2C Address and if it is BME280/BMP280/BME680). diff --git a/data/tracker_config.json b/data/tracker_config.json index 7614b20..0944d66 100644 --- a/data/tracker_config.json +++ b/data/tracker_config.json @@ -80,7 +80,6 @@ }, "bme": { "active": false, - "heightCorrection": 0, "temperatureCorrection": 0.0, "sendTelemetry": false }, diff --git a/src/bme_utils.cpp b/src/bme_utils.cpp index 62166b6..2aef1ab 100644 --- a/src/bme_utils.cpp +++ b/src/bme_utils.cpp @@ -1,13 +1,15 @@ +#include +#include #include "bme_utils.h" #include "configuration.h" #include "display.h" -#include #define SEALEVELPRESSURE_HPA (1013.25) #define CORRECTION_FACTOR (8.2296) // for meters extern Configuration Config; extern logging::Logger logger; +extern TinyGPSPlus gps; float newHum, newTemp, newPress, newGas; @@ -254,7 +256,7 @@ namespace BME_Utils { } else if (wxModuleType == 2) { humStr = ".."; } - presStr = generatePresString(newPress + (Config.bme.heightCorrection/CORRECTION_FACTOR), type); + presStr = generatePresString(newPress + (gps.altitude.meters()/CORRECTION_FACTOR), type); if (type == 1) { if (wxModuleType == 1 || wxModuleType == 3) { wx = tempStr; diff --git a/src/configuration.cpp b/src/configuration.cpp index 1a49a8c..74fdf05 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -54,7 +54,6 @@ void Configuration::readFile(fs::FS &fs, const char *fileName) { winlink.password = data["winlink"]["password"].as(); bme.active = data["bme"]["active"].as(); - bme.heightCorrection = data["bme"]["heightCorrection"].as(); bme.temperatureCorrection = data["bme"]["temperatureCorrection"].as(); bme.sendTelemetry = data["bme"]["sendTelemetry"].as(); diff --git a/src/configuration.h b/src/configuration.h index fa52788..124f1f6 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -39,7 +39,6 @@ public: class BME { public: bool active; - int heightCorrection; float temperatureCorrection; bool sendTelemetry; };