Skip to content

Basic W3C Web of Things support for Mozilla WebThings Gateway

License

Notifications You must be signed in to change notification settings

Yacubane/w3c-web-of-things-adapter

Repository files navigation

W3C Web of Things adapter

This is an adapter add-on for the Mozilla WebThings Gateway that allows a user to add W3C Web of Things devices. This is a fork of original thing-url-adapter.

Notes

⚠️ W3C Web of Things (WoT) describes API in very generic way. There is not possible to implement every protocol that can be used with WoT.

This project aims to implement basic HTTP binding covered in W3C WoT Specification: HTTP binding assertions Example interations

Whats more, project aims to cover other protocols (like MQTT) with similar API as HTTP one (communication with same JSONs as in HTTP)

Finally, with this project, there should be possible to create new devices using some WoT implementations (like Eclipse Thingweb) and expose them easily in Mozilla Gateway.

Supporting protocol

  • HTTP
  • MQTT

Example HTTP usage

  1. Make sure your devices are available via url, for example:

Devices available on localhost:8082

  1. Go to addon configuration page and add url where addon should search for device that you want to add:

Addon configuration

  1. Go back to Things page on WebThings Gateway page and add new thing:

Device usage

  1. Now you can use your W3C Web of Things devices via Mozilla WebThings Gateway.

Example MQTT usage

  1. Make sure your devices are available via mqtt protocol, for example (screen from MQTTfx):

Available devices

  1. Go to addon configuration page and add url where addon should search for device that you want to add (remember about protocol):

Addon configuration

  1. Go back to Things page on WebThings Gateway page and add new thing:

Device usage

  1. Now you can use your W3C Web of Things devices via Mozilla WebThings Gateway.

Prove of concept project

If you want to test adapter without having actual devices, you can check our prove of concept project available here: W3C Web of Things adapter POC.

Example real life usage

We have prepared short video presenting real life usage of our project:

Video presenting addon usage

Developing in W3C WoT API

We recommend using Eclipse Thingweb for developing in WoT API. This implementation of WoT is based on bindings and examples from W3C's documents.

How to add new protocol handling?

  1. Create file handler-<protocol_name>.js with implementation method from handlers-skeleleton.js
  2. Import new handler to handlers-default.js

About project

This project was started as a project for Internet of Things AGH UST university course.