From 9110ae3589e9fa89d3ec85de4074f967638aac1d Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Thu, 18 Feb 2021 00:25:45 +0100 Subject: [PATCH 1/4] Add teleinfo module --- WifiControlSensor/MQTT.h | 2 ++ WifiControlSensor/WifiControlSensor.ino | 17 +++++++++++++---- WifiControlSensor/config.h | 9 +++++++++ WifiControlSensor/config_device.h | 4 +++- WifiControlSensor/debug_sketch.h | 12 +++++++----- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/WifiControlSensor/MQTT.h b/WifiControlSensor/MQTT.h index d2ff014..18c9856 100644 --- a/WifiControlSensor/MQTT.h +++ b/WifiControlSensor/MQTT.h @@ -18,6 +18,8 @@ #define BME680_ALT_FEED_FORMAT "/feeds/%s/%s/bme680/alt" #define BME680_IAQ_FEED_FORMAT "/feeds/%s/%s/bme680/iaq" #define BME680_IAQ_ACC_FEED_FORMAT "/feeds/%s/%s/bme680/iaqAcc" +#define TELEINFO_IINST_FEED_FORMAT "/feeds/%s/%s/teleinfo/iinst" +#define TELEINFO_PAPP_FEED_FORMAT "/feeds/%s/%s/teleinfo/papp" #ifndef CONFIG_DISABLE_MQTT #include "Adafruit_MQTT.h" diff --git a/WifiControlSensor/WifiControlSensor.ino b/WifiControlSensor/WifiControlSensor.ino index 52496bd..7cf7b31 100644 --- a/WifiControlSensor/WifiControlSensor.ino +++ b/WifiControlSensor/WifiControlSensor.ino @@ -51,6 +51,7 @@ #include "Adafruit_MQTT.h" #include "Adafruit_MQTT_Client.h" #include "EEPROM.h" +#include "Teleinfo.h" extern "C" { #include @@ -68,7 +69,7 @@ float bme680BSECT, bme680BSECP, bme680BSECH, bme680BSECIaq, bme680BSECIaqAcc; int dryness; uint8_t mode; int reconfig = 0; -productConfig conf = {BOOTMODE_SETUP, "", "", "", "", "", "", 1883, 0, 0, 0, 0, 0, 0, 0, ""}; +productConfig conf = {BOOTMODE_SETUP, NULL, NULL, NULL, NULL, NULL, NULL, 1883, 0, 0, 0, 0, 0, 0, 0, NULL}; // Should have less that MAXSUBSCRIPTIONS elements // MAXSUBSCRIPTIONS is defined is Adafruit_mqtt.h const int gpioControlled[] = CONFIG_CONTROLLED_GPIO; @@ -229,12 +230,16 @@ void setup() { SKETCH_DEBUG_PRINTLN(); // Get GPIO 3 Status +#if CONFIG_SERIAL_SHOULD_SWAP + SKETCH_DEBUG_PRINTLN("SWAP UART"); Serial.swap(); //Switch Serial on GPIO 13 & 15 +#endif pinMode(CONFIG_SETUP_GPIO, INPUT_PULLUP); int txStatus = digitalRead(CONFIG_SETUP_GPIO); -#ifndef CONFIG_ENABLE_EXTRA_GPIO - Serial.swap(); // Switch back on GPIO 1 & 3 -#endif +//#if !defined(CONFIG_ENABLE_EXTRA_GPIO) && CONFIG_SERIAL_SHOULD_SWAP +// Serial.swap(); // Switch back on GPIO 1 & 3 +// SKETCH_DEBUG_PRINTLN("SWAP UART"); +//#endif EEPROM.begin(CONFIG_EEPROM_SIZE); EepromReadConfig(conf); @@ -283,6 +288,9 @@ void setup() { if(!BME680BSECSetup()){ SKETCH_DEBUG_PRINTLN("BME680 with BSEC init success"); } + if(!TeleinfoSetup()){ + SKETCH_DEBUG_PRINTLN("Teleinfo init success"); + } WebSetupServer(mode); } #ifdef CONFIG_ENABLE_POWER_SAVE @@ -360,5 +368,6 @@ void loop() { MqttBatchPublish(batchInfo, conf.mqttUser, conf.host); nbCycle = 0; } + TeleinfoProcess(); } } diff --git a/WifiControlSensor/config.h b/WifiControlSensor/config.h index fcd13a9..5ac590d 100644 --- a/WifiControlSensor/config.h +++ b/WifiControlSensor/config.h @@ -39,6 +39,11 @@ #define CONFIG_DHT_PIN 0 #endif +#if defined(CONFIG_ENABLE_TELEINFO) +#warning "TELEINFO is using SERIAL for communication. Debug will be on Serial1 (D4)" +#define DEBUG_PRINTER_WIFICONTROLSENSOR Serial1 +#endif + #ifndef CONFIG_DRY_POWER_PIN #define CONFIG_DRY_POWER_PIN -1 #endif @@ -70,3 +75,7 @@ #ifndef CONFIG_DHT_TYPE #define CONFIG_DHT_TYPE DHT11 #endif + +#if CONFIG_SETUP_GPIO == 3 || CONFIG_SETUP_GPIO == 1 +#define CONFIG_SERIAL_SHOULD_SWAP +#endif diff --git a/WifiControlSensor/config_device.h b/WifiControlSensor/config_device.h index 2651a36..af35e47 100644 --- a/WifiControlSensor/config_device.h +++ b/WifiControlSensor/config_device.h @@ -44,6 +44,8 @@ // Long press on this button will put device in setup mode at runtime #define CONFIG_SETUP_BUTTON 0 +// Teleinfo https://github.com/hallard/LibTeleinfo/ +#define CONFIG_ENABLE_TELEINFO /* DEFAULT VALUE ALSO DEFINED IN CONFIG.H */ //If this GPIO is LOW at boot, device will enter setup mode @@ -53,7 +55,7 @@ //#define CONFIG_WEB_DELAY_MS 100 // Get sensors value every X ms -#define CONFIG_SAMPLING_PERIODE_MS 3000 +#define CONFIG_SAMPLING_PERIODE_MS 30000 // Name of the SSID when in AP mode for configuration #define CONFIG_SSID_NAME "ESPConfiguratorBureau" diff --git a/WifiControlSensor/debug_sketch.h b/WifiControlSensor/debug_sketch.h index 10b6f21..75ffb4c 100644 --- a/WifiControlSensor/debug_sketch.h +++ b/WifiControlSensor/debug_sketch.h @@ -2,13 +2,15 @@ //#define CONFIG_SKETCH_DEBUG // Set where debug messages will be printed. -#define DEBUG_PRINTER Serial +#ifndef DEBUG_PRINTER_WIFICONTROLSENSOR +#define DEBUG_PRINTER_WIFICONTROLSENSOR Serial +#endif #ifdef CONFIG_SKETCH_DEBUG - #define SKETCH_DEBUG_INIT(speed){ DEBUG_PRINTER.begin(speed); } - #define SKETCH_DEBUG_PRINT(...) { DEBUG_PRINTER.print(__VA_ARGS__); } - #define SKETCH_DEBUG_PRINTF(...) { DEBUG_PRINTER.printf(__VA_ARGS__); } - #define SKETCH_DEBUG_PRINTLN(...) { DEBUG_PRINTER.println(__VA_ARGS__); } + #define SKETCH_DEBUG_INIT(speed){ DEBUG_PRINTER_WIFICONTROLSENSOR.begin(speed); } + #define SKETCH_DEBUG_PRINT(...) { DEBUG_PRINTER_WIFICONTROLSENSOR.print(__VA_ARGS__); } + #define SKETCH_DEBUG_PRINTF(...) { DEBUG_PRINTER_WIFICONTROLSENSOR.printf(__VA_ARGS__); } + #define SKETCH_DEBUG_PRINTLN(...) { DEBUG_PRINTER_WIFICONTROLSENSOR.println(__VA_ARGS__); } #else #define SKETCH_DEBUG_INIT(speed) #define SKETCH_DEBUG_PRINT(...) {} From 8fed8bedf4c2931afa1807d01678416e1530e81a Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Thu, 18 Feb 2021 15:51:49 +0100 Subject: [PATCH 2/4] Add missing files --- WifiControlSensor/Teleinfo.h | 19 ++++++++++++++ WifiControlSensor/Teleinfo.ino | 47 ++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 WifiControlSensor/Teleinfo.h create mode 100644 WifiControlSensor/Teleinfo.ino diff --git a/WifiControlSensor/Teleinfo.h b/WifiControlSensor/Teleinfo.h new file mode 100644 index 0000000..542ae17 --- /dev/null +++ b/WifiControlSensor/Teleinfo.h @@ -0,0 +1,19 @@ +#pragma once +#include "debug_sketch.h" + +#ifdef CONFIG_ENABLE_TELEINFO +#include +int TeleinfoSetup(); +int TeleinfoProcess(); +#else +typedef struct _ValueList { +} ValueList; +int TeleinfoSetup() { + SKETCH_DEBUG_PRINTLN("Teleinfo is disabled at build time"); + return -1; +}; + +int TeleinfoProcess(){ + return 0; +}; +#endif diff --git a/WifiControlSensor/Teleinfo.ino b/WifiControlSensor/Teleinfo.ino new file mode 100644 index 0000000..37e08d1 --- /dev/null +++ b/WifiControlSensor/Teleinfo.ino @@ -0,0 +1,47 @@ +#ifdef CONFIG_ENABLE_TELEINFO +#include "Teleinfo.h" +#include + +TInfo tinfo; +void onNewFrame(ValueList *me) +{ + SKETCH_DEBUG_PRINTLN("New Frame available"); +} + +int TeleinfoSetup() { + Serial.begin(1200, SERIAL_7E1); + + tinfo.init(); + tinfo.attachNewFrame(onNewFrame); + + + return 0; +} + +int TeleinfoProcess() { + int c; + + while ((c = Serial.read()) >= 0) { + SKETCH_DEBUG_PRINTF("Got char %c\n", (char)c); + tinfo.process(c); + } + ValueList * me = tinfo.getList(); + std::vector batchInfo; + while (me) { + SKETCH_DEBUG_PRINTF("info %s\n", me->name); + if (strcmp(me->name, "IINST") == 0) { + float val = atof(me->value); + batchInfo.push_back({val, TELEINFO_IINST_FEED_FORMAT, 0, 0}); + } + if (strcmp(me->name, "PAPP") == 0) { + float val = atof(me->value); + batchInfo.push_back({val, TELEINFO_PAPP_FEED_FORMAT, 0, 0}); + } + me = me->next; + } + if (mode == BOOTMODE_NORMAL) + MqttBatchPublish(batchInfo, conf.mqttUser, conf.host); + + return 0; +} +#endif From 8f471fc0bf148f2e60001ca9609b83bbdbc87f99 Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Thu, 18 Feb 2021 23:50:54 +0100 Subject: [PATCH 3/4] WIP: working teleinfo --- WifiControlSensor/MQTT.h | 1 + WifiControlSensor/Teleinfo.h | 6 ++++-- WifiControlSensor/Teleinfo.ino | 25 +++++++++++++++---------- WifiControlSensor/WifiControlSensor.ino | 12 ++++++------ 4 files changed, 26 insertions(+), 18 deletions(-) diff --git a/WifiControlSensor/MQTT.h b/WifiControlSensor/MQTT.h index 18c9856..ff56b21 100644 --- a/WifiControlSensor/MQTT.h +++ b/WifiControlSensor/MQTT.h @@ -20,6 +20,7 @@ #define BME680_IAQ_ACC_FEED_FORMAT "/feeds/%s/%s/bme680/iaqAcc" #define TELEINFO_IINST_FEED_FORMAT "/feeds/%s/%s/teleinfo/iinst" #define TELEINFO_PAPP_FEED_FORMAT "/feeds/%s/%s/teleinfo/papp" +#define TELEINFO_BASE_FEED_FORMAT "/feeds/%s/%s/teleinfo/base" #ifndef CONFIG_DISABLE_MQTT #include "Adafruit_MQTT.h" diff --git a/WifiControlSensor/Teleinfo.h b/WifiControlSensor/Teleinfo.h index 542ae17..3931f23 100644 --- a/WifiControlSensor/Teleinfo.h +++ b/WifiControlSensor/Teleinfo.h @@ -4,7 +4,8 @@ #ifdef CONFIG_ENABLE_TELEINFO #include int TeleinfoSetup(); -int TeleinfoProcess(); +//int TeleinfoProcess(); +int TeleinfoProcess(std::vector &batchInfo); #else typedef struct _ValueList { } ValueList; @@ -13,7 +14,8 @@ int TeleinfoSetup() { return -1; }; -int TeleinfoProcess(){ +//int TeleinfoProcess(){ +int TeleinfoProcess(std::vector &){ return 0; }; #endif diff --git a/WifiControlSensor/Teleinfo.ino b/WifiControlSensor/Teleinfo.ino index 37e08d1..4a7cf20 100644 --- a/WifiControlSensor/Teleinfo.ino +++ b/WifiControlSensor/Teleinfo.ino @@ -8,27 +8,28 @@ void onNewFrame(ValueList *me) SKETCH_DEBUG_PRINTLN("New Frame available"); } -int TeleinfoSetup() { - Serial.begin(1200, SERIAL_7E1); +int TeleinfoSetup() +{ + Serial.begin(1200, SERIAL_7E1); tinfo.init(); tinfo.attachNewFrame(onNewFrame); - return 0; } -int TeleinfoProcess() { +int TeleinfoProcess(std::vector &batchInfo) +{ int c; while ((c = Serial.read()) >= 0) { - SKETCH_DEBUG_PRINTF("Got char %c\n", (char)c); tinfo.process(c); } - ValueList * me = tinfo.getList(); - std::vector batchInfo; + ValueList *me = tinfo.getList(); + //std::vector batchInfo; + if (me) + me = me->next; while (me) { - SKETCH_DEBUG_PRINTF("info %s\n", me->name); if (strcmp(me->name, "IINST") == 0) { float val = atof(me->value); batchInfo.push_back({val, TELEINFO_IINST_FEED_FORMAT, 0, 0}); @@ -37,10 +38,14 @@ int TeleinfoProcess() { float val = atof(me->value); batchInfo.push_back({val, TELEINFO_PAPP_FEED_FORMAT, 0, 0}); } + if (strcmp(me->name, "BASE") == 0) { + float val = atof(me->value); + batchInfo.push_back({val, TELEINFO_BASE_FEED_FORMAT, 0, 0}); + } me = me->next; } - if (mode == BOOTMODE_NORMAL) - MqttBatchPublish(batchInfo, conf.mqttUser, conf.host); + //if (mode == BOOTMODE_NORMAL) + // MqttBatchPublish(batchInfo, conf.mqttUser, conf.host); return 0; } diff --git a/WifiControlSensor/WifiControlSensor.ino b/WifiControlSensor/WifiControlSensor.ino index 7cf7b31..4efb40d 100644 --- a/WifiControlSensor/WifiControlSensor.ino +++ b/WifiControlSensor/WifiControlSensor.ino @@ -230,10 +230,10 @@ void setup() { SKETCH_DEBUG_PRINTLN(); // Get GPIO 3 Status -#if CONFIG_SERIAL_SHOULD_SWAP - SKETCH_DEBUG_PRINTLN("SWAP UART"); - Serial.swap(); //Switch Serial on GPIO 13 & 15 -#endif +//#if CONFIG_SERIAL_SHOULD_SWAP +// SKETCH_DEBUG_PRINTLN("SWAP UART"); +// Serial.swap(); //Switch Serial on GPIO 13 & 15 +//#endif pinMode(CONFIG_SETUP_GPIO, INPUT_PULLUP); int txStatus = digitalRead(CONFIG_SETUP_GPIO); //#if !defined(CONFIG_ENABLE_EXTRA_GPIO) && CONFIG_SERIAL_SHOULD_SWAP @@ -363,11 +363,11 @@ void loop() { batchInfo.push_back({bme680BSECIaq, BME680_IAQ_FEED_FORMAT, 0, 0}); batchInfo.push_back({bme680BSECIaqAcc, BME680_IAQ_ACC_FEED_FORMAT, 0, 0}); } - + TeleinfoProcess(batchInfo); if (mode == BOOTMODE_NORMAL) MqttBatchPublish(batchInfo, conf.mqttUser, conf.host); nbCycle = 0; } - TeleinfoProcess(); + } } From 1b52a80b151dc6847d3cc467323e65f2cbccc62a Mon Sep 17 00:00:00 2001 From: Mathieu Maret Date: Sat, 10 Sep 2022 21:53:06 +0200 Subject: [PATCH 4/4] Fix teleinfo configuration --- WifiControlSensor/Teleinfo.h | 10 +++---- WifiControlSensor/Teleinfo.ino | 40 ++++++++++++++++++------- WifiControlSensor/WifiControlSensor.ino | 22 +++++++------- WifiControlSensor/config.h | 18 +++++++---- WifiControlSensor/config_device.h | 2 +- 5 files changed, 58 insertions(+), 34 deletions(-) diff --git a/WifiControlSensor/Teleinfo.h b/WifiControlSensor/Teleinfo.h index 3931f23..576635f 100644 --- a/WifiControlSensor/Teleinfo.h +++ b/WifiControlSensor/Teleinfo.h @@ -4,18 +4,18 @@ #ifdef CONFIG_ENABLE_TELEINFO #include int TeleinfoSetup(); -//int TeleinfoProcess(); int TeleinfoProcess(std::vector &batchInfo); +int TeleinfoProcess(float &iinst, float &papp, float &base); #else -typedef struct _ValueList { -} ValueList; int TeleinfoSetup() { SKETCH_DEBUG_PRINTLN("Teleinfo is disabled at build time"); return -1; }; -//int TeleinfoProcess(){ -int TeleinfoProcess(std::vector &){ +inline int TeleinfoProcess(std::vector &){ + return 0; +}; +int TeleinfoProcess(float &iinst, float &papp, float &base){ return 0; }; #endif diff --git a/WifiControlSensor/Teleinfo.ino b/WifiControlSensor/Teleinfo.ino index 4a7cf20..ce0439a 100644 --- a/WifiControlSensor/Teleinfo.ino +++ b/WifiControlSensor/Teleinfo.ino @@ -1,19 +1,14 @@ #ifdef CONFIG_ENABLE_TELEINFO #include "Teleinfo.h" #include - +#define TELESerial Serial TInfo tinfo; -void onNewFrame(ValueList *me) -{ - SKETCH_DEBUG_PRINTLN("New Frame available"); -} int TeleinfoSetup() { - Serial.begin(1200, SERIAL_7E1); + TELESerial.begin(1200, SERIAL_7E1); tinfo.init(); - tinfo.attachNewFrame(onNewFrame); return 0; } @@ -22,11 +17,10 @@ int TeleinfoProcess(std::vector &batchInfo) { int c; - while ((c = Serial.read()) >= 0) { + while ((c = TELESerial.read()) >= 0) { tinfo.process(c); } ValueList *me = tinfo.getList(); - //std::vector batchInfo; if (me) me = me->next; while (me) { @@ -44,8 +38,32 @@ int TeleinfoProcess(std::vector &batchInfo) } me = me->next; } - //if (mode == BOOTMODE_NORMAL) - // MqttBatchPublish(batchInfo, conf.mqttUser, conf.host); + + return 0; +} + +int TeleinfoProcess(float &iinst, float &papp, float &base ) +{ + int c; + + while ((c = TELESerial.read()) >= 0) { + tinfo.process(c); + } + ValueList *me = tinfo.getList(); + if (me) + me = me->next; + while (me) { + if (strcmp(me->name, "IINST") == 0) { + iinst = atof(me->value); + } + if (strcmp(me->name, "PAPP") == 0) { + papp = atof(me->value); + } + if (strcmp(me->name, "BASE") == 0) { + base = atof(me->value); + } + me = me->next; + } return 0; } diff --git a/WifiControlSensor/WifiControlSensor.ino b/WifiControlSensor/WifiControlSensor.ino index 4efb40d..5a8817f 100644 --- a/WifiControlSensor/WifiControlSensor.ino +++ b/WifiControlSensor/WifiControlSensor.ino @@ -219,7 +219,8 @@ void OTASetup() { #endif } -void setup() { +void setup() +{ #ifdef CONFIG_SETUP_BUTTON new HIB(CONFIG_SETUP_BUTTON, HIGH, NULL, NULL, onLongButtonPressed); #endif @@ -230,16 +231,16 @@ void setup() { SKETCH_DEBUG_PRINTLN(); // Get GPIO 3 Status -//#if CONFIG_SERIAL_SHOULD_SWAP -// SKETCH_DEBUG_PRINTLN("SWAP UART"); -// Serial.swap(); //Switch Serial on GPIO 13 & 15 -//#endif +#if CONFIG_SERIAL_SHOULD_SWAP + SKETCH_DEBUG_PRINTLN("SWAP UART"); + Serial.swap(); // Switch Serial on GPIO 13 & 15 +#endif pinMode(CONFIG_SETUP_GPIO, INPUT_PULLUP); int txStatus = digitalRead(CONFIG_SETUP_GPIO); -//#if !defined(CONFIG_ENABLE_EXTRA_GPIO) && CONFIG_SERIAL_SHOULD_SWAP -// Serial.swap(); // Switch back on GPIO 1 & 3 -// SKETCH_DEBUG_PRINTLN("SWAP UART"); -//#endif +#if !defined(CONFIG_ENABLE_EXTRA_GPIO) && CONFIG_SERIAL_SHOULD_SWAP + Serial.swap(); // Switch back on GPIO 1 & 3 + SKETCH_DEBUG_PRINTLN("SWAP UART"); +#endif EEPROM.begin(CONFIG_EEPROM_SIZE); EepromReadConfig(conf); @@ -363,11 +364,10 @@ void loop() { batchInfo.push_back({bme680BSECIaq, BME680_IAQ_FEED_FORMAT, 0, 0}); batchInfo.push_back({bme680BSECIaqAcc, BME680_IAQ_ACC_FEED_FORMAT, 0, 0}); } - TeleinfoProcess(batchInfo); + TeleinfoProcess(batchInfo); if (mode == BOOTMODE_NORMAL) MqttBatchPublish(batchInfo, conf.mqttUser, conf.host); nbCycle = 0; } - } } diff --git a/WifiControlSensor/config.h b/WifiControlSensor/config.h index 5ac590d..5132ef1 100644 --- a/WifiControlSensor/config.h +++ b/WifiControlSensor/config.h @@ -39,11 +39,6 @@ #define CONFIG_DHT_PIN 0 #endif -#if defined(CONFIG_ENABLE_TELEINFO) -#warning "TELEINFO is using SERIAL for communication. Debug will be on Serial1 (D4)" -#define DEBUG_PRINTER_WIFICONTROLSENSOR Serial1 -#endif - #ifndef CONFIG_DRY_POWER_PIN #define CONFIG_DRY_POWER_PIN -1 #endif @@ -69,7 +64,7 @@ #endif #ifndef CONFIG_SETUP_GPIO -#define CONFIG_SETUP_GPIO 3 +#define CONFIG_SETUP_GPIO 14 #endif #ifndef CONFIG_DHT_TYPE @@ -79,3 +74,14 @@ #if CONFIG_SETUP_GPIO == 3 || CONFIG_SETUP_GPIO == 1 #define CONFIG_SERIAL_SHOULD_SWAP #endif + +#if defined(CONFIG_ENABLE_TELEINFO) +#warning "TELEINFO is using SERIAL for communication. Debug will be on Serial1 (D4)" +#define DEBUG_PRINTER_WIFICONTROLSENSOR Serial1 +#if defined(CONFIG_SERIAL_SHOULD_SWAP) +#error "When enabling TELEINFO, SERIAL_SHOULD_SWAP cannot be enabled (SETUP_GPIO == 1 or 3)" +#endif +#if defined(CONFIG_ENABLE_EXTRA_GPIO) +#error "When enabling TELEINFO, ENABLE_EXTRA_CPIO cannot be enabled" +#endif +#endif diff --git a/WifiControlSensor/config_device.h b/WifiControlSensor/config_device.h index af35e47..c9a60ba 100644 --- a/WifiControlSensor/config_device.h +++ b/WifiControlSensor/config_device.h @@ -15,7 +15,7 @@ // Enable the temperature, pressure, humidity and gaz Sensor BME680 on standard i2c esp8266 pins // It use default i2c pin GPIO4(D2): SDA, GPIO5(D1):SCL // Should be powered by 3.3v and sampled every 3sec or 300s (Or you should adapt bsec_config_iaq in BME680_BSEC.ino ) -#define CONFIG_BME680_BSEC_ENABLE +//#define CONFIG_BME680_BSEC_ENABLE #define CONFIG_BME680_BSEC_I2C_ADDR 0x77 // Enable the temperature, pressure, humidity and gaz Sensor BME680 on standard i2c esp8266 pins