diff --git a/src/bme_utils.cpp b/src/bme_utils.cpp index 4ac1ecf..715ee91 100644 --- a/src/bme_utils.cpp +++ b/src/bme_utils.cpp @@ -2,7 +2,6 @@ #include "configuration.h" #include "gps_utils.h" #include "display.h" -#include #define SEALEVELPRESSURE_HPA (1013.25) #define CORRECTION_FACTOR (8.2296) // for meters @@ -17,12 +16,11 @@ float newHum, newTemp, newPress, newGas; Adafruit_BME280 bme280; +//Adafruit_BME680 bme680; #ifdef HELTEC_V3 Adafruit_BMP280 bmp280(&Wire1); -Adafruit_BME680 bme680(&Wire1); #else Adafruit_BMP280 bmp280; -Adafruit_BME680 bme680; #endif @@ -59,12 +57,25 @@ namespace BME_Utils { wxModuleType = 1; wxModuleFound = true; } + /*if (!wxModuleFound) { + if (bme680.begin(wxModuleAddress, &Wire1)) { + Serial.println("BME680 sensor found"); + wxModuleType = 3; + wxModuleFound = true; + } + }*/ #else if (bme280.begin(wxModuleAddress)) { Serial.println("BME280 sensor found"); wxModuleType = 1; wxModuleFound = true; } + /*if (!wxModuleFound) { + if (bme680.begin(wxModuleAddress)) { + Serial.println("BME680 sensor found"); + wxModuleType = 3; + wxModuleFound = true; + }*/ #endif if (!wxModuleFound) { if (bmp280.begin(wxModuleAddress)) { @@ -73,13 +84,6 @@ namespace BME_Utils { wxModuleFound = true; } } - if (!wxModuleFound) { - if (bme680.begin(wxModuleAddress)) { - Serial.println("BME680 sensor found"); - wxModuleType = 3; - wxModuleFound = true; - } - } if (!wxModuleFound) { show_display("ERROR", "", "BME/BMP sensor active", "but no sensor found...", 2000); Serial.println("BME/BMP sensor Active in config but not found! Check Wiring"); @@ -102,13 +106,13 @@ namespace BME_Utils { ); Serial.println("BMP280 Module init done!"); break; - case 3: + /*case 3: bme680.setTemperatureOversampling(BME680_OS_1X); bme680.setHumidityOversampling(BME680_OS_1X); bme680.setPressureOversampling(BME680_OS_1X); bme680.setIIRFilterSize(BME680_FILTER_SIZE_0); Serial.println("BMP680 Module init done!"); - break; + break;*/ } } } @@ -194,7 +198,7 @@ namespace BME_Utils { newPress = (bmp280.readPressure() / 100.0F); newHum = 0; break; - case 3: // BME680 + /*case 3: // BME680 bme680.performReading(); delay(50); if (bme680.endReading()) { @@ -203,7 +207,7 @@ namespace BME_Utils { newHum = bme680.humidity; newGas = bme680.gas_resistance / 1000.0; // in Kilo ohms } - break; + break;*/ } if (isnan(newTemp) || isnan(newHum) || isnan(newPress)) { diff --git a/src/pins_config.h b/src/pins_config.h index 1c0bd2a..a59f260 100644 --- a/src/pins_config.h +++ b/src/pins_config.h @@ -148,6 +148,8 @@ #define BATTERY_PIN 1 #define VEXT_CTRL 36 #define ADC_CTRL 37 + #define BOARD_I2C_SDA 41 + #define BOARD_I2C_SCL 42 #endif #if defined(ESP32_DIY_LoRa) || defined(ESP32_DIY_1W_LoRa) diff --git a/src/power_utils.cpp b/src/power_utils.cpp index 3cfb70f..7c9604f 100644 --- a/src/power_utils.cpp +++ b/src/power_utils.cpp @@ -145,6 +145,10 @@ namespace POWER_Utils { #ifdef HELTEC_WIRELESS_TRACKER Wire.begin(BOARD_I2C_SDA, BOARD_I2C_SCL); #endif + + #ifdef HELTEC_V3_GPS + Wire1.begin(BOARD_I2C_SDA, BOARD_I2C_SCL); + #endif delay(1000); }