This is a prove of concept project for Mozilla Gateway adapter to Eclipse Thingweb wot available here: adapter homepage.
Currently there are available two protocols to communicate between adapter and Eclipse Thingweb, HTTP and MQTT.
You need to build Eclipse Thingweb.
- Clone Eclipse Thingweb repository:
git clone https://github.com/eclipse/thingweb.node-wot
- Go into Eclipse Thingweb repository:
cd thingweb.node-wot
- Install root dependencies:
npm install
- Build dependencies:
npm run build
Then you need to clone this repository and follow steps for protocol which you want to use.
- Go to http subfolder:
cd eclipse-thingweb-mozilla-gateway-poc/http/
- Run script:
./start.sh
- Now all things specified in smarthome.js should be available on localhost:8082.
(Note: in order to run mqtt examples you need to have installed and running mosquitto.)
- Start mosquitto:
mosquitto
- Go to mqtt subfolder:
cd eclipse-thingweb-mozilla-gateway-poc/mqtt/
- Run script:
./start.sh
- List of devices:
- On every item from above list you can get device information by going to URL (HTTP GET)
- You can check property value by going to property endpoint with HTTP GET
- To change value of device property, you have to make PUT request on property endpoint with data (for example with Postman):
- Now you can check whether property changed (just like in third step):
- Device description send by Eclipse Thingweb in JSON format (you can notice url to writeproperty):
- You can check property value using valid MQTT topic, for example:
- To change value of device property, you have to publish message on valid topic:
- Now you can check whether property changed (just like in second step):
Note: screenshots are from MQTTfx.