Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DART stream server docs #1080

Closed
joeybenenati opened this issue Nov 6, 2019 · 5 comments
Closed

DART stream server docs #1080

joeybenenati opened this issue Nov 6, 2019 · 5 comments
Labels
Milestone

Comments

@joeybenenati
Copy link

@joeybenenati joeybenenati commented Nov 6, 2019

I'm having trouble understanding the request flow for receiving data from the Dart stream server. The docs are a bit sparse and don't provide any examples.

FYI - the ports for Dart services in the docs are opposite of what comes installed by default.

I'm unable to establish a socket connection to ws://{host}:8777 and POST http://{host}:8777 with body gets no response.

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "query",
    "params": [{
        "start_time_sec": 1572992702,
        "start_time_usec": 0,
        "end_time_sec": 1572999702,
        "end_time_usec": 0
    }]
}

Am I missing something?

@jmthomas

This comment has been minimized.

Copy link
Member

@jmthomas jmthomas commented Nov 6, 2019

The example documentation is here: https://cosmosrb.com/docs/dart_api/
Note that the start time and end time is the UNIX Epoch. You might want to use this: https://www.epochconverter.com/
Also note that this only works once you've fully installed DART, ingested data, and have the server running.

@jmthomas jmthomas added the question label Nov 6, 2019
@joeybenenati

This comment has been minimized.

Copy link
Author

@joeybenenati joeybenenati commented Nov 6, 2019

Thank for the response. Yes, I've read the mentioned docs and still don't see an actual example of a request to the stream server, only the decomm server example is there. Dart was running and data had been ingested at the time I attempted to request the stream, and requests to the decomm server were successful. I'd appreciate any further guidance with the below questions.

  1. I am unable to get a response from the server with the below request... Is it supposed to be a POST? Is it the method supposed to be "query"? If this is correct, I've never heard of opening a packet "stream" from a POST http request. If this is not the correct approach, please advise.
    Yes, I see that times are in epoch.

POST http://{host}:8777

{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "query",
    "params": [{
        "start_time_sec": 1572992702,
        "start_time_usec": 0,
        "end_time_sec": 1572999702,
        "end_time_usec": 0
    }]
}
  1. My next guessed approach would be to establish a websocket connection to the stream server at ws://{host}:8777 then send the above JSON over the socket once connected to start the stream. Though there is no mention of websockets in the docs, this approach is one I'm familiar with these days. But as I mentioned, I am not able to establish a websocket connection to the stream server. Again, if this is not the correct approach, please advise.
@jasonatball

This comment has been minimized.

Copy link
Collaborator

@jasonatball jasonatball commented Nov 6, 2019

The stream server is a completely different interface which is described here; https://cosmosrb.com/docs/dart_api/#dart-stream-server. Note the port is 8779 by default.

The best way to figure it out would be to look at the spec: https://github.com/BallAerospace/COSMOS/blob/master/lib/cosmos/dart/spec/dart/dart_tcpip_server_interface_spec.rb#L82

Or check out how we use it internally in COSMOS DataViewer: https://github.com/BallAerospace/COSMOS/blob/master/lib/cosmos/tools/data_viewer/data_viewer.rb#L519
And how we use it internally in COSMOS Replay: https://github.com/BallAerospace/COSMOS/blob/master/lib/cosmos/tools/cmd_tlm_server/replay_backend.rb#L397

@joeybenenati

This comment has been minimized.

Copy link
Author

@joeybenenati joeybenenati commented Nov 6, 2019

We seem to be talking in circles here. As I've mentioned in the original question I'm running this off of the default demo project, and the config for that is

PORT DART_STREAM 8777
PORT DART_DECOM 8779

^ your docs are wrong - that's me trying to help you out

I'm trying as best I can to break this down in to simple questions, but none are addressed directly. I'd be very willing to pay for support if that's the only way to avoid digging through source code for clues.

With dart and tml server running, data being ingested, should I be able to establish a websocket connection with the server with the like below or is there something I am missing?

const WebSocket = require('ws');
const ws = new WebSocket('ws://localhost:8777');
@jasonatball

This comment has been minimized.

Copy link
Collaborator

@jasonatball jasonatball commented Nov 6, 2019

You're right. We have the defaults backwards in the code but the config overrides that. I'll update the code and documentation. Thanks!

The streaming interface was provided as an internal interface for our existing tools. This is why we stream packets out using our self-defined PREIDENTIFIED stream format. If you want to try to hook up some other system to this interface I'm afraid digging through the source is probably the only way forward. That's why I pointed you to the code examples because I assumed you're trying to interface Ruby code and can use our internal libraries.

If you'd like to setup a support contract please contact us at cosmos@ball.com.

@ryanmelt ryanmelt added this to the v4.4.1 milestone Dec 31, 2019
@ryanmelt ryanmelt added maintenance and removed question labels Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.