     Serial.println(F("Done."));
   } else {
     Serial.println(F("Web server connection failed."));
+    if (!cc3000.checkConnected()) {
+      Serial.println(F("Wifi appears down, attempting to reconnect..."));
+      reconnectToAP();
+    }
   }
 }

}


void updateWeb() {
  Serial.println(F("Sending data..."));


    Serial.println(F("unable to initialise the CC3000!"));
    while(1);
  }

  reconnectToAP();

  uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;
  if (!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv)) {
