2019-09-09, 10:32 AM
Hi,
After sailing a season with OP I am back to the desk designing new boat related stuff, one of them is a wifi hub for the engine and the weather instrument up in the mast.
So ... while goofing around with an ESP32 broadcasting SignalK updates to OP i noticed that the updates are mentioned twice in the SignalK diagnostic window.
The one that mentions the SRC is frozen while the one without the SRC keeps up with the updates send by the engine hub (simulated data btw).
This is the software used to send the updates:
Json output:
What is the purpose of the double entry? Is there something I am missing?
Koen
After sailing a season with OP I am back to the desk designing new boat related stuff, one of them is a wifi hub for the engine and the weather instrument up in the mast.
So ... while goofing around with an ESP32 broadcasting SignalK updates to OP i noticed that the updates are mentioned twice in the SignalK diagnostic window.
The one that mentions the SRC is frozen while the one without the SRC keeps up with the updates send by the engine hub (simulated data btw).
This is the software used to send the updates:
Code:
DynamicJsonDocument doc(512);
// create an object
JsonObject delta = doc.to<JsonObject>();
JsonArray updatesArr = delta.createNestedArray("updates");
JsonObject thisUpdate = updatesArr.createNestedObject();
JsonObject source = thisUpdate.createNestedObject("source");
JsonArray values = thisUpdate.createNestedArray("values");
source["label"] = "ESP Node32s";
JsonObject thisValue = values.createNestedObject();
thisValue["path"] = "propulsion.engine.revolutions";
thisValue["value"]= random(2000,3500)/60.0;
thisValue = values.createNestedObject();
thisValue["path"] = "propulsion.engine.alarm.oil";
thisValue["value"]= digitalRead(LED_BUILTIN);
thisValue = values.createNestedObject();
thisValue["path"] = "propulsion.engine.alarm.charging";
thisValue["value"]= !digitalRead(LED_BUILTIN);
thisValue = values.createNestedObject();
thisValue["path"] = "propulsion.engine.alarm.temperature";
thisValue["value"]= !digitalRead(LED_BUILTIN);
serializeJson(doc, txt);
// OPwifi
udp.broadcastTo(txt,55561);
// Test
udp.broadcastTo(txt,123456);
}
Code:
{
"updates": [
{
"source": {
"label": "ESP Node32s"
},
"values": [
{
"path": "propulsion.engine.revolutions",
"value": 41.68333
},
{
"path": "propulsion.engine.alarm.oil",
"value": 1
},
{
"path": "propulsion.engine.alarm.charging",
"value": false
},
{
"path": "propulsion.engine.alarm.temperature",
"value": false
}
]
}
]
}
What is the purpose of the double entry? Is there something I am missing?
Koen