 void postSensorData(monitor_t *monitorData);
 void printMonitorEntry(monitor_t m, String* buf);
 void formatMonitorEntry(monitor_t *m, String* buf, bool JSON);
+
+/////////////////////////////////////////////////////////////////////////////
+// misc utils ///////////////////////////////////////////////////////////////
+void ledOn();
+void ledOff();
+String ip2str(IPAddress address);
+#define dbg(b, s) if(b) Serial.print(s)
+#define dln(b, s) if(b) Serial.println(s)
+#define valveDBG true
+#define monitorDBG false
+#define netDBG false
+#define miscDBG false
 
 /////////////////////////////////////////////////////////////////////////////
 // temperature sensor stuff /////////////////////////////////////////////////


  // try and set the host name
  if(WiFi.hostname("waterelf"))
    Serial.println("set hostname succeeded");
  else
    Serial.println("set hostname failed");
  delay(300); blink(3);         // signal we've finished config
}


void handle_valve2() { handle_valve(1); } // ...numbered from 1, but...
void handle_valve3() { handle_valve(2); } // ...from 0 in the FlowController
void handle_valve(int valveNum) {
  dbg(valveDBG, "serving page at /valve");
  dln(valveDBG, valveNum + 1);
  String toSend = pageTop;
  toSend += ": Setting Water Valve ";
  toSend += valveNum + 1;
