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-contrib-azure-iot-edge-kpm

v0.6.1

Published

Module to connect to and interact with Azure IoT Edge using Node-Red

Downloads

123

Readme

Azure IoT Edge Node-Red Module KPM

Node.js Package

This Azure IoT Edge Node-Red Module is essentially a fork of a module that used to exist on npm, but disappeared around February 17, 2020. I pulled this from the Docker image that I'd built before the module disappeared. The only place that I see the original content still kind of alive is in a Docker image at gbbiotwesouth/noderededgemodule, a project that appears to still be active GitHub. I only need the Node-RED module, not the Docker image, so I am publishing this. The original MIT license applies and is included.

WARNING: I do not know that I'll be maintaining this going forward. I'm just doing this to address the problem that occured when the original module vanished.

screenshot

Module nodes

The Node-Red module contains a number of custom nodes placed in the group "Azure IoT Edge". These nodes are "Module Twin", "Module Input", "Module Output", and "Module Method". These nodes represent the interaction that can be done with an Azure IoT Edge Module:

Module Client

The Module Client is a configuration node that needs to be created to make the connection between the IoT Edge and the Node-Red Azure IoT Edge nodes. If you use one of the examples a Module Client will be created automatically.

NOTE: Only one Module Client node should be used when using the Node-Red module.

Module Twin

The Module Twin enables you to interact with the module twin on IoT Hub. The node output will provide the twin desired property changes and the node input will enable you to send reported properties back to the IoT Hub. The message coming from the node output will have the property "topic: desired" added to it for selection and identification purposes.

The Module Twin only needs a connection to a Module Client:

edit-module-twin

Module Input

The Module Input enables you to receive input from other modules on your IoT Edge device. To receive input, you have to setup the route to point at the input you specified when you created the node. The node output will provide you with the incoming telemetry message. The message coming from the node output will have the properties "topic: input" and "input: <input name>" added to it for selection and identification purposes.

The Module Input needs a connection to a Module Client and the name of the "input"::

edit-module-twin

Module Output

The Module Output enables you to send output to the edgeHub module. To send output to another module or to the IoT Hub you have to setup the route to use the output when you created the node. The node input will enable you to send a message. The Module Output needs a connection to a Module Client and the name of the "output":

edit-module-output

Module Method

The Module Method enables you receive module direct methods. The setup of each module defines which method the node is responding to and what the response is for the method call. The message coming from the node output will look like:

{
    "topic": "method",
    "method": "<the name of the method that was called>",
    "payload": "<the payload that was sent when the method was called>"
}

The input of the node is used to send a response for the method call. So this should be used by taking the message from the output, passing it to any needed logic/work, and then building a response that will go back into this node.

The response must look like:

{
    "status": 200, // use appropriate HTTP status code
    "payload": "<any valid JSON>"
}

Both msg.status and msg.payload are required, and no other properties on msg will be sent.

The Module Method needs a connection to a Module Client and the name of the "method":

edit-module-method

Miscellaneous In-Process

For Device Twin...

Container Create Options:

{
  "HostConfig": {
    "Binds": [
      "/path/to/your/iotedge/certs/directory/on/host:/data/certs"
    ]
  }
}

Environment Variables:

Add these in your azure deployment manifest.

PATH_TO_CERTIFICATE_FILE: /data/certs/iot-edge-device-identity-full-chain.cert.pem
PATH_TO_KEY_FILE: /data/certs/iot-edge-device-identity.key.pem