Sending Commands with Command Manager

94 views
Skip to first unread message

Jeff St. Jean

unread,
Jun 12, 2021, 11:09:10 PM6/12/21
to yamcs
Hi all,

I've been working on creating an instance service to send a specified list of commands and seem to be having trouble. Is there anywhere I can find an example service doing this? Code is hosted here. I've been using the CommandsApi class as reference but have gotten stuck. I keep getting the following error:

InternalStream [cmdhist_realtime] Exception received when emitting tuple to subscriber StreamCommandHistoryProvider [RUNNING]: java.lang.IllegalArgumentException: cannot convert type to value PROTOBUF(org.yamcs.cmdhistory.protobuf.Cmdhistory$AssignmentInfo)
        org.yamcs.utils.ValueUtility.getColumnValue(ValueUtility.java:107)
        org.yamcs.cmdhistory.StreamCommandHistoryProvider.onTuple(StreamCommandHistoryProvider.java:58)
        org.yamcs.yarch.Stream.emitTuple(Stream.java:56)
        org.yamcs.cmdhistory.StreamCommandHistoryPublisher.addCommand(StreamCommandHistoryPublisher.java:120)
        org.yamcs.commanding.CommandQueueManager.addCommand(CommandQueueManager.java:252)
        org.yamcs.commanding.CommandingManager.sendCommand(CommandingManager.java:82)
        com.west.yamcs.YamcsStartup.lambda$doStart$0(YamcsStartup.java:59)
        java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        org.yamcs.YamcsServer.reportReady(YamcsServer.java:1390)
        org.yamcs.YamcsServer.main(YamcsServer.java:960)



Thanks,

Jeff

Nicolae Mihalache

unread,
Jun 14, 2021, 6:44:11 AM6/14/21
to ya...@googlegroups.com
Sorry for that. Please do this:
  preparedCommand.setSource("bla");
before 
processor.getCommandingManager().sendCommand(user, preparedCommand);

That should avoid the exception. We need to clean up that code which handles command history.

--
You received this message because you are subscribed to the Google Groups "yamcs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to yamcs+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/yamcs/12fccfc8-c998-4491-811a-8b84a50ca88fn%40googlegroups.com.

Jeff St. Jean

unread,
Jun 14, 2021, 3:24:22 PM6/14/21
to yamcs
No worries! Glad it was an easy fix :)

Sort of in-line with this question: I've always sort-of ignored the yamcs/ folder in Send a Command, I'm assuming that these are commands that Yamcs can run "internally"? Is there a way to add a command to this list via a service (attached to a processor?) that can be run by a user?

Nicolae Mihalache

unread,
Jun 15, 2021, 4:09:55 AM6/15/21
to ya...@googlegroups.com
The empty "/yamcs" folder appearing in Send a Command is a little bug which was fixed in the 5.5.x versions - the empty namespaces will not appear anymore. 

To add your own commands there is not (yet) possible because there are no addCommand methods in the org.yamcs.xtce.XtceDb class.

But what kind of commands do you want to add, not regular ones which are transformed to packets, I expect? 



nicolae


Jeff St. Jean

unread,
Jun 15, 2021, 9:29:40 AM6/15/21
to yamcs
I don't necessarily have a use-case as of yet, more just curious about the internals of Yamcs. I could imagine invoking some sort of script that performs something only related to the ground (not sending commands) but maybe that's beyond the scope of the role a ground station should play.

An interesting use-case would be sending more involved command stacks with parameters that might be retrieved from elsewhere (for example, a TLE from an updating database). Instead of copy/pasting the value into the command, it could automatically retrieve it? Though that may be more suited for Yamcs Studio.

Jeff

Jeff St. Jean

unread,
Jun 15, 2021, 3:06:52 PM6/15/21
to yamcs
Just thought of a good reason for it. If a cFS instance is restarted while Yamcs is running, it'd be nice to have a command that can grab the required IP address from a .env file and use that as a parameter for the telemetry enable output command. There's no way fo Yamcs to know when cFS has been restarted so ground operator intervention would be necessary. Right now, we use a python script to do everything but it'd be nice if there was a command in Yamcs to do it all.

Nicolae Mihalache

unread,
Jun 16, 2021, 8:23:46 AM6/16/21
to ya...@googlegroups.com
I hope we will have at some point the possibility to execute scripts inside the server.

Currently you can define algorithms which may be triggered by specific parameter changes (and in which you could detect if your cFS has restarted) but it's not possible to send commands from there unless you connect back to Yamcs as a user which is a bit silly.

Reply all
Reply to author
Forward
0 new messages