Websocket parameter subscription

198 views
Skip to first unread message

Andreas

unread,
Sep 27, 2020, 12:26:26 PM9/27/20
to yamcs
Hello,

I am currently struggling to get parameter updates via websocket in yamcs.
I created a websocket connection and sent this message:
{
    type"parameters",
    options: {
        instance: <yamcsInstance>,
        processor"realtime"
    }
},
and I get a reply:
{
    call: 3,
    data: {
        @type: "/yamcs.api.Reply"
    },
    type: "reply"
​}.
But after that I only get a more or less empty message:
{
    call: 3,
    data: {
        "@type": "/yamcs.protobuf.processing.SubscribeParametersData"
    },
​​    seq: 1,
    type: "parameters"
}.
After that i don't receive any further messages and sine the documentation about websockets is pretty sparse I don't know what to change.
So how can I correctly subscribe to new parameters or what do I need to change in the configs.
Thanks in advance.

Best Regards,
Andreas

fabia...@spaceapplications.com

unread,
Sep 28, 2020, 3:26:42 AM9/28/20
to yamcs
Hi,

This subscription requires you to be specific about the parameters that you're interested in, and so you need to specific the "id" array in the request message:

rough example:

{
 "type": "parameters",
 "options": {
    "instance": <yamcsInstance>,
   "processor": "realtime",
   "id": [{"name": "/my/first/parameter"}, {"name": "/my/second/parameter"}]
  }
}

If later on you want to extend your subscription you can do something like:

{
 "type": "parameters",
 "options": {
    "instance": <yamcsInstance>,
   "processor": "realtime",
   "action": "ADD"
   "id": [{"name": "/my/third/parameter"}]
  }
}

You can also make multiple parallel calls on the same websocket that each support different sets of parameters. We require such flexibility in various tools.

Since you don't provide any parameter identifiers, Yamcs will just make an empty subscription (which is an actual use case too - Yamcs Studio does it).

This "id" option appears indeed not foreseen by any commentary. And there have been previous comments about the general level of documentation on this call, so it's certainly due for an update.

Additionally, I think a kind of subscribe-all functionality might be useful for cases where the amount of parameters is manageable, so I'll consider to add an extra option. We had this some time in the past, but it wasn't very used so we dropped it. I also think out-of-the-box we could add support for an array of simple strings (qualified names) with wildcard patterns in addition to that "id" thing, the two maybe could go together.

Andreas

unread,
Sep 28, 2020, 12:43:33 PM9/28/20
to yamcs
Thank you very much. That was just the detail I was missing!
Reply all
Reply to author
Forward
0 new messages