fbpx

Node Red for IoT Simulator using MQTT Protocol

AWS IoT provides cloud services that connect IoT devices to other devices and AWS cloud services. It helps your devices connect to the MQTT broker without worrying about deploying and managing the MQTT broker. The goal is to simulate an IoT system, connecting it to the cloud and publish/subscribe messages using the MQTT client.

AWS IoT Core

AWS IoT Core is a managed cloud service that connects IoT devices to AWS services and provides secure interaction between cloud applications and other devices. AWS IoT Core supports device connections that use the MQTT protocol. It includes the device gateway and the message broker that connect and process messages between the IoT devices and the cloud.

Node Red

Node-Red is a programming flow-based tool used for wiring together hardware devices, APIs and online services as a part of Internet of Things. It executes the programs called Flows to implement a server. It consists of built in MQTT client and the nodes contain “topics” and “message payloads” that makes it easy to communicate with the MQTT broker and thus to set up IoT systems.

Advantages of Node-RED

  • Flow-based visual programming.
  • Provides a browser-based flow editor that makes it easy to wire together flows using different nodes.
  • A built-in library to save useful functions, templates or flows for re-use.
  • The flows can run locally using a laptop or a docker, on various devices like Raspberry Pi or on any cloud provider like Amazon, Azure or Google.

Why use Node-RED to construct an IoT Simulator?

Node-RED conveniently builds the workflows that integrate with different IoT hardware devices and sensors, APIs and online services. The flow simulator can run at the edge of the network using low-cost hardware and cloud capabilities and has a fair number of modules in its package repository. Thus, using Node-Red to demonstrate and prototype the Azure and AWS IoT solutions is easy.

Steps to create IoT Simulator

Register a Thing using AWS IoT

Thing is a virtual representation of any IoT device in the AWS IoT Cloud platform. To create and register a thing use the AWS Management Console and select the AWS IOT Core service. Create a Policy and attach it to the certificates.

Creating Node-RED based IoT Simulator

Create a flow using the nodes in Node-red and add the configuration details, server details, security certificates and the topic name. Deploy to connect to the MQTT broker.

Use the nodes in Node-red to create a flow and add the configuration information.
Data simulator with Node-RED to an IoT Edge

Publish and Subscribe to a topic

IoT devices publish MQTT messages on topics using MQTT client to subscribe to a topic and receive messages.
The Node-RED simulator data is published to the topic (/myTopic/123) and we are subscribing to the same data in AWS IoT MQTT Test client.

AWS IoT and Node-Red provide the functionality of wiring up all the components easily and building and connecting the IoT systems to the cloud quickly by chaining IoT devices, APIs and services.

AWS IoT and Node-Red provide the functionality of wiring up all the components easily and building and connecting the IoT systems to the cloud quickly by chaining IoT devices, APIs and services.

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.

Menu