CONTENTS
- Introduction
- Prerequisites
- 1. Exosite IoT Platform Configuration
- 2. Gateway Configuration
- 3. Check Result
Introduction
Exosite's Murano platform handles connected IoT devices, IoT data processing and storage, application hosting, and orchestration of applications, services, and integrations. This guide will introduce how to connect Milesight gateway and integrate LoRaWAN end device data to Exosite IoT platform via MQTT connection. For more information an guides about Exosite IoT platform, click here.
Prerequisites
- Miesight UG56/UG65/UG67 LoRaWAN Gateway
- Milesight LoRaWAN End Devices (Sensors or Controllers)
- Exosite Account: Sign-up and deploy ExoSense - Exosite Documentation
1. Exosite IoT Platform Configuration
1.1. Exosite IoT Platform Account Registration
Go to Exosite - IoT Platform to register an account following the steps. Note that it is necessary to use a Visa card to complete the process successfully.
1.2. Create IoT Connectors
Click here to log in the Exosite account, click CREATE IOT CONNECTOR.
Locate the search box and enter 'Standard Connector Template', and select the template as shown in the picture:
Click CREATE IOT CONNECTOR, then in the pop-up window, enter a connector name and click ENABLE SOLUTION.
Select the connector you created, click ADD TO SOLUTION button to select the solution as follows:
1.3. Platform Interface Settings
Click the IoT Connector you created to begin the configuration process.
Go to Settings page to change the Device API type to MQTT and select port as 8883. Besides, record the FQDN address which works as MQTT broker address.
Scroll down the current page to continue the configuration as below:
Once the configuration is complete, scroll up to the top of the current page and click the Save button to save the parameter configuration.
1.4. Create Device
Go to Devices page to click +NEW DEVICE(S).
In the pop-up interface, customize a device name and click ADD to save the settings. In this example we use 'gateway-ug65-868M'.
1.5. Activate Device
Click the three dots of this device, select 'Manually set device credentials':
Copy and save the device credential (token).
In this example the token is abb04df1c0b008c2bd227c057449d3ece2514e42.
NOTICE: This operation will generate a new token every time and automatically invalidate the existing token.
The status of the newly added device is green, indicating that the device has been successfully activated.
After that, login https://milesight.apps.exosite.io/ using the same username and go to Device Management > UNCLAIMED page.
Associate the solution to the home group as bellows:
1.6. Platform Certificate Preparation
Go to Device API Encryption Requirements - Exosite Documentation
Click .cer to download the certificate file automatically.
2. Gateway Configuration
2.1. Check Network Connectivity
Ensure that the gateway can access the internet properly. You can navigate to Tools > Maintenance > Ping page to test the website www.google.com to check network connectivity.
2.2. Enable Gateway Embedded Network Server
2.3. Add LoRaWAN Device(s)
Add LoRaWAN devices to gateway and go to Network Server > Packets to check if these devices report data regularly.
When adding device to gateway, ensure the payload codec is selected and the data can be decoded via the gateway.
2.4. Launch Node-RED App
Go to APP > Node-RED page, check the Enable option and wait for 3-5 minutes, and click the Launch button to start Node-RED web GUI.
Log in the Node-RED web GUI with the same username and password of gateway web GUI, click Import to paste and import the Exosite Demo flow. You can also create the flow via following steps.
Example Flow:
[{"id":"c847920297b47542","type":"tab","label":"Exosite Demo Flow","disabled":false,"info":"","env":[]},{"id":"3808970df323ad8c","type":"inject","z":"c847920297b47542","name":"Step1: Configure channel-related parameters and manually trigger","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"last_edited\":\"2018-03-28T13:27:39+00:00 \",\"meta\":{},\"channels\":{\"001\":{\"display_name\":\"wt101-battery\",\"description\":\"Belong to wt101-868m device\",\"properties\":{\"data_type\":\"STRING\",\"data_unit\":\"DEG_CELSIUS\",\"precision\":2}},\"002\":{\"display_name\":\"wt101-motor_position\",\"description\":\"Belong to wt101-868m device\",\"properties\":{\"data_type\":\"STRING\",\"data_unit\":\"DEG_CELSIUS\",\"precision\":2}},\"003\":{\"display_name\":\"wt101-motor_storke\",\"description\":\"Belong to wt101-868m device\",\"properties\":{\"data_type\":\"STRING\",\"data_unit\":\"DEG_CELSIUS\",\"precision\":2}},\"004\":{\"display_name\":\"wt101-temperature\",\"description\":\"Belong to wt101-868m device\",\"properties\":{\"data_type\":\"STRING\",\"data_unit\":\"DEG_CELSIUS\",\"precision\":2}},\"005\":{\"display_name\":\"wt101-valve_opening\",\"description\":\"Belong to wt101-868m device\",\"properties\":{\"data_type\":\"STRING\",\"data_unit\":\"DEG_CELSIUS\",\"precision\":2}}}}","payloadType":"json","x":320,"y":180,"wires":[["13cb2cc2e1069a00","11a646eae630b28e"]]},{"id":"13cb2cc2e1069a00","type":"mqtt out","z":"c847920297b47542","name":"The Exosite platform config_io interface","topic":"$resource/config_io","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"ced27c73a61a058e","x":820,"y":180,"wires":[]},{"id":"11a646eae630b28e","type":"debug","z":"c847920297b47542","name":"debug 19","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":740,"y":280,"wires":[]},{"id":"2991c45684531ee2","type":"Device Filter","z":"c847920297b47542","name":"Filter the wt101-868m device","eui":"1111111111111111","x":540,"y":400,"wires":[["76966a58246d7f70"]]},{"id":"d76a102159e3306a","type":"LoRa Input","z":"c847920297b47542","name":"Step 2: Retrive LoRa data stream","devEUI":"","extendedField":"","x":210,"y":400,"wires":[["2991c45684531ee2"]]},{"id":"76966a58246d7f70","type":"function","z":"c847920297b47542","name":"Parse data from the wt101 device","func":"msg.payload = {\n \"001\": 0,\n \"002\": 0,\n \"003\": 0,\n \"004\": 1.0,\n \"005\": 0\n};\n\n\nmsg.payload[\"001\"] = msg.object.battery;\nmsg.payload[\"002\"] = msg.object.motor_position;\nmsg.payload[\"003\"] = msg.object.motor_storke;\nmsg.payload[\"004\"] = msg.object.temperature;\nmsg.payload[\"005\"] = msg.object.valve_opening;\n\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":880,"y":400,"wires":[["d4907c37ee74a532","6cb34eac2b014851"]]},{"id":"d4907c37ee74a532","type":"mqtt out","z":"c847920297b47542","name":"The Exosite platform data_in interface","topic":"$resource/data_in","qos":"0","retain":"false","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"ced27c73a61a058e","x":1250,"y":400,"wires":[]},{"id":"6cb34eac2b014851","type":"debug","z":"c847920297b47542","name":"debug 20","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":1180,"y":500,"wires":[]},{"id":"ced27c73a61a058e","type":"mqtt-broker","name":"exosite-mqtt","broker":"f44c9nalyuvk00000.m2.exosite.io","port":"8883","tls":"e021407383e09808","clientid":"gateway-ug65-868M","autoConnect":true,"usetls":true,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"e021407383e09808","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"Murano_Selfsigned_Root_CA.cer","servername":"","verifyservercert":true,"alpnprotocol":""}]
2.5. Create a config_io connector
Basic Structure:
Configuration:
1. Inject node:
Add channels for every uplink item, the code format can be found here:
In this example, we add 5 channels for 5 uplink items from “001” to “005”, all variables (name, description, etc.) in the code can be customized as required.
2. MQTT out node: add topic as $resource/config_io and configure the MQTT broker information.
Exosite MQTT information:
Server address: IoT Connector FQDN address (see chapter 1.3)
Port: 8883
Use TLS: enable
Client ID: device name (see chapter 1.4)
Click here to edit TLS configuration:
Enable Verify server certificate and upload the CA certificate downloaded from chapter 1.6.
3. Click the Deploy button in the top right corner to save the scheme.
4. Check if MQTT out node has indicated connected.
2.6. Create a data_in data reporting channel
Basic Structure:
Configuration:
1. LoRa Input node: receive data from gateway embedded network server
2. Filter node: type the device EUI which need to report data to Exosite platform
3. Function node: add JavaScript code to associate the channel IDs with corresponding uplink items.
Example:
msg.payload = { //set initialize values
"001": 0,
"002": 0,
"003": 0,
"004": 1.0,
"005": 0
};
msg.payload["001"] = msg.object.battery; //forward uplink data to channel
msg.payload["002"] = msg.object.motor_position;
msg.payload["003"] = msg.object.motor_storke;
msg.payload["004"] = msg.object.temperature;
msg.payload["005"] = msg.object.valve_opening;
return msg;
4. MQTT out node: add topic as $resource/data_in and configure the MQTT broker information the same as config_io MQTT out node.
5. Click the Deploy button in the top right corner to save the scheme.
6. Check if MQTT out node has indicated connected.
2.7. Initialize config_io data
Click the Inject node to initialize the config_io data:
3. Check Result
Login https://milesight.apps.exosite.io/ to check if Exosite platform has received the messages and created the corresponding channels.
Wait a moment, we can also see that the data coming in through data_in has been correctly parsed according to config_io.
-END-