Giter VIP home page Giter VIP logo

node-red-m2x's Introduction

Logo

Node-RED M2X Node

A Node-RED node used to interact with the AT&T M2X API. This node is also included out-of-the-box with AT&T's Flow Designer.

AT&T M2X is a cloud-based fully managed time-series data storage service for network connected machine-to-machine (M2M) devices and the Internet of Things (IoT).

Installation

The node-red-m2x node is available as an npm package. Install the node per the Node-RED documentation.

Usage

Use node-red-m2x to store time-series data from anything in AT&T M2X and manage your M2X devices.

At its core, this node uses the M2X NodeJS client library and maps the msg properties to prototypes and methods of said library.

The accepted properties are:

  • msg.topic (required) - The type of object to act on, it corresponds with the prototypes defined on the M2X NodeJS client libraries (collections, commands, devices, distributions, jobs, keys).
  • msg.action (required) - An action to be applied for this type of object, corresponds with the methods defined for the entity specified in msg.topic.
  • msg.topic_id (optional) - The unique identifier to be passed to the method defined on msg.action.
  • msg.sub_topic_id (optional) - The unique identifier of an instance relative to the msg.topic_id (e.g.: msg.topic_id could be a device id and msg.sub_topic_id could be a stream or trigger id)
  • msg.payload (optional) - A JSON object that will be the body of the request when applicable.

Authentication

Use the m2x feed configuration node to set your M2X API Key

Examples

Listing devices:

msg = {
    topic: "devices",
    action: "list"
}

Viewing a device:

msg = {
    topic: "devices",
    action: "view",
    topic_id: "65b89448f954f49e42b746d73b385cbb"
}

Viewing a stream of a device:

msg = {
    topic: "devices",
    action: "stream",
    topic_id: "65b89448f954f49e42b746d73b385cbb",
    sub_topic_id: "temperature"
}

Development

This repository includes a Dockerfile that makes it easier to launch a local instance of node-red and test the M2X node.

Make sure to have a running version of docker on your computer.

Building the image

make build

Creating the container

make create

After executing those steps, you will have a new container ready for development, you can see it by executing docker ps -a and start it with docker start node-red. Once the container is ready, node-red will be running and listening for connections on port 1880 of your docker host.

Helpful Resources

License

This software is provided under the MIT license. See LICENSE for applicable terms.

node-red-m2x's People

Contributors

fsaravia avatar chenfli avatar cb-frontend avatar stream7 avatar kristinpeterson avatar

Watchers

James Cloos 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.