This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SignalK diagnostic, path duplicate ?!
#1
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:

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);
}
Json output:
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
Reply


Messages In This Thread
SignalK diagnostic, path duplicate ?! - by KKempeneers - 2019-09-09, 10:32 AM
SignalK diagnostic, path duplicate ?! - by tkurki - 2019-09-09, 05:48 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)