 #define ADAFRUIT_CC3000_VBAT  5
 #define ADAFRUIT_CC3000_CS    10
 
-#define IDLE_TIMEOUT_MS  3000
+#define IDLE_TIMEOUT_MS       2000
 
 Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT, SPI_CLOCK_DIVIDER);
 Adafruit_CC3000_Client client;
 
-SoftwareSerial data_port(6, 7);
 unsigned long lastWebUpdateTime = 0;
 char eagle_data[81];
 uint8_t data_index = 0;
 
 
 void setup () {
-  Serial.begin(115200);
+  Serial.begin(2400);
   Serial.println(F("\nWater Heater Monitor"));
 
   // CC3000 setup
-  Serial.print(F("initializing network... "));
+  Serial.print(F("Initializing network... "));
   if (!cc3000.begin()) {
-    Serial.println(F("unable to initialise the CC3000! Check your wiring?"));
+    Serial.println(F("unable to initialise the CC3000!"));
     while(1);
   }
   if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {

  Serial.println(F("wireless connection successful."));

  while (!cc3000.checkDHCP()) {
    delay(100); // TODO: Insert a DHCP timeout!
  }

  uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;
  if(!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv)) {
    Serial.println(F("Unable to retrieve network info!"));
  } else {
    Serial.print(F("  IP Addr: ")); cc3000.printIPdotsRev(ipAddress);
    Serial.print(F("/"));           cc3000.printIPdotsRev(netmask);   Serial.println();
    Serial.print(F("  Gateway: ")); cc3000.printIPdotsRev(gateway);   Serial.println();
    Serial.print(F("  DHCPsrv: ")); cc3000.printIPdotsRev(dhcpserv);  Serial.println();
    Serial.print(F("  DNSserv: ")); cc3000.printIPdotsRev(dnsserv);   Serial.println();
  }

  initThermometer();

  // Data port setup
  data_port.begin(2400);

  Serial.println(F("Waiting for data..."));
}


  // If we haven't updated in 5 minutes, send along a "PING" to keep showing something.
  if (now > lastWebUpdateTime + 300000 || now < lastWebUpdateTime) {
    //strcpy(eagle_data, "0.05  120.0  110.0  12.0  159.0  100.0  110.0  ON  OFF  ");
    //updateWeb();

    data_index = 0;
    eagle_data[data_index] = '\0';
    updateWeb();
  }
}


void serialEvent() {
  while (Serial.available()) {
    char c = Serial.read();
    if (c) UDR0 = c;

    // Assume a LF is the end of the line
    if (c == '\n' && strlen(eagle_data) > 0) {
      // Update once per minute
      // Also, don't send any Eagle header messages we come across.
      unsigned long now = millis();

      if ((now > lastWebUpdateTime + 60000 || now < lastWebUpdateTime) && strncmp(eagle_data, "RUNTIME", 7) != 0) {
        updateWeb();
      }
