Sensors Compatible with HiveMQ

Sensors Compatible with HiveMQ

Introduction

In the ever-evolving landscape of IIoT technology, the ability to seamlessly connect and communicate with wireless sensors is paramount. NCD has emerged as a prominent player in this field, offering a range of innovative wireless sensors designed to monitor and collect data from various sources. In this article, we will delve into the exciting world of NCD wireless sensors and guide you through the process of integrating them with the HiveMQ MQTT broker. By the end of this tutorial, you will have the knowledge and skills needed to harness the power of NCD sensors and HiveMQ to create efficient and scalable IoT solutions that can transform the way you collect and manage data. Whether you’re a seasoned IoT enthusiast or just embarking on your journey into the world of wireless sensors, this article will be your comprehensive guide to achieving seamless connectivity and data exchange.

Hardware used in this article

network node-red

Enterprise IIoT Gateway

Takes wireless sensor data and sends it to any cloud or database
Click to Learn More

Topology of the Network

Enterprise Wireless Sensors

Long range wireless IIoT sensors
Click to Learn More

Sign in to HiveMQ

The first step will be creating a HiveMQ account if you have not already.  Once the account is created log in and you should be taken to the console.  HiveMQ automatically created a Cluster for me as shown in the image.  This is essentially the MQTT Broker which we will publish sensor readings to and monitor them from our software client.

 

Sign in to HiveMQ

Create Access Credentials(Gateway)

Click Manage Cluster, then at the top of the following page click Access Management.  Here we will create credentials for the Enterprise Gateway and our Software client.  This will allow the two to communicate with each other.

For my Enterprise Gateway I set the username to the Gateway’s mDNS address to keep things easy.  I then set a password I can remember and set the Permission to Publish Only.  You could set to Publish and Subscribe but for now my Gateway will only publish sensor readings.

Create Access Credentials(Gateway)

Create Access Credentials(Software)

After clicking Create Credential for the Gateway we’ll create another credential for our software.  I set mine to subscribe only.  This is sort of one way communication with sensor readings coming from the Gateway to the software.  This is totally optional, feel free to set yours to Publish and Subscribe.  I also set the username to Explorer since I will be using these credentials with MQTT Explorer to test functionality.

Create Access Credentials(Software)

Review Credentials

After creating the credentials you can scroll down and see them below.  This is all we need to do for now.  We are already done with all configuration on HiveMQ.  While you’re here however you can click on Overview at the top and copy the Cluster URL.  After that feel free to close the browser window if you wish(once again optional).

There are permissions as well here further down but that is a topic for another day.  Right now we just want to see sensor readings over HiveMQ.

Review Credentials

Hook up the Gateway

We’ll start by getting our Enterprise gateway hooked up.  If you have not yet reviewed the user guide for the Enterprise Gateway I encourage you to do that now.

Open the Enterprise Gateway’s Node-Red flow editor in your web browser.  Let’s start by making sure it sees data from our sensor.  There will be a flow deployed already with a Gateway node connected to a Debug node.  Click the debug button in the upper right corner, then press the RST button on the sensor.  You should see sensor data printed in the Debug panel.

Hook up the Gateway

Import the Node-Red Flow

To make things simpler I created a Node-Red flow you can import and edit.  This will save you some steps.

Download the HiveMQ.json file here.

In Node-Red click the menu button in the upper right button that looks like 3 lines.  Click Import, then click Select a file to import.  Select the file you downloaded and click Import.  If prompted click Import Copy.  A tab for the new flow is created at the top.  Click to view it.

Here you can see the complete flow.  We need to edit it though.

Import the Node-Red Flow

Configure the Flow

Double click the HiveMQ node to open its editor.  Click the edit button to the right of the Server Field.  

Under the Connection tab paste the Cluster URL you copied from HiveMQ in a previous step.

Under the Security Tab enter the username and password you entered when creating credentials for the Enterprise Gateway.  I also recommend setting Client ID to the Username, but you can set it to whatever you like.  Then Click Done until the Settings window is closed.  Finally click the Deploy button in the upper right corner.  After a few seconds the Hive MQ Node should show Connected.  Data from the sensor is now being published to the HiveMQ broker.

Connect Software to HiveMQ

For my testing I will be using MQTT Explorer.  It’s free, at the moment, and is cross platform so it runs on Windows, Mac, and I believe Linux.  You can download it here.  Be sure to support the Creator Thomas in any way you can.

Open MQTT Explorer.  Then create a new Connection.  I named mine HiveMQ.  Uncheck Validate Certificate, make sure Encryption is enabled.  Paste the Cluster URL from HiveMQ in the Host field, set port to 8883, then enter the username and password you set for the Software client in the previous step on HiveMQ.  

Now click Advanced.  Make sure there is a subscription to # Then click Back, then Connect.

Connect Software to HiveMQ

Final Testing

You can press the RST button on your sensor to force a transmission.  After a few seconds you should see an item appear on the list on the left labeled ncd, expand that and you will see a serial number unique to your sensor.  Click it to view the data from the sensor.  At this point you are successfully publishing data to HiveMQ from your sensor and monitoring it on HiveMQ.

Where you go from here is for your imagination to decide.  Have fun.

Final Testing
Share this on:
Facebook
Twitter
LinkedIn
Pinterest
Reddit
WhatsApp
Email
YOU MIGHT ALSO LIKE...​
NCD Node-RED UI Monitor Sensor

IntroductionRequirementsNode-REDNCD Enterprise Sensor LibraryFlowFuse Dashboard 2Installation ProcedureImporting NodeCopy JSON FileImport NCD NodeNCD UI Monitor SensorInspectLast TransmissionsClearIntroduction This Tool is a Node-RED node developed by the NCD IoT Team based on the Node-RED tool and the new Dashboard 2.0 framework. It allows you to visualize the data provided by NCD sensors in a DigiMesh network, including Address, Counter, Type, mode, Battery percentage, RSSI (DigiMesh), sensor data, and the date and time

Read More »
NCD Filter Node for Node-RED: Setup, Features, and Examples

IntroductionWireless Gateway messagesImporting and setting upRepositoryImportConexion FlowNode PropertiesFilter examplesMultiple Node Filter Usage exampleIntroduction This article provides an overview of the features and demonstrates how to import the ncd-filter node into your Node-RED NCD application. It also explains the types of messages transmitted through the output terminal of the Wireless Gateway node during the configuration, commissioning, setup, and operation phases of both the NCD nodes and the Enterprise IIoT Gateway. The

Read More »
Industrial IoT Long Range Wireless 4-20mA Current Receiver Brochure

Explore the Industrial IoT Long Range Wireless 4-20mA Current Receiver CapabilitiesDevice OverviewWireless TechnologyBattery LifeApplications & Use-casesCurrent Output Analog Sensor InterfaceWireless Flow Meter MonitoringLong Range Wireless 4-20mA Current MonitoringRead Sensors Like Force, Strain Gauge, Pressure, Flow MeterRemote Monitoring of Water Treatment FacilitiesOil and Gas Pipeline MonitoringIndustrial HVAC System Performance MonitoringAgricultural Irrigation Systems  Explore the Industrial IoT Long Range Wireless 4-20mA Current Receiver Capabilities Click Here Device Overview Introducing NCD’s Long Range

Read More »