iotblackbelt / noderededgemodule

This repo contains the documentation for Azure IoT Edge module to use node-red on IoT Edge.
MIT License
23 stars 18 forks source link

ARCHIVED - REPOSITORY IS NOT MAINTAINED

Azure IoT Edge Node-RED Module

The Azure IoT Edge Node-RED Module is a module that can be deployed to Azure IoT Edge so you can interact with the IoT Edge platform using Node-RED. This module is provided "as-is", without any guarantee. The module can be found on Docker Hub and the source code can be found in the node-red-contrib-azure-iot-edge-module directory of this repository. If you want to create your own Node-RED module, just follow the steps that can be found in our documentation to create a Node.js IoT Edge module and use the Node.js code provided in this repository.

Azure IoT Edge Node-RED node

How to deploy the module

The module is available as an AMD64, ARM64 and ARM32 module. To run the module, deploy an IoT Edge on Linux or Raspberry Pi, and then deploy the respective module (AMD64, ARM64v8 or ARM32V7). Version 1.0.2 of the Node-Red Edge modules now use the offical Node-red docker containers, version 1.1.3-12.

Once the module is running you can access Node-RED through the browser on the same network as the edge device using the IP address or network name and port number 1880: http://<edge-device-ip>:1880

Use the tempSensor to simulate a device

If you want to simulate a device sending data on the IoT Edge you can deploy the tempSensor module. For more information on how to do this please check out: https://docs.microsoft.com/en-us/azure/iot-edge/how-to-install-iot-edge-linux-arm.

An example of a route that can be used to validate sending input to the Node-RED module:

{
  "routes": {
    "routeToHub": "FROM /messages/modules/{noderedmodule}/outputs/* INTO $upstream",
    "tempToRed": "FROM /messages/modules/tempSensor/* INTO BrokeredEndpoint(\"/modules/{noderedmodule}/inputs/input1\")"
  }
}

Replace {noderedmodule} with the name of the Node-RED module you created.

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:

How to use the module