 
   toSend += pageFooter;
   dbg(analogDBG, analogSensor); dbg(analogDBG, "\n");
+  webServer.send(200, "text/html", toSend);
+}
+void handle_pHchz() {
+  dln(netDBG, "serving page at /pHchz");
+  String toSend = pageTop;
+  toSend += ": pH sensor configured";
+  toSend += pageTop2;
+
+  for(uint8_t i = 0; i < webServer.args(); i++) {
+    if(webServer.argName(i) == "pHAdd" && webServer.arg(i)!="") {
+      pHAddr = 16*hextoi(webServer.arg(i).charAt(0)) + hextoi(webServer.arg(i).charAt(1));
+      toSend += "<h2>Added pH sensor I2C address...</h2>";
+      toSend += "<p>...of 0x";
+      toSend += webServer.arg(i).substring(0, 2);
+      toSend += "</p>";
+      setpHAddrP(pHAddr);   // persist the config
+      SPIFFS.end(); // because we're gonna reboot and it might help...
+      toSend += "<h3>Now rebooting to use new address...</h3>";
+      toSend += pageFooter;
+      webServer.send(200, "text/html", toSend);
+      delay(20); // just to help webserver stuff clear
+      ESP.restart();
+    }
+    if(webServer.argName(i) == "ph_Cal") {
+      if(webServer.arg(i) == "pH4Cal") {
+        pH4Cal = getpHraw();
+        setpH4CalP(pH4Cal);   // persist the cal value
+        pHStep = ((((vRef*(float)(pH7Cal-pH4Cal))/4096)*1000)/opampGain)/3;
+        setpHStepP(pHStep);   // persist the probe slope
+      } else if(webServer.arg(i) == "pH7Cal") {
+        pH7Cal = getpHraw();
+        setpH7CalP(pH7Cal);   // persist the cal value
+        pHStep = ((((vRef*(float)(pH7Cal-pH4Cal))/4096)*1000)/opampGain)/3;
+        setpHStepP(pHStep);   // persist the probe slope
+      } else if(webServer.arg(i) != "noCal") {
+        dln(netDBG, "unknown cal response!");
+      }
+    }
+  }
+
+  toSend += pageFooter;
   webServer.send(200, "text/html", toSend);
 }
 void handle_actuate() {

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 startupDBG true
#define valveDBG false
#define monitorDBG false
#define netDBG true
#define miscDBG false
#define citsciDBG false
#define analogDBG true

/////////////////////////////////////////////////////////////////////////////
// temperature sensor stuff /////////////////////////////////////////////////

  f += pageFooter;
  return f;
}
String genpHConfForm() {
  String f = pageTop;
  f += ": pH Sensor Config & Calibration";
  f += pageTop2;
  f += "<h2>Configure & Calibrate pH Sensor</h2><p>\n";
  
  f += "<form method='POST' action='pHchz'> ";
  f += "<br/>pH sensor I2C address (hex): ";
  f += "<input type='textarea' name='pHAdd'><br/><br/>\n";
  if (GOT_PH_SENSOR) {
    f += "To calibrate the pH sensor, place pH probe in calibration ";
    f += "solution, wait several minutes for readings to settle, then select the relevant ";
    f += "radio button below and click submit<br/><br/>";
    f += "<li>none <input type='radio' name='ph_Cal' value='NoCal' checked>\n";
    f += "<li>pH4 Calibration <input type='radio' name='ph_Cal' value='pH4Cal'>\n";
    f += "<li>pH7 Calibration <input type='radio' name='ph_Cal' value='pH7Cal'>\n</li>"; 
  }
  f += "<br/><input type='submit' value='Submit'></form></p>";
  f += pageFooter;
  return f;
}
void handle_serverconf() {
  dln(netDBG, "serving page at /serverconf");
  String toSend = genServerConfForm();
