cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Help us improve the PTC Community by taking this short Community Survey! X

Make a connection with ThingWorx WebSocket using Angulard Node.JS

Mathis150
3-Visitor

Make a connection with ThingWorx WebSocket using Angulard Node.JS

Hi,

I'm actually regarding to make a WebSocket connection between ThingWorx and a WebApp using Angular Node.JS (17), the objective is to retrive and display data in real time on the web interface.

 

After looking the ThingWorx Documentation and looking at all post on the Forum, I was thinking "Is this really possible ?", so I'm here to see if some other developers have already done that before ?

Thank you for all future person will give me some answer to my question.

ACCEPTED SOLUTION

Accepted Solutions

My understanding is you want to use a angular web app to display data that you get from Thingworx. And that you want to use a websocket connection so that ThingWorx pushes data to the web app.

 

You can't reuse the existing web socket of ThingWorx as it runs a proprietary protocol (AlwaysOn). Even if you manage to connect to it technically, it is not supported. You can either develop your own extension which runs its own Websocket and pushes data on DataChangeEvent, or you can embed a Thingworx mashup (e.g. as an iframe) into your Angular App.

As a third way you could also have TWX publish changes to e.g. an MQTT queue and subscribe your WebApp to it.

I would suggest using ThingWorx mashup with GetProperties (also uses Websocket and can push values to the UI), and embed the added features you want to accomplish with Angular into the Mashup with the Web Frame widget.

View solution in original post

2 REPLIES 2

Similar discussion - "Websocket connection between Thingworx and a websocket-server": https://community.ptc.com/t5/ThingWorx-Developers/Websocket-connection-between-Thingworx-and-a-websocket-server/td-p/527361

My understanding is you want to use a angular web app to display data that you get from Thingworx. And that you want to use a websocket connection so that ThingWorx pushes data to the web app.

 

You can't reuse the existing web socket of ThingWorx as it runs a proprietary protocol (AlwaysOn). Even if you manage to connect to it technically, it is not supported. You can either develop your own extension which runs its own Websocket and pushes data on DataChangeEvent, or you can embed a Thingworx mashup (e.g. as an iframe) into your Angular App.

As a third way you could also have TWX publish changes to e.g. an MQTT queue and subscribe your WebApp to it.

I would suggest using ThingWorx mashup with GetProperties (also uses Websocket and can push values to the UI), and embed the added features you want to accomplish with Angular into the Mashup with the Web Frame widget.

Announcements


Top Tags