telefonicaid/iotagent-json

Name: iotagent-json

Owner: Telefónica I+D

Description: IoT Agent for a JSON based protocol (with HTTP and MQTT transport)

Created: 2015-11-05 08:31:24.0

Updated: 2018-05-17 10:40:32.0

Pushed: 2018-05-17 10:40:27.0

Homepage:

Size: 746

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

iotagent-json

License badge Documentation badge Docker badge Support badge

Index
Description

This IoT Agent is designed to be a bridge between an MQTT+JSON based protocol and the FIWARE NGSI standard used in FIWARE. This project is based in the Node.js IoT Agent library. More information about the IoT Agents can be found in its Github page.

A quick way to get started is to read the Step by step Manual.

As is the case in any IoT Agent, this one follows the interaction model defined in the Node.js IoT Agent Library, that is used for the implementation of the Northbound APIs. Information about the IoTAgent's architecture can be found on that global repository. This documentation will only address those features and characteristics that are particular to the JSON IoTAgent.

If you want to contribute to the project, check out the Development section and the Contribution guidelines.

Additional information about operating the component can be found in the Operations: logs and alarms document.

This project is part of FIWARE. Check also the FIWARE Catalogue entry for the IoTAgents

Build & Install

Information about how to install the JSON IoTAgent can be found at the corresponding section of the Installation & Administration Guide.

API Overview

An Overview of the API can be found in the User & Programmers Manual.

API Reference Documentation

Apiary reference for the Configuration API can be found here. More information about IoTAgents and their APIs can be found in the IoTAgent Library here.

Command Line Client

The JSON IoT Agent comes with a client that can be used to test its features, simulating a device. The client can be executed with the following command:

iotaJsonTester.js

This will show a prompt where commands can be issued to the MQTT broker. For a list of the currently available commands type help.

The client loads a global configuration used for all the commands, containing the host and port of the MQTT broker and the API Key and Device ID of the device to simulate. This information can be changed with the config command.

In order to use any of the MQTT commands, you have to connect to the MQTT broker first. If no connection is available, MQTT commands will show an error message reminding you to connect.

The Command Line Client gets its default values from a config file in the root of the project: client-config.js. This config file can be used to permanently tune the MQTT broker parameters, or the default device ID and APIKey.

Testing

Mocha Test Runner + Chai Assertion Library + Sinon Spies, stubs.

The test environment is preconfigured to run BDD testing style with chai.expect and chai.should() available globally while executing tests, as well as the Sinon-Chai plugin.

Module mocking during testing can be done with proxyquire

Requirements

All the tests are designed to test end to end scenarios, and there are some requirements for its current execution:

Execution

To run tests, type

t test

Tests reports can be used together with Jenkins to monitor project quality metrics by means of TAP or XUnit plugins. To generate TAP report in report/test/unit_tests.tap, type

t test-report
Development documentation

Information about developing for the JSON IoTAgent can be found at the corresponding section of the User & Programmers Guide.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.