         // trigger timer before we try again
         //startWifiConnectTimer();
 
-        // Sleep for 1 minute
-        ESP.deepSleep(60000000);
+        // Serial.println("Simulating deep sleep, identified network but couldn't connect");
+        // delay(5000);
+        // ESP.restart();
+        // Serial.println("Shouldn't have gotten here");
+
+        // Sleep for 5 minute
+        Serial.println("startWiFi:Deep sleeping (couldn't connect to identified network)");
+        ESP.deepSleep(300000000);
       }
     } else {
       // Couldn't find a known network to connect to

    }
    i++;
  }
  return false;
}


      // trigger timer before we try again
      //startWifiConnectTimer();

      // Serial.println("Simulating deep sleep, couldn't find known network");
      // delay(5000);
      // ESP.restart();
      // Serial.println("Shouldn't have gotten here");

      // Sleep for 5 minute
      Serial.println("startWiFi:Deep sleeping (couldn't find known network)");
      ESP.deepSleep(300000000);

    }
  } else {
    // We are connected to a network
    // Only if we were waiting for wifi do these
    // otherwise just carry on
    // if (isWaitingForWiFi == true) {
    //   isWaitingForWiFi = false;
    //   configureOTA();
    //   //startSensorTimer();
    //
    // }
  }
}

