Cancel
Showing results for 
Search instead for 
Did you mean: 

Websockets to the TimeSeries API

Solution Partner Experimenter Solution Partner Experimenter
Solution Partner Experimenter

We have recently developed a proof of concept-application in React with a dashboard displaying various sensor values. Right now we fetch the TimeSeries data by doing a GET request at a given time interval (evert 5th second for the moment). But it would be more convenient to use websockets to fetch the data.

 

Is this possible to use websockets for this in MindSphere? I have read the websocket documentation, but it is unclear to me if it is possible to connect to TimeSeries API using websockets.(I'm new to web programming, so the terminology is a bit hard to grasp).

 

3 REPLIES

Re: Websockets to the TimeSeries API

Legend
Legend

I'm not really sure that you can send websocket queries directly from the client web code to the timeseries service, the API documentation does not mention any support.

In the scenario sample of the documentation, they explicitly mention that you need to register your own application and send your requests to it, the MindSphere Gateway just forwards the requests (binary) to the registered endpoint of your server.

Long story short, I think you could only use websockets if you registered your own server backend, and then from there forwarded the requests to the timeseries service internally. I'm not sure how much of an improvement you'd see, since internally you would be having to perform the same http requests from the backend to the timeseries service, and then transfer the reply via your websocket.

Maybe some of the core mdsp team members can help here :-)

Re: Websockets to the TimeSeries API

Solution Partner Experimenter Solution Partner Experimenter
Solution Partner Experimenter

Thanks for your quick response!

 

It was the same understanding I had, that you have to create you own backend application. And that would not provide the benefits as a direct websocket to the TimeSeries API.

 

I suppose this is a common issue for dashboard applications, so it would be interesting to hear about the approaches people use for getting frequent TimeSeries data. 

Re: Websockets to the TimeSeries API

Solution Partner Experimenter Solution Partner Experimenter
Solution Partner Experimenter

I'm trying to ask again.

 

Anybody who has done some kind of Dashboard with advices for how to do the polling of TimeSeries data in an effective manner?