   byte* p = (byte*)malloc(msg_length);
   memcpy(p, (char*) msgtosend.c_str(), msg_length);
 
-  udp.beginPacket(influxdbudp, 8089);
+  if ( portCount % 2 == 0 ) {
+    udp.beginPacket(influxdbudp, 8089);
+  } else {
+    udp.beginPacket(influxdbudp, 8090);
+  }
   udp.write(p, msg_length);
   udp.endPacket();
   free(p);


String clientName;
unsigned long startMills;

WiFiClient wifiClient;
WiFiUDP udp;

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

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