Giter Site home page Giter Site logo

node-picogw-plugin-mqtt's Introduction

This package is no longer necessary, because MQTT support is unified into PicoGW core system.

MQTT plugin for PicoGW

This is a MQTT plugin package of PicoGW, developed by Shigeru Owada@Sony CSL.

PicoGW MQTT plugin allows calls of PicoGW API through MQTT broker. However, because of its early development stage, it currently does not support authenticated access. Please understand that this plugin can increase vulnerablility of your network. We do not take any responsibility.

Installation

npm i -g picogw   # Install Picogw
npm i -g picogw-plugin-mqtt   #Install MQTT plugin

Running

picogw

Uninstallation

npm un -g picogw-plugin-mqtt
npm un -g picogw

How to use

Boot PicoGW with MQTT plugin and open the frontend http://localhost:8080/. The mqtt object shows up under /v1/. Right click on it and then left click the Settings button to open Settings dialog.

MQTT plugin settings

By default, the first combobox is 'false', which means the plugin is not connected to MQTT broker yet. The MQTT broker address is defaulted to mqtt://test.mosquitto.org, and MQTT Quality of Service is 1. Please change the broker address (which can start with mqtts://) and QoS as desired, change the first item to true and press Apply button at the right-bottom. The plugin should connect to the broker.

The plugin subscribes to the topic whose name is the MAC address of the running machine plus '-Req' (eg. '11:22:33:44:55:66-Req'. The MAC address PicoGW knows (including itself) is listed under /v1/admin/net. Please check the MAC address which corresponds to the IP address of the machine.

The MQTT API client sends request to the topic [MAC ADDRESS]-Req, and receives the result at the topic [MAC ADDRESS]. Like websocket API, MQTT plugin provides both procedure call (that immediately returns the payloaded reply) and subscription (that returns the reply when published.) Concrete client example is in test-tool.js.

Testing feature

This plugin has two unnecessary APIs for testing purpose. One is a dummy procedure call /v1/mqtt/testProcedure The other is a dummy topic that publishes every two seconds /v1/mqtt/testTopic. These two APIs are used in client example test-tool.js.

node-picogw-plugin-mqtt's People

Contributors

sowd avatar

Watchers

James Cloos avatar

Forkers

sowd

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.