Wednesday, February 14, 2018

Scaling your Node-RED dashboard with MIMIC MQTT Simulator

 

 

Overview

This article shows how you can scale your Node-red visualization to a
large number of sensors. We'll go beyond the tutorials that are readily
available to apply Node-RED to a common Internet of Things (IoT)
scenario. You'll see that what works for one sensor will not work for
many, and a strategy for improving it.

The accompanying Youtube video shows this in real-time.

MQTT Lab

We'll be using the MIMIC MQTT Lab accessible on the Internet for free.
20 simulated sensors are publishing MQTT telemetry to the public
iot.eclipse.org broker.  We have seen this lab in previous articles and
videos.


 

 

Single sensor telemetry

We are using Node-RED to visualize our sensor telemetry with the
dashboard plug-in, and I'll go through it in detail.



First, on the left we see a MQTT input node labelled Single sensor
subscribed to a single topic from the public iot.eclipse.org broker.


It feeds to a debug node labelled msg.payload that lets us see what is being received.



In the debug tab we see the JSON payload of our standard simulated Bosch
sensor with telemetry containing acceleration, humidity, pressure and
temperature. Let's focus on temperature.

We can change the temperature at any point in time through the Agent 
Variable Store dialog in MIMIC. Let's do this now. Later we'll visualize the
changes.


We can link the debug node to different stages of our flow and see
what happens.

Next comes a json node, which converts the JSON in the payload to a
Javascript object. Let's link the debug node and see what is in the
object. You can see that the temperature value is accessible at
msg.payload.data.temp.value .


The JSON node then feeds into the Messages node, which is a
counter which counts the messages flowing through it. It feeds into
our dashboard to display the number of messages received. We see it
slowly incrementing.



Let's now link the json node to the rest of the flows to visualize
more of the telemetry.

I'll start by linking the json node to the NOOP node. This is just
a convenience node that will later let me do some easy re-linking.
It just passes the message straight through to some other nodes.


First is the Samples counter node, it counts the number of samples
arriving. For now, this is exactly the same as the number of MQTT
messages received.



We can see it in the Samples dashboard widget that is placed in the
Telemetry group in the Home dashboard.


This is what the dashboard looks like.

The SN number text widget underneath the samples widget extracts
the serial number that was received.


The temperature text widget shows the numeric value of the temperature
received.


The gauge and chart widgets need a single value extracted out of the
payload, which is what the Extract temp node does.




Let's change the temperature again in the MIMIC lab and see the
visualization.


As soon as we click Ok in the MIMIC Agent Variable Store dialog, the
value changes from 20000 mCelsius to 10000.



Many sensors

So far so good for one sensor. But, if you want to use this for many,
it will not work. Let's try by switching from the single sensor input
node to the many sensor input node labelled Bosch sensors.


First, we see many more messages received as shown in the debug
tab. The simulated sensors in our MQTT lab are only generating 1
message every 10 seconds on average, so you can see how easy it is
to overwhelm the collector with messages.



Second, the gauge only shows the value for the last received telemetry,
and the chart now becomes a jumble of lines for the different sensors.
It's hard to discern anything.


Let's now modify this setup to make this scenario a little more useful.
Let's say all the sensors below 80 degree celsius are normal, and
we only want to visualize the sensors that are running too hot.


We can do this with the switch node. It only sends along messages
that have a temperature value higher than 80 degrees.


Let's link it in, and see what happens.

I use an Inject node named clear stats to inject an empty message to
clear the stats.


Even though further messages are being received. No samples are reported.



Let's now change one of the sensors to an abnormally high temperature.


As soon as it reports, it is visualized.



We saw how MIMIC MQTT Simulator helps in scaling your NODE-RED
visualization.





Monday, February 12, 2018

SiteWhere tracks simulated sensors

We have used the SiteWhere JSON API to register a multitude of
simulated Bosch sensors driven by MIMIC MQTT Simulator
and are generating telemetry.
















With MIMIC you can setup large IoT environments very quickly to
test/deploy/tune/train your IoT platform.


Thursday, February 8, 2018

10 simulated sensors driving charts and rules in Samsung Artik

This 1-minute video shows 10 simulated sensors in MIMIC MQTT Simulator
from Gambit Communications as displayed by the Samsung Artik IoT
platform. The sensors are changing temperature in real-time, which is
reflected in the charts. When the temperature goes above a threshold on
any sensor, e-mails are sent.
















With MIMIC you can reproduce any scenario at will for testing, training
or demo of your IoT application.


Friday, January 19, 2018

Real-time simulated control system on Samsung Artik

In this one-minute Youtube video you'll see a real-time simulation in
MIMIC MQTT Simulator of a control system with multiple sensors exporting
temperature values to the Samsung Artik IoT platform. The values increase
until a threshold, at which time the platform rule activates an actuator,
causing the temperature values drop. When low enough, the actuator is
turned off.















This setup quickly simulates what happens in any kind of control system,
be it a data center with heating computers and fans to cool them, dams with
rising water levels and valves to release the water, pressure inside reactors,
etc.

What is missing in this simulation are backup rules in case the temperature
does not respond as expected. Once implemented, the simulation can
verify any pathological scenario, allowing disaster training, etc.

MIMIC MQTT Simulator can prototype solutions in a fraction of the time of
real systems.

Friday, January 12, 2018

Real-time telemetry from simulated sensors to Thingsboard

MIMIC MQTT Simulator can deterministically control multiple sensors'
telemetry values to reproduce any scenario you need.

In this one minute Youtube video we demonstrate how it can be done.
We change the temperature values of 5 simulated sensors that are displayed
in the customized Thingsboard dashboard.

In MIMIC, what you can do with one simulated sensor you can do with
thousands, if not millions.


Thursday, January 11, 2018

Video: Simulated real-time telemetry to Thingsboard IoT Platform

This 30-second Youtube video demonstrates real-time changing telemetry
from a simulated sensor in MIMIC MQTT Simulator visualized in the
Thingsboard dashboard. In MIMIC, what you can do to one sensor you can
do to thousands, if not millions, to allow development, testing, tuning,
training, demonstration of complicated IoT scenarios at large scale.

Tuesday, January 9, 2018

Video: Real-time telemetry simulation to Pubnub

Pubnub has recently updated their MQTT support and we have verified
that indeed it is easy to connect simulated MQTT sensors.

Following those directions we have configured our usual Bosch sensor
simulation in MIMIC MQTT Simulator to publish changing temperature
values and which are detected in a configured function in Pubnub
as shown in the debug console.


This 1-minute Youtube video shows the sensor publishing diverse
telemetry such as acceleration, humidity, temperature, pressure, etc
every 10 seconds. After a couple of intervals we change the temperature
in real-time through the MIMICview GUI from 50 C to 150 C. The configured
function in Pubnub detects the published values and prints them in the
debug console.

What we did interactively through the GUI can be done programmatically
for any number of sensors at will to reproduce any required scenario.