   Serial.println("");
   return;
 }
+void sendSensorData(monitor_t *monitorData) {
+  Serial.println("\nsendSensorData");
+  WiFiClient wclient;
+  PubSubClient client(wclient, svrAddr);
+  client.set_callback(callback); // Register MQTT callback
+  if (client.connect("arduinoClient")) {
+    if(GOT_TEMP_SENSOR){
+      String wc;
+      wc.concat(monitorData->waterCelsius);
+      client.publish("WaterTemp",wc);
+    }
+    if(GOT_HUMID_SENSOR){
+      String ac,hm;
+      ac.concat(monitorData->airCelsius);
+      hm.concat(monitorData->airHumid);
+      client.publish("AirTemp",ac);
+      client.publish("Humidity",hm);
+    }  
+    if(GOT_LIGHT_SENSOR){
+      String lx;
+      lx.concat(monitorData->lux);
+      client.publish("Light",lx);
+    }
+    if(GOT_PH_SENSOR){
+      String ph;
+      ph.concat(monitorData->pH);
+      client.publish("pH",ph);
+    }
+    if(GOT_LEVEL_SENSOR){
+      String wl1, wl2, wl3;
+      wl1.concat(monitorData->waterLevel1);
+      wl2.concat(monitorData->waterLevel2);
+      wl3.concat(monitorData->waterLevel3);
+      client.publish("WaterLevel1",wl1);
+      client.publish("WaterLevel2",wl2);
+      client.publish("WaterLevel3",wl3);
+    }
+  }
+  return;
+}
+
 void formatMonitorEntry(monitor_t *m, String* buf, bool JSON) {
   if(JSON) buf->concat("{ ");
   buf->concat("~timestamp~+ ");


/////////////////////////////////////////////////////////////////////////////
// data monitoring stuff ////////////////////////////////////////////////////
const boolean SEND_DATA = true;  // turn off posting of data if required here
const int MONITOR_POINTS = 60; // number of data points to store
typedef struct {
  unsigned long timestamp;

const int DATA_ENTRIES = 4; // size of /data rpt; must be <= MONITOR_POINTS
void updateSensorData(monitor_t *monitorData);
void postSensorData(monitor_t *monitorData);
void sendSensorData(monitor_t *monitorData);
void printMonitorEntry(monitor_t m, String* buf);
void formatMonitorEntry(monitor_t *m, String* buf, bool JSON);

