I found it was easier to send the data straight to signalk, this sends it over wifi and serial, from memory arduinojson library needs to be before 6.0.0
Code:
/ send signalk data over UDP
// *******************************************************
void sendSigK(String sigKey, float data)
{
if (sendSig_Flag == 1)
{
DynamicJsonBuffer jsonBuffer;
String deltaText;
// build delta message
JsonObject &delta = jsonBuffer.createObject();
//updated array
JsonArray &updatesArr = delta.createNestedArray("updates");
JsonObject &thisUpdate = updatesArr.createNestedObject(); //Json Object nested inside delta [...
JsonArray &values = thisUpdate.createNestedArray("values"); // Values array nested in delta[ values....
JsonObject &thisValue = values.createNestedObject();
thisValue["path"] = sigKey;
thisValue["value"] = data;
thisUpdate["Source"] = "ESP32";
// Send UDP packet
Udp.beginPacket(remoteIp, remotePort);
delta.printTo(Udp);
Udp.println();
Udp.endPacket();
delta.printTo(Serial);
Serial.println();
}
} //___________________________________________________________