2019-03-18, 11:52 PM
(2019-02-14, 01:35 PM)PaddyB Wrote:(2019-02-14, 01:13 PM)skipper@sy-barranas Wrote: Does anyone have any ideas?
Thanks.
You could send the data as signalk...
Code:void sendSigK(String sigKey, float data) { // send SigK via UDP *****************************************
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();
}
}
I might be the most stupid person on earth right now, but, where do you put in this code? I'm using espeasy and nodemcu but can't find the right place to put it.
I can not find any info about how to actually do it so it would be nice if you could put me in the right direction.
Sorry for the question, but I'm lost...
//Patrik