setting up node-red to transmit wzzard data to microsoft azure … · 2020. 2. 20. · • in add...

9
Wzzard Data to Azure IoT Hub Using Node-RED www.advantech.com 1 0819 Setting Up Node-RED to Transmit WzzardData to Microsoft Azure IoT Hub How to publish data from Wzzard Mesh Edge Nodes into the Microsoft Azure IoT Hub using Node-RED NOTE: This assumes your Gateway is set up and claimed on WebAccess/DMP (formerly SmartWorx Hub) and the Refrigeration demo flow is loaded and working. NOTE: This assumes that the user has an Azure account. Prepare the Gateway Log into WebAccess/DMP and manage your device. Select Devices > View Devices and select your Device ID. Under Manage Apps, ensure RSMessageBroker, Wzzard Mesh and NodeRED are installed. If not, install them by selecting the Add/Upgrade Apps tab.

Upload: others

Post on 11-Mar-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Setting Up Node-RED to Transmit Wzzard Data to Microsoft Azure … · 2020. 2. 20. · • In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode • Then,

Wzzard Data to Azure IoT Hub Using Node-RED

www.advantech.com 1 0819

Setting Up Node-RED to Transmit Wzzard™ Data to Microsoft Azure IoT Hub

How to publish data from Wzzard Mesh Edge Nodes into the Microsoft Azure IoT Hub using Node-RED

NOTE: This assumes your Gateway is set up and claimed on WebAccess/DMP (formerly SmartWorx Hub) and the Refrigeration demo flow is loaded and working. NOTE: This assumes that the user has an Azure account.

Prepare the Gateway

• Log into WebAccess/DMP and manage your device.

• Select Devices > View Devices and select your Device ID.

• Under Manage Apps, ensure RSMessageBroker, Wzzard Mesh and NodeRED are installed. If not, install them by selecting the Add/Upgrade Apps tab.

Page 2: Setting Up Node-RED to Transmit Wzzard Data to Microsoft Azure … · 2020. 2. 20. · • In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode • Then,

Wzzard Data to Azure IoT Hub Using Node-RED

www.advantech.com 2 0819

Add Microsoft Azure IoT Hub Node

• Navigate: Dashboard > Devices > Manage Devices > Settings • Click on the NodeRED link on the Manage Apps table.

• In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode

• Then, click Apply Changes button.

• Wait for SmartWorx Hub to sync with your gateway. This may take several minutes.

• You can view the status by doing the following: click Manage Devices, then click the History tab.

• Proceed with the next step once the AddNode command has been added. Note: you may need to refresh the NodeRED page for your pallet to be updated.

• You will see the node-red-contrib-azureiothubnode node under Cloud (as shown in the next screen).

Page 3: Setting Up Node-RED to Transmit Wzzard Data to Microsoft Azure … · 2020. 2. 20. · • In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode • Then,

Wzzard Data to Azure IoT Hub Using Node-RED

www.advantech.com 3 0819

NodeRED Setup • Log into the gateway NodeRED editor. Default address is: 192.168.1.1:1880

• Username is NodeRED. Password is the same as Gateway password (5mart5warm default).

• Scroll down on the left side and ensure the Azure IoT hub node is loaded.

• Access the text from the SampleFlow.txt file - located in the Attachments panel to the upper-left of this document in Adobe Acrobat:

View > Navigation Panel > Attachments • Open it in Notepad (double-click) or a similar editor program.

• Carefully select and copy all of the text to the clipboard.

Page 4: Setting Up Node-RED to Transmit Wzzard Data to Microsoft Azure … · 2020. 2. 20. · • In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode • Then,

Wzzard Data to Azure IoT Hub Using Node-RED

www.advantech.com 4 0819

• Back in Node-RED editor, add a new flow by clicking on the + sign in the upper right of the window.

• Then, click on the 3 horizontal lines next to Deploy button, select Import, then select Clipboard.

• Paste the text from the text file into the grey Import nodes box and click Import.

Page 5: Setting Up Node-RED to Transmit Wzzard Data to Microsoft Azure … · 2020. 2. 20. · • In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode • Then,

Wzzard Data to Azure IoT Hub Using Node-RED

www.advantech.com 5 0819

Connect to IoT Hub

• Log into your Azure IoT hub and click on Add to add a new device.

• Name your device in the Device ID field. Click Save.

Page 6: Setting Up Node-RED to Transmit Wzzard Data to Microsoft Azure … · 2020. 2. 20. · • In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode • Then,

Wzzard Data to Azure IoT Hub Using Node-RED

www.advantech.com 6 0819

• Next, open your new device and copy the Connection string (primary key) to Notepad or

a similar editor program.

Page 7: Setting Up Node-RED to Transmit Wzzard Data to Microsoft Azure … · 2020. 2. 20. · • In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode • Then,

Wzzard Data to Azure IoT Hub Using Node-RED

www.advantech.com 7 0819

• Back in Node-RED editor, click on the node labelled Azure IoT Hub and paste in the Connection

String text from above.

• Then click Done.

Page 8: Setting Up Node-RED to Transmit Wzzard Data to Microsoft Azure … · 2020. 2. 20. · • In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode • Then,

Wzzard Data to Azure IoT Hub Using Node-RED

www.advantech.com 8 0819

Set Up Data String

• Click on the function labeled Generate Data String.

• Replace the deviceID and the Shared Access Key (SAK) with the deviceID and key from your Connection String that you downloaded from the Azure IoT hub. Click Done.

Page 9: Setting Up Node-RED to Transmit Wzzard Data to Microsoft Azure … · 2020. 2. 20. · • In Add or Remove Nodes box, in Node field, type node-red-contrib-azureiothubnode • Then,

Wzzard Data to Azure IoT Hub Using Node-RED

www.advantech.com 9 0819

Deploy the App • Next, press the Deploy button on the upper right side of the Node-RED editor.

Deployment may take several minutes.

• Your data should now be published to your IoT hub.

ADVANTECH TECHNICAL SUPPORT

USA/Canada: 1 (800) 346-3119 (Ottawa IL USA location) Europe: +353 91 792444 (Ireland location) Email: [email protected] Web: www.advantech-bb.com Wzzard is a trademark of Advantech. Other brands or product names may be trademarks and are the property of their respective companies.