Skip to main content
1-Visitor
September 29, 2016
Question

Websocket connection between Thingworx and a websocket-server.

  • September 29, 2016
  • 1 reply
  • 7492 views

Hello community,

I want to open a websocket connection between Thingworx and a websocket-server for subscribing data.

I have seen that such services for http protocol exist in Thingworx:

var result = Resources["ContentLoaderFunctions"].LoadJSON(params);

So my question is:

Is there any possibility to do almost the same via websocket communication?

Thanks a lot for help,

Max

1 reply

5-Regular Member
September 30, 2016

Why aren't you just using the EMS or one of the SDKs, which handle the websocket communication for you?

mrenner1-VisitorAuthor
1-Visitor
October 4, 2016

Thanks for comment.

Yes I could handle the websocket communication using one of the SDKs.

But I thought there will be an out of the box solution for websockets in thingworx.

Do you know if there is any way to do this out of the box?

5-Regular Member
October 12, 2016

Hi Maximilian, expanding on Aanjan's response yes it would involve lua for collecting and representing your remote device to the EMS - finally on to the Thingworx platform. If you have more of such devices may be it'll help running EMS and lua in Gateway scenario where you can connect multiple of those remote devices running lua scripts pointing to one EMS which in turns connect to thingworx platform.

There's already a community blog on running EMS and lua script in Gateway mode you might want to give it a try if you haven't already- Using the Edge MicroServer and LSR in a Gateway Scenario

Hope this helps.