You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a websocket endpoint is acting as a gateway/adapter to many Web Things, it'd be ideal to have a single websocket connection to the gateway. This could be handled by including a URL in the message indicating what it went to, etc.
I agree it should be possible to have multiple things per WebSocket, as you say we just need to provide a thing ID (URI) in each message to indicate which thing it refers to.
We also need to figure out how to expose the WebSocket endpoint as currently we do this in the links member of a Thing resource which corresponds to a single Thing.
Perhaps if there is a Gateway capability the Thing Description for the gateway itself can have a top level links member which can link to a WebSocket endpoint for the whole gateway.
Note that the W3C spec already has an id member for a Thing which is a URI identifying the Thing. This can optionally be the URL of the Thing Description.
As per the meeting today, this should come with a section or equivalent note that opening a websocket on /things will make a websocket corresponding to multiple things.
This could be considered part of a Gateway capability
Activity
[-]Define websocket gateway API[/-][+]Multiple things per WebSocket[/+]benfrancis commentedon Apr 3, 2018
I agree it should be possible to have multiple things per WebSocket, as you say we just need to provide a thing ID (URI) in each message to indicate which thing it refers to.
YonasJ commentedon Mar 4, 2019
I would like to bump this idea.
When implementing the API using the arduino API's for the ESP32 I have encountered some challenges:
I will put some comments in "Implement a single Websocket endpoint for things #947" as well.
benfrancis commentedon Mar 6, 2019
Proposal: Add an id field to WebSocket messages whose value is a URI identifying the thing the message relates to.
We also need to figure out how to expose the WebSocket endpoint as currently we do this in the
linksmember of a Thing resource which corresponds to a single Thing.Perhaps if there is a Gateway capability the Thing Description for the gateway itself can have a top level
linksmember which can link to a WebSocket endpoint for the whole gateway.benfrancis commentedon Mar 6, 2019
Note that the W3C spec already has an id member for a Thing which is a URI identifying the Thing. This can optionally be the URL of the Thing Description.
See also: #29
hobinjk commentedon Jul 30, 2019
As per the meeting today, this should come with a section or equivalent note that opening a websocket on
/thingswill make a websocket corresponding to multiple things.This could be considered part of a Gateway capability
Describe Gateway /things websocket endpoint