npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-m2x

v0.1.2

Published

A Node-RED node to AT&T M2X

Downloads

14

Readme

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.