From 76859e54fefe034ab4f0e2d7a7d7a6705eedd36e Mon Sep 17 00:00:00 2001 From: Florian <1technophile@users.noreply.github.com> Date: Thu, 7 Jun 2018 20:20:11 +0200 Subject: [PATCH] add cleanFS into user config and correct missing rf315 subject subscribe --- OpenMQTTGateway.ino | 10 +++++++--- User_config.h | 3 ++- tests/Test_config.h | 1 + 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/OpenMQTTGateway.ino b/OpenMQTTGateway.ino index 1908b062..f7a7e74a 100644 --- a/OpenMQTTGateway.ino +++ b/OpenMQTTGateway.ino @@ -186,6 +186,9 @@ boolean reconnect() { #ifdef ZgatewayRF client.subscribe(subjectMultiGTWRF); #endif + #ifdef ZgatewayRF315 + client.subscribe(subjectMultiGTWRF315); + #endif #ifdef ZgatewayIR client.subscribe(subjectMultiGTWIR); #endif @@ -395,9 +398,10 @@ void setup_wifi() { #elif defined(ESP8266) && !defined(ESPWifiManualSetup) void setup_wifimanager(boolean reset_settings){ + #ifdef cleanFS //clean FS, for testing //SPIFFS.format(); - + #endif //read configuration from FS json trc("mounting FS..."); @@ -736,7 +740,7 @@ void stateMeasures(){ } #endif -void storeValue(long MQTTvalue){ +void storeValue(unsigned long MQTTvalue){ unsigned long now = millis(); // find oldest value of the buffer int o = getMin(); @@ -768,7 +772,7 @@ int getMin(){ } boolean isAduplicate(unsigned long value){ -trc(F("isAduplicate")); +trc(F("isAduplicate?")); // check if the value has been already sent during the last time_avoid_duplicate for (int i = 0; i < array_size;i++){ if (ReceivedSignal[i][0] == value){ diff --git a/User_config.h b/User_config.h index e85f01a1..6e6390e5 100644 --- a/User_config.h +++ b/User_config.h @@ -52,7 +52,8 @@ char mqtt_port[6] = "1883"; //#define ESPWifiManualSetup true //uncomment you don't want to use wifimanager for your credential settings on ESP #define WifiManager_password "your_password" -//#define MDNS_SD //comment if you don't want to use mdns for discovering automatically your ip server, please note that MDNS with ESP32 can cause the BLE to not work +//#define MDNS_SD //uncomment if you want to use mdns for discovering automatically your ip server, please note that MDNS with ESP32 can cause the BLE to not work +//#define cleanFS //uncomment if you want to clean the ESP memory and reenter your credentials //set minimum quality of signal so it ignores AP's under that quality #define MinimumWifiSignalQuality 8 diff --git a/tests/Test_config.h b/tests/Test_config.h index b5ea7850..3d11d952 100644 --- a/tests/Test_config.h +++ b/tests/Test_config.h @@ -52,6 +52,7 @@ char mqtt_port[6] = "1883"; //#define ESPWifiManualSetup true //uncomment you don't want to use wifimanager for your credential settings on ESP #define WifiManager_password "your_password" //#define MDNS_SD //comment if you don't want to use mdns for discovering automatically your ip server, please note that MDNS with ESP32 can cause the BLE to not work +//#define cleanFS //uncomment if you want to clean the ESP memory and reenter your credentials //set minimum quality of signal so it ignores AP's under that quality #define MinimumWifiSignalQuality 8