         only allow to enter either one, if both detected, only use the Blynk
 8. v2.3 Add Double Reset Detector - to detect double press on reset button and wipe the wifi settings
 9. v2.4 Define wake up interval - to save battery, default 10 mins, during wifi setup
-
+10. v2.5 replace DoubleResetDetector with ESP_DoubleResetDetector (bug randomly caused wifi settings disappeared)
 
 Todo
-* Option to specify option to enable (Y/N) during wifi setup
+* Option to specify option to enable (Y/N) DHT22, UV sensor during wifi setup
 * add OTA update function
 */
 ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include <farmerkeith_BMP280.h> // library, download from https://github.com/farmerkeith/BMP280-library
#include <ArduinoJson.h>          //https://github.com/bblanchon/ArduinoJson
#include <BlynkSimpleEsp8266.h>
#include <DoubleResetDetector.h>

// configuration constants
const bool bme280Debug = 0; // controls serial printing

  wifiManager.setAPCallback(configModeCallback);

  //timeout - this will quit WiFiManager if it's not configured in 3 minutes, causing a restart
  wifiManager.setConfigPortalTimeout(60);

  if (!wifiManager.autoConnect("Weather Station", "configme")) {
    Serial.println("failed to connect and hit timeout");
    ESP.deepSleep(Sleep_Time * 60 * 1000000); //deepSleep is microseconds 1 sec = 1000000
    delay(100);    
//    ESP.reset();
//    delay(1000);
  }

  Serial.println("Wifi Connected");
