• This repository has been archived on 29/Nov/2021
  • Stars
    star
    208
  • Rank 189,015 (Top 4 %)
  • Language
    JavaScript
  • Created over 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Web of Things Framework for NodeJS

This is an experimental implementation of the Web of Things Framework, including a combined HTTP and Web Sockets server, as well as a web page library for demoing access to "things" from within web page scripts. This work has been done in support of the W3C Web of Things Interest Group.

A hundred billion IoT devices are expected to be deployed over the next ten years. There are many IoT platforms, and an increasing number of IoT technologies. However, the IoT products are currently beset by silos and a lack of interoperability, which blocks the benefits of the network effect from taking hold. At W3C, we are exploring the potential for bridging IoT platforms and devices through the World Wide Web via a new class of Web servers that are connected through a common framework, and available in a variety of scales from microcontrollers, to smart phones and home/office hubs, and cloud-based server farms.

This framework involves virtual objects ("things") as proxies for physical and abstract entities. These things are modelled in terms of metadata, events, properties and actions, with bindings to scripting APIs and a variety of protocols, since no one protocol will fulfil all needs.

This project explores the use of JSON-LD as the basis for describing things. The thing description language (TDL) declares the metadata, events, properties and actions, as well as the relationship that this "thing" has to other things. Complementary informal descriptions allow for thingsonomies. A web server implementing the web of things framework provides an interface for instantiating local objects as a proxy for the thing they represent, starting from the URI for that thing's description. Servers also provide an interface to registering new "things" along with their description and implementation. Such things could interface to IoT sensors and actuators, or play the role of agents that implement a service in terms of other "things".

The scripting languages available will depend upon the server. This particular project supports JavaScript courtesy of NodeJS. To start with, only bindings to Web Sockets are provided. Over time, the aim is to expand this to other protocols, e.g. HTTP, CoAP, MQTT, XMPP and AMQP. In addition, the aim is to illustrate how to support a variety of IoT devices over Bluetooth, ZigBee and so forth. The challenges will include the security and communications metadata. Security metadata covers such things access control and the terms and conditions under which a data owner permits others to access this data. Communications metadata covers such as aspects as scheduling time slots for communicating with low power devices that spend most of the time sleeping, and for bulk data transfers, where the focus is on a continuous log of sensor data. The framework allows applications to indicate when a property has been updated but not yet applied as can happen when waiting for an IoT device to wake up and open its receive window.

Technical Recap.

The Web of Things starts with URIs for β€œthing” descriptions as Linked Data expressed in JSON-LD. Things are modelled in terms of their events, properties and actions. Scripts use this URI to ask the server to create a local proxy object in the script’s execution space for the designated thing. The server takes care of the protocol details, and can use which protocol best suits its needs, e.g. HTTP, WebSockets, CoAP, MQTT, XMPP or AMQP. The thing metadata and the target server metadata enable the server hosting the proxy to figure out which protocol to use for the messaging between the proxy and the thing it proxies.

You can have chains of proxies across different servers, which can range from microcontrollers to cloud-based server farms. Whilst REST based messages are used, the URI paths are really a matter for each server (just as in HTTP). Discovery involves a range of techniques: mDNS and UPnP on local networks, Bluetooth and BLE beacons, NFC, barcodes, cloud based device registries, social networks of people and things, and by following links between things from the dependencies stated in their descriptions. Servers may also expose a list of the things they host. Privacy will be based upon access control, and terms & conditions that enable data owners to control who can access their data and for what purpose.

Prerequisites

  1. Git
  2. node.js and npm
  3. websockets node module (ws)

Installation

The starting point is to install Git, see:

http://git-scm.com/book/en/v2/Getting-Started-Installing-Git

Then install node.js and npm from https://nodejs.org/download/

Next create a copy of this directory and change to it

  git clone https://github.com/w3c/web-of-things-framework
  cd web-of-things-framework

Install the node web socket module (and other dependencies):

  npm install

To start the server use the following command from a terminal shell:

  cd examples\coap_demo
  node demo.js

to run the CoAP demo

  cd examples\http_demo
  node demo.js

to run the HTTP REST demo

Both for the CoAP and HTTP demo point your web browser to load the demo web page at

http://localhost:8888/

and open the browser console to view the log.

Click on the Things menu item in the browser to view the loaded things.

Open other browser instance at http://localhost:8888/ and invoke actions and writable properties, the framework should send data to both browser sessions.

  cd examples\p2p_demo
  node demo.js

to run the P2P Kademlia (DHT) and peer to peer demo.

  1. http://www.w3.org/blog/2015/05/building-the-web-of-things
  2. http://www.w3.org/2015/05/wot-framework.pdf
  3. http://www.w3.org/WoT/IG/

Contributing

Gitter

We welcome contributions. If you find a bug in the source code or a mistake in the documentation, you can help us by submitting an issue to our GitHub repository, and likewise if you have suggestions for new features. Even better you can submit a Pull Request with a fix. We also have a Gitter chat channel, see above link.

Note: we are using js-beautify with its default settings for normalising the use of whitespace in JavaScript source code.

We encourage you to join the W3C Web of Things Community Group where contribution and discussions happen. Anyone can join and there are no fees.

The amount of time you contribute and the areas in which you contribute is up to you.

We need plenty of help with developing open source software for the Web of Things, including servers and test frameworks and test suites. I have started a NodeJS based server, and we also are looking for help with servers on microcontrollers, on smart phones/tablets, and for highly scalable cloud based systems.

There are opportunities to help with embedded systems, especially when it comes to embedded web of things servers, and device drivers. We will need a way to describe the communications patterns used by particular device, e.g. how to communicate with devices that spend most of their time asleep, and the way in which data is buffered or multiplexed (e.g. when aggregating data from multiple sensors).

There are also plenty of areas where you could contribute that don’t involve programming, for example, gathering use cases and requirements, the details of the bindings to protocols, and the architectural considerations. Security and privacy are areas where we need to better understand what’s practical. Real-time control e.g. of manufacturing robots is one of the potential application domains where the architectural considerations are especially challenging. When it comes to programming, you would have an opportunity to take on the role of an IoT application developer who writes the application scripts. We will be looking of people who can try things out and share the experiences with others as a way of building interest in the wider community.

Please see the other project documentation (*.md), e.g. protocol bindings and also the list of project issues where we are looking for help, including design topics and bugs.

Acknowledgements

This work has been funded in part (through October 2015) by the European Union's 7th Research Framework Programme (FP7/ 2013-2015) under grant agreement nΒΊ317862 - Compose.

Related Projects

These are not as far advanced as the NodeJS project, and your help is welcomed.

License

(The MIT License)

Copyright (c) 2015 Dave Raggett <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

csswg-drafts

CSS Working Group Editor Drafts
Bikeshed
4,475
star
2

ServiceWorker

Service Workers
HTML
3,629
star
3

IntersectionObserver

Intersection Observer
Bikeshed
3,622
star
4

html

Deliverables of the HTML Working Group until October 2018
HTML
1,973
star
5

css-houdini-drafts

Mirror of https://hg.css-houdini.org/drafts
Bikeshed
1,837
star
6

epubcheck

The conformance checker for EPUB publications
Java
1,640
star
7

aria-practices

WAI-ARIA Authoring Practices Guide (APG)
HTML
1,075
star
8

webauthn

Web Authentication: An API for accessing Public Key Credentials
HTML
1,012
star
9

webcodecs

WebCodecs is a flexible web API for encoding and decoding audio and video.
HTML
990
star
10

wcag

Web Content Accessibility Guidelines
HTML
906
star
11

webappsec-change-password-url

A Well-Known URL for Changing Passwords
Bikeshed
899
star
12

webtransport

WebTransport is a web API for flexible data transport
Bikeshed
835
star
13

clreq

Requirements for Chinese Text Layout
HTML
727
star
14

manifest

Manifest for web apps
HTML
658
star
15

svgwg

SVG Working Group specifications
HTML
656
star
16

webdriver

Remote control interface that enables introspection and control of user agents.
HTML
652
star
17

webappsec

Web Application Security Working Group repo
HTML
603
star
18

trusted-types

A browser API to prevent DOM-Based Cross Site Scripting in modern web applications.
JavaScript
603
star
19

webextensions

Charter and administrivia for the WebExtensions Community Group (WECG)
Bikeshed
591
star
20

aria

Accessible Rich Internet Applications (WAI-ARIA)
HTML
582
star
21

chinese-ig

WebδΈ­ζ–‡ε…΄θΆ£η»„
HTML
536
star
22

musicxml

MusicXML specification
XSLT
512
star
23

payment-request

Payment Request API
HTML
489
star
24

trace-context

Trace Context
Python
434
star
25

webrtc-pc

WebRTC 1.0 API
HTML
423
star
26

did-core

W3C Decentralized Identifier Specification v1.0
HTML
399
star
27

webappsec-permissions-policy

A mechanism to selectively enable and disable browser features and APIs
Bikeshed
398
star
28

web-performance

W3C Web Performance Working Group repo
HTML
395
star
29

web-advertising

Web Advertising BG - https://www.w3.org/community/web-adv/
HTML
380
star
30

miniapp

MiniApps Standardization
JavaScript
366
star
31

web-share

Web API proposal for sharing data from a web page
HTML
353
star
32

webdriver-bidi

Bidirectional WebDriver protocol for browser automation
Bikeshed
335
star
33

Mobile-Checker

The Mobile Checker is a tool for Web developers who want to make their Web page or Web app work better on mobile devices.
JavaScript
322
star
34

web-nfc

Web NFC
HTML
313
star
35

picture-in-picture

Picture-in-Picture (PiP)
Bikeshed
311
star
36

webref

Machine-readable references of terms defined in web browser specifications
JavaScript
287
star
37

websub

WebSub Spec in Social Web Working Group
HTML
287
star
38

vc-data-model

W3C Verifiable Credentials v2.0 Specification
HTML
286
star
39

wai-tutorials

W3C WAI’s Web Accessibility Tutorials
JavaScript
284
star
40

activitystreams

Activity Streams 2.0
HTML
282
star
41

epub-specs

Shared workspace for EPUB 3 specifications.
HTML
274
star
42

EasierRDF

Making RDF easy enough for most developers
Python
267
star
43

webcrypto

The W3C Web Cryptography API
HTML
265
star
44

danmaku

Bullet Chatting Proposal
HTML
260
star
45

webpayments

The document repo for the Web Payments Working Group
HTML
257
star
46

paint-timing

Paint Timing
Bikeshed
251
star
47

media-source

Media Source Extensions
HTML
245
star
48

IndexedDB

Indexed Database API
Bikeshed
240
star
49

longtasks

Long Task API
Bikeshed
233
star
50

webidl2.js

WebIDL parser
JavaScript
224
star
51

smufl

Standard Music Font Layout
HTML
214
star
52

wot

Web of Things
HTML
213
star
53

browser-specs

A machine-readable list of Web specifications
JavaScript
212
star
54

webappsec-csp

WebAppSec Content Security Policy
HTML
205
star
55

webcomponents-cg

Web Components community group
HTML
202
star
56

css-validator

W3C CSS Validation Service
Java
194
star
57

web-share-target

Web API proposal for receiving shared data
HTML
192
star
58

web-roadmaps

Framework for Web technology roadmaps
HTML
190
star
59

silver

Accessibility Guidelines "Silver"
HTML
190
star
60

process

W3C Process Document
HTML
189
star
61

editing

Specs and explainers maintained by the editing task force
HTML
181
star
62

html-aria

ARIA in HTML
HTML
180
star
63

w3c-api

The W3C API
HTML
178
star
64

encrypted-media

Encrypted Media Extensions
HTML
169
star
65

p2p-webtransport

Interface to create and manage QUIC streams
HTML
164
star
66

csvw

Documents produced by the CSV on the Web Working Group
HTML
162
star
67

sdw

Repository for the Spatial Data on the Web Working Group
HTML
150
star
68

clipboard-apis

Clipboard API and events
HTML
148
star
69

strategy

team-strat, on GitHub, working in public. Current state: DRAFT
148
star
70

uievents

UI Events
HTML
147
star
71

automotive

W3C Automotive Working Group Specifications
HTML
146
star
72

webvtt.js

WebVTT parser and validator
JavaScript
146
star
73

push-api

Push API
HTML
142
star
74

gamepad

Gamepad
HTML
142
star
75

web-annotation

Web Annotation Working Group repository, see README for links to specs
HTML
141
star
76

wcag21

Repository used during WCAG 2.1 development. New issues, Technique ideas, and comments should be filed at the WCAG repository at https://github.com/w3c/wcag.
HTML
140
star
77

elements-of-html

Elements of HTML per version
HTML
137
star
78

mnx

Music Notation CG next-generation music markup proposal.
HTML
136
star
79

libwww

Libwww is a highly modular, general-purpose client side Web API written in C for Unix and Windows (Win32). It's well suited for both small and large applications, like browser/editors, robots, batch tools, etc. Pluggable modules provided with libwww include complete HTTP/1.1 (with caching, pipelining, PUT, POST, Digest Authentication, deflate, etc), MySQL logging, FTP, HTML/4, XML (expat), RDF (SiRPAC), WebDAV, and much more. The purpose of libwww is to serve as a testbed for protocol experiments. This is a complete mirror of the libwww CVS repository
C
135
star
80

w3c.github.io

The W3C organisation
HTML
134
star
81

webrtc-stats

WebRTC Statistics
HTML
128
star
82

aria-at

Assistive Technology ARIA Experience Assessment
HTML
127
star
83

sensors

Generic Sensor API
HTML
127
star
84

ortc

ORTC Community Group specification repository (see W3C WebRTC for official standards track)
HTML
124
star
85

web-locks

Cross-tab resource coordination API
Bikeshed
124
star
86

dxwg

Data Catalog Vocabulary (DCAT)
HTML
124
star
87

sparql-dev

SPARQL dev Community Group
123
star
88

wot-thing-description

Web of Things (WoT) Thing Description
HTML
122
star
89

webrtc-encoded-transform

WebRTC Encoded Transform
Bikeshed
122
star
90

mediacapture-main

Media Capture and Streams specification (aka getUserMedia)
HTML
121
star
91

mediasession

Media Session API
Bikeshed
120
star
92

did-extensions

Decentralized Identifier Ecosystem Extensions
HTML
120
star
93

rdf-star

RDF-star specification
HTML
120
star
94

link-checker

Check links and anchors in Web pages or full Web sites.
Perl
119
star
95

Unicorn

Unicorn - W3C's Unified Validator
Java
118
star
96

markup-validator

HTML
117
star
97

resource-timing

Resource Timing
HTML
116
star
98

web-animations

🚫 Old repository for the Web Animations specification 🚫. Updated repository:
HTML
115
star
99

csswg-test

The former CSS WG test repository
114
star
100

secure-payment-confirmation

Secure Payment Confirmation (SPC)
Bikeshed
113
star