BME warning fix

This commit is contained in:
richonguzman
2024-05-08 15:05:43 -04:00
parent 2b6066f62e
commit 983467e059
3 changed files with 10 additions and 4 deletions
+1 -1
View File
@@ -27,7 +27,7 @@
Configuration Config;
WiFiClient espClient;
String versionDate = "2024.05.05";
String versionDate = "2024.05.08";
uint8_t myWiFiAPIndex = 0;
int myWiFiAPSize = Config.wifiAPs.size();
WiFi_AP *currentWiFi = &Config.wifiAPs[myWiFiAPIndex];
+4 -2
View File
@@ -13,6 +13,8 @@ extern uint32_t bmeLastReading;
float newHum, newTemp, newPress, newGas;
bool bmeSensorFound = false;
namespace BME_Utils {
@@ -32,8 +34,7 @@ namespace BME_Utils {
status = bme.begin(0x76); // Don't forget to join pins for righ direction on BME280!
if (!status) {
Serial.println("Could not find a valid BME280 or BMP280 sensor, check wiring!");
show_display("ERROR", "", "BME/BMP sensor active", "but no sensor found...");
while (1); // sacar esto para que quede pegado si no encuentra BME280
show_display("ERROR", "", "BME/BMP sensor active", "but no sensor found...", "", 2000);
} else {
#ifdef BME280Sensor
bme.setSampling(Adafruit_BME280::MODE_FORCED,
@@ -59,6 +60,7 @@ namespace BME_Utils {
bme.setIIRFilterSize(BME680_FILTER_SIZE_0);
Serial.println("init : BME680 Module ... done!");
#endif
bmeSensorFound = true;
}
} else {
Serial.println("(BME/BMP sensor not 'active' in 'igate_conf.json')");
+5 -1
View File
@@ -36,6 +36,7 @@ extern String distance;
extern uint32_t lastWiFiCheck;
extern bool WiFiConnect;
extern bool WiFiConnected;
extern bool bmeSensorFound;
namespace Utils {
@@ -107,10 +108,13 @@ namespace Utils {
activeStations();
if (Config.bme.active) {
if (Config.bme.active && bmeSensorFound) {
String sensorData = BME_Utils::readDataSensor();
beaconPacket += sensorData;
secondaryBeaconPacket += sensorData;
} else if (Config.bme.active && !bmeSensorFound) {
beaconPacket += ".../...g...t...r...p...P...h..b.....BME MODULE NOT FOUND! ";
secondaryBeaconPacket += ".../...g...t...r...p...P...h..b.....BME MODULE NOT FOUND! ";
}
beaconPacket += Config.beacon.comment;
secondaryBeaconPacket += Config.beacon.comment;