 void updateSensorData(monitor_t *monitorData);
 void postSensorData(monitor_t *monitorData);
 void printMonitorEntry(monitor_t m, String* buf);
+void jsonMonitorEntry(monitor_t *m, String* buf);
 
 /////////////////////////////////////////////////////////////////////////////
 // temperature sensor stuff /////////////////////////////////////////////////

  if(loopCounter == TICK_HEAP_DEBUG) {
    Serial.print("free heap="); Serial.println(ESP.getFreeHeap());
  }


  if(loopCounter == TICK_POST_DEBUG) {
    // create a JSON form and ping 192.168.1.151:5984

IPAddress couchServer(10,0,0,24);
WiFiClient couchClient;
Serial.print("couchServer: ");
Serial.println(ip2str(couchServer));

    if(googleClient.connect(googleServer, 80)) {
      Serial.println("connected to google server");
      googleClient.stop();
    } 
    if(couchClient.connect(couchServer, 5984)) {
      Serial.println("connected to server");
      couchClient.println("POST /fishydata HTTP/1.1");
      couchClient.println("Content-Type: application/json");
      couchClient.println("Connection: close");
      couchClient.println();
      couchClient.println("{ \"key\": \"value\" }");
    } else {
      Serial.println("no couch server");
    }
    // couchClient.stop();
  }
  delay(100); // TODO
  blink(4);
  delay(100);

  loopCounter++;
}

ESP8266WebServer webServer(80);
String apSSIDStr = "WaterElf-" + String(ESP.getChipId());
const char* apSSID = apSSIDStr.c_str();

/////////////////////////////////////////////////////////////////////////////
// page generation stuff ////////////////////////////////////////////////////
