Content
- Description
- Requirements
-
Configuration steps
- Step 1 – Log in to the Milesight IoT web GUI, connect to your MQTT broker and publish data
- Step 2 – Setting up Gravio Studio and connecting Gravio Node
- Step 3 – Connect to an MQTT broker and subscribe to a topic
- Step 4 - Verify data flow from Milesight to Gravio
- Step 5 – What is the next step after data collection?
Description
Gravio is a node computing platform that allows anyone to build business applications from aggregated data in a low-code environment. Gravio connects to various data sources by integrating with industry standards such as MQTT, TensorFlow (Computer Vision), databases (SQL, etc.) and many more. Users will also be able to deploy Gravio Platform on Edge or in the Cloud depending on their needs.
Milesight has already integrated with the MQTT standard and this is where we can easily link data from Milesight to Gravio. With this integration, users will be able to create business processes from IoT data collected from Milesight sensors.
Requirements
- Gravio Account - Please register for a Gravio account via our registration page .
- Gravio Studio (Application) - ( Download it from the App Store on MacOS/Windows)
- Gravio HubKit installed on your local machine (Windows, Mac or Ubuntu 20.04) or Cloud instance. You can download Gravio HubKit here .
- Alternatively, you can follow our Getting Started Guide first before returning to this documentation.
- You will also need to first configure or host your own MQTT broker. You can use Mosquitto or HiveMQ or one of your own brokers.
- Milesight account to publish MQTT data.
Configuration steps
Step 1 – Log in to the Milesight IoT web GUI, connect to your MQTT broker and publish data
You will find detailed steps in the Milesight documentation to prepare your data, connect to an MQTT broker and publish. Alternatively, we'll cover the brief steps here.
In the Milesight web GUI, navigate to Network Server > Applications > Edit button.
Click the “+” button and select MQTT as the data transmission type.
Now new fields will be populated and here you will enter your MQTT broker credentials and if it succeeds it should say “connected”.
Note: If you are having trouble connecting to your broker, you can try enabling the TLS checkbox for “Certificates signed by a certificate authority”. You can also contact the Milesight team for assistance.
Then we can finally publish your data via MQTT. All you have to do is scroll down and enter the desired topic in the text field.
Once this step is completed, please select “Save” and your data should be published to your MQTT broker.
Note: MQTT uplink content can be scheduled according to the steps described in How to use the payload codec on Milesight Gateway .
Step 2 – Setting up Gravio Studio and connecting Gravio Node
Once you have downloaded and installed Gravio Studio and Gravio HubKit (please see System Requirements section for links), please launch the Gravio HubKit service. In your system tray, you should be able to see the HubKit service running.
When the service is started, please launch Gravio Studio and log in. After logging in, you can add your Gravio node in Gravio Studio.
Note: Gravio nodes can be any device that has the Gravio HubKit service installed and running on the same network. (Raspberry Pi, any other PC)
Select the “+” sign then add your Gravio node using the node IP address. If you are using Localhost as your Gravio node, you can add your local IP address. Next, double-click and navigate to your Gravio node.
Step 3 – Connect to an MQTT broker and subscribe to a topic
From the home page, select the “MQTT” icon to start connecting to a new broker. Tap “+” on the next page, then “List”, then “+” again to start adding a new broker.
After entering your broker credentials, return to the MQTT Broker Subject Entry Definition page in the same window by pressing the “Back button”.
Here we will subscribe to the topic. Give it a meaningful name, then select the broker you are connected to from the drop-down list. Next, enter the topic you used the Milesight web UI to post about. Finally, select “Update”.
At this stage, you must have successfully logged in to the MQTT broker and also subscribed about the MQTT broker. The next step is to manage your data appropriately. To do this you will need to create a “zone” and add “layers”.
In the pop-up dialog, name your sensor and select “MQTT JSON” as the layer. Then select Save.
Next, we need to link the “device” to the software layer. To do this, select the layer, then find the “+” sign on the right side and select it.
You will see a pop-up box with your available MQTT topics that you are subscribed to. Select "Link" on the subject that is the same as Milesight's published data.
Make sure the toggle button for the linked layer is in the “on” position.
You have successfully connected Milesight bridged data to Gravio!
Step 4 - Verify data flow from Milesight to Gravio
In Gravio Studio there is a Data Viewer tab, select it. Make sure the “Live button” is enabled and you will be able to see live data feeds whenever a dataset is published to your MQTT broker from Milesight.
Step 5 – What is the next step after data collection?
You can now use data from Milesight to trigger events and create business applications. To learn more, you can contact the Gravio team for assistance or visit the YouTube channel and blog to learn more about creating triggers and actions.