   }
   else {
     client.stop();
-    Serial.println("CONNECTION PROBLEM");
     canConnect = false;
   }
   lastConnectionTime=millis();

#include <stdio.h>
#include <SPI.h>
#include <WiFi.h>
#include <SPI.h>
#include <WiFiUdp.h>
#include <Time.h>


// private info [made generic here]
char ssid[] = "SSID";

    digitalWrite(greenLed, LOW);
    digitalWrite(redLed, HIGH);
  }
  if(canConnect != canConnect_prev) {
    time_to_string(now(), time_as_string);
    logfile.print(time_as_string);
    logfile.print(" - ");
    if(canConnect) logfile.println("connected.");
    else logfile.println("NOT CONNECTED!");
    logfile.flush();

    canConnect_prev = canConnect;
  }
}

void connect_to_server(void) {
  if (client.connect(server, 80)) {
    canConnect = true;
    client.println("GET /search?q=arduino HTTP/1.1");
    client.println("Host: www.google.com");
    client.println("Connection: close");
