mym2m-client

0.0.4 • Public • Published

360 Telemetry MyM2M Web Node.js Client

This is the Node.js client for the 360 Telemetry MyM2M Web Platform.

Caveats

  • Configuration exchange is currently unsupported in either direction (from the device to the MyM2M Service or vice-versa).

Getting Started

You can use the client within an existing project by installing it using npm:

npm install mym2m --save

Example Usage

var mym2m = require('mym2m-client');

// create a new API client with your device key and unit identifier
var myDevice = new mym2m.API('YOUR-DEVICE-KEY', 'UNIT00001');

// create a snapshot with some sample data
var snapshot = new mym2m.Snapshot();
snapshot.setChannel('temp', 25);
snapshot.setChannel('humid', 40);

// add the snapshot
myDevice.add(snapshot);

// dispatch!
myDevice.dispatch()
  .catch(function(result) {
    console.log(result);
    console.error('Dispatch failed. You can inspect result.response and result.error to debug.');
  });

Readme

Keywords

none

Package Sidebar

Install

npm i mym2m-client

Weekly Downloads

0

Version

0.0.4

License

ISC

Last publish

Collaborators

  • themainframe