node-red-m2x 0.1.2

A Node-RED node to AT&T M2X

npm install node-red-m2x

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 Info

Version: 0.1.2
Updated 1 year, 1 month ago
License: MIT

Downloads

2 in the last day
56 in the last week
406 in the last month

Nodes

  • m2x
  • m2x feed

Keywords

  • node-red
  • m2x

Maintainers

  • chenfli
  • fsaravia