2024-05-11, 07:43 PM
Sorry i could not answer sooner ... upon tkurki's suggestion i dove in the server logs and found that the Signal K message was improper formated.
For future reference, the C++ (Arduino code) should be:
String makeSignalKDelta(const char* topic, float data) {
String SignalKDelta;
DynamicJsonDocument doc(256);
// Create the Signal K Delta message
JsonArray updatesArray = doc.createNestedArray("updates");
// Create an object within the updates array
JsonObject updateObject = updatesArray.createNestedObject();
// Create the values array within the update object
JsonArray valuesArray = updateObject.createNestedArray("values");
// Create an object within the values array
JsonObject value = valuesArray.createNestedObject();
value["path"] = topic;
value["value"] = data;
serializeJson(doc, SignalKDelta);
return SignalKDelta;
}
(You must include ArduinoJson.h in order to compile) With that sorted out ... how can i read data from the SignalK server? And are there aftermarket displays that withstand the weather and understand SignalK? Which one would you suggest? I realy would like the dept sounder and wind instrument on a display in the cockpit.
to server: 10.10.10.1
95 bytes written.
{"updates":[{"values":[{"path":"vessels.self.propulsion.0.revolutions","value":38.483}
For future reference, the C++ (Arduino code) should be:
String makeSignalKDelta(const char* topic, float data) {
String SignalKDelta;
DynamicJsonDocument doc(256);
// Create the Signal K Delta message
JsonArray updatesArray = doc.createNestedArray("updates");
// Create an object within the updates array
JsonObject updateObject = updatesArray.createNestedObject();
// Create the values array within the update object
JsonArray valuesArray = updateObject.createNestedArray("values");
// Create an object within the values array
JsonObject value = valuesArray.createNestedObject();
value["path"] = topic;
value["value"] = data;
serializeJson(doc, SignalKDelta);
return SignalKDelta;
}
(You must include ArduinoJson.h in order to compile) With that sorted out ... how can i read data from the SignalK server? And are there aftermarket displays that withstand the weather and understand SignalK? Which one would you suggest? I realy would like the dept sounder and wind instrument on a display in the cockpit.
to server: 10.10.10.1
95 bytes written.
{"updates":[{"values":[{"path":"vessels.self.propulsion.0.revolutions","value":38.483}