Comments (5)
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
from api.
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.
from api.
I would like to bump this idea.
When implementing the API using the arduino API's for the ESP32 I have encountered some challenges:
- The API's don't really support handling the websockets dynamically. So, it is a fair bit of extra coding to create an end point for each URL.
- Each websocket uses a fair amount of the precious memory available.
- I had to do a lot of duplication to support the HTTP and WebSocket API.
I will put some comments in "Implement a single Websocket endpoint for things #947" as well.
from api.
Proposal: Add an id field to WebSocket messages whose value is a URI identifying the thing the message relates to.
{
"id": "http://mythingserver.com/things/robot1"
"messageType": "setProperty",
"data": {
"leftMotor": 100
}
}
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.
from api.
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
from api.
Related Issues (20)
- type vs. mediaType vs. contentType
- Thing icons HOT 5
- Localisation (l10n) HOT 6
- CODE_OF_CONDUCT.md file missing
- [Question] Things Firmware Update HOT 2
- Default on change event for some properties
- Add WebSocket Gateway events
- Define which members are mandatory vs. optional HOT 6
- base member
- Include human-readable label in Property resource HOT 4
- Support "format" member for a property
- Consider removing object wrapper from Property payload HOT 12
- Add "auto" to HeatingCoolingProperty HOT 1
- What is the project's relationship with W3C WoT? HOT 1
- Join "Project Connected Home over IP"? HOT 1
- Allow properties to indicate if they may be logged HOT 1
- Why is Mozilla Web Thing API different from W3C Web of Things? HOT 3
- More descriptive license HOT 3
- @type should be at top level of action HOT 2
- Support for multiple @context (aka support for Linked Data) HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from api.