 
 String clientName;
 unsigned long startMills;
+unsigned long prevMills;
+unsigned long portCount;
 
 WiFiClient wifiClient;
 WiFiUDP udp;

  byte* p = (byte*)malloc(msg_length);
  memcpy(p, (char*) msgtosend.c_str(), msg_length);

  udp.beginPacket(influxdbudp, 8089);
  udp.write(p, msg_length);
  udp.endPacket();
  free(p);

    payload += ESP.getFreeHeap();
    payload += "i,RSSI=";
    payload += WiFi.RSSI();
    payload += ",delay=";
    payload += (millis() - prevMills);

    Serial.print("payload : ");
    Serial.println(payload);
