     monitorCursor = 0;
 }
 void postSensorData(monitor_t *monitorData) {
-  // create a JSON form and ping 
-  // 192.168.1.151:5984
   Serial.println("postSensorData");
 
-  if(googleClient.connect(googleServer, 80)) {
-    Serial.println("connected to google server");
-    googleClient.stop();
-  } 
+  // create a JSON form
+  String jsonBuf = "";
+  jsonMonitorEntry(monitorData, &jsonBuf);
+  String envelope = "POST /fishydata HTTP/1.1\n";
+  envelope += "Content-Type: application/json\n";
+  envelope += "Content-Length: " ;
+  envelope += jsonBuf.length();
+  envelope += "\nConnection: close\n\n";
+  envelope += jsonBuf;
+  Serial.println(envelope);
+
+  IPAddress couchServer(10,0,0,24);
+  WiFiClient couchClient;
+  Serial.print("couchServer: ");
+  Serial.println(ip2str(couchServer));
+
   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\" }");
+    Serial.println("connected to couch server");
+    couchClient.print(envelope);
   } else {
     Serial.println("no couch server");
   }
-
-  couchClient.stop();
+  // couchClient.stop();
+
   return;
 }
+void jsonMonitorEntry(monitor_t *m, String* buf) {
+  buf->concat("{ ");
+  buf->concat("\"timestamp\": ");
+  buf->concat(m->timestamp);
+  if(GOT_TEMP_SENSOR){
+    buf->concat(", ");
+    buf->concat("\"waterTemp\": ");
+    buf->concat(m->waterCelsius);
+  }
+  if(GOT_HUMID_SENSOR){  
+    buf->concat(", ");
+    buf->concat("\"airTemp\": ");
+    buf->concat(m->airCelsius);
+    buf->concat(", ");
+    buf->concat("\"humidity\": ");
+    buf->concat(m->airHumid);
+  }
+  if(GOT_LIGHT_SENSOR){
+    buf->concat(", ");
+    buf->concat(", \"lux\": ");
+    buf->concat(m->lux);
+  }
+  buf->concat(" }");
+}
 void printMonitorEntry(monitor_t m, String* buf) {
-  buf->concat("timestamp: ");
+  buf->concat("{ ");
+  buf->concat("\"timestamp\": ");
   buf->concat(m.timestamp);
   if(GOT_TEMP_SENSOR){
-  buf->concat(", Water Temp: ");
-  buf->concat(m.waterCelsius);
-  buf->concat(" °C");
+    buf->concat(", Water Temp: ");
+    buf->concat(m.waterCelsius);
+    buf->concat(" °C");
   }
   if(GOT_HUMID_SENSOR){  
-  buf->concat(", Air Temp: ");
-  buf->concat(m.airCelsius);
-  buf->concat(" °C"); 
-  buf->concat(", Humidity: ");
-  buf->concat(m.airHumid);
-  buf->concat(" %RH");
+    buf->concat(", Air Temp: ");
+    buf->concat(m.airCelsius);
+    buf->concat(" °C"); 
+    buf->concat(", Humidity: ");
+    buf->concat(m.airHumid);
+    buf->concat(" %RH");
   }
   if(GOT_LIGHT_SENSOR){
-  buf->concat(", Light: ");
-  buf->concat(m.lux);
-  buf->concat(" lux");
+    buf->concat(", Light: ");
+    buf->concat(m.lux);
+    buf->concat(" lux");
   }
 }
 void getTemperature(float* waterCelsius) {

  pinMode(BUILTIN_LED, OUTPUT);
  blink(3);

//TODO  startPeripherals();

  // TODO don't do this if wifi config'd and connected
  startAP();

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

  loopCounter++;
}
