Code Monkey home page Code Monkey logo

eclipse-thingweb-mozilla-gateway-poc's Introduction

Eclipse thingweb mozilla gateway poc

This is a prove of concept project for Mozilla Gateway adapter to Eclipse Thingweb wot available here: adapter homepage.

Usage

Currently there are available two protocols to communicate between adapter and Eclipse Thingweb, HTTP and MQTT.

Prerequisites

You need to build Eclipse Thingweb.

  1. Clone Eclipse Thingweb repository:
git clone https://github.com/eclipse/thingweb.node-wot
  1. Go into Eclipse Thingweb repository:
cd thingweb.node-wot
  1. Install root dependencies:
npm install 
  1. Build dependencies:
npm run build

Then you need to clone this repository and follow steps for protocol which you want to use.

HTTP

  1. Go to http subfolder:
cd eclipse-thingweb-mozilla-gateway-poc/http/
  1. Run script:
./start.sh 
  1. Now all things specified in smarthome.js should be available on localhost:8082.

MQTT

(Note: in order to run mqtt examples you need to have installed and running mosquitto.)

  1. Start mosquitto:
mosquitto
  1. Go to mqtt subfolder:
cd eclipse-thingweb-mozilla-gateway-poc/mqtt/
  1. Run script:
./start.sh

Example communication with device via HTTP protocol (changing device property value)

  1. List of devices:

Device description

  1. On every item from above list you can get device information by going to URL (HTTP GET)

New propertyvalue

  1. You can check property value by going to property endpoint with HTTP GET

Property value

  1. To change value of device property, you have to make PUT request on property endpoint with data (for example with Postman):

Change property value

  1. Now you can check whether property changed (just like in third step):

New propertyvalue

Example communication with device via MQTT protocol (changing device property value)

  1. Device description send by Eclipse Thingweb in JSON format (you can notice url to writeproperty):

Device description

  1. You can check property value using valid MQTT topic, for example:

Property value

  1. To change value of device property, you have to publish message on valid topic:

Change property value

  1. Now you can check whether property changed (just like in second step):

New propertyvalue

Note: screenshots are from MQTTfx.

eclipse-thingweb-mozilla-gateway-poc's People

Contributors

marwin34 avatar yacubane avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.