       //Connect to blynk using an already-open internet connection and preset configuration
       if(!Blynk.connect()) {
         Serial.println("Blynk connection timed out.");
+//        drd->loop(); //don't trigger double press reset
         ESP.reset();
         delay (100);
       }

        Serial.println("Blynk Connection Fail");
        //needs testing on whether this line should be commented out:
        //wifiManager.resetSettings();
        ESP.reset();
        delay (100);
      }

  //  saveCounter(eventCounter);         // this also puts bme0 to sleep
  bme0.updateF4Control16xSleep(); // use instead of saveCounter if counter is not required

  // Call the double reset detector loop method every so often,
  // so that it can recognise when the timeout expires.
  // You can also call drd.stop() when you wish to no longer
  // consider the next reset as a double reset.
//  drd->loop();
  
  goToSleep();
} // end of void setup()
