Search This Blog

3/25/19

How to use QNAP IoT solution - QIoT Suite

Online Help Menu



Overview

QIoT Suite Lite is a complete and practical IoT private cloud platform to help you build and manage IoT applications on QNAP NAS.
The main components of QIoT Suite Lite are device gateways, rule engines, and dashboards. Starter kits (including Arduino, Raspberry Pi and Intel Edison) can be used with multiple sensors and push telemetry data to QIoT Suite Lite via the device gateway. Device gateways support multiple communication protocols, including MQTT, HTTP, and CoAP. A powerful rules engine will process the data and take actions accordingly. The dashboard allows you to monitor and control IoT systems from a single interface.

Home

This page shows all the information of QIoT Suite Lite

Home introduction

The left block provides links to each page.
The top block provides links to IoT Applications, Things, Thing Types and their total number. The triangle next to the clickable IoT application icon displays the number of executions and stopped processes.
The lower block provides detailed status of the QNAP NAS, including CPU and memory usage. It also provides detailed information of the current network traffic for all NAS network interfaces.

Quick Setup Wizard

The Quick Setup Wizard can help you quickly create IoT application services and push the sample code, device configurations, MQTTS connection profile and SSL certificate key to your device.
Step 1: Click "Quick Setup Wizard" in the top-right corner.
Step 2: Create a new IoT application
This step creates an IoT application that contains Things, Rule and Dashboard. An IoT application is made up of a single rule, a single dashboard and multiple Things.
You can enter the IoT application name and description below, and the rule through the dashboard.
Step 3: Add Thing
This step creates a Thing, or your device source.
Click "Add" and you can select from existing Things or create a new Thing.
  • Thing name: Enter a name.
  • Description: Enter a description.
  • Thing type: Select the Thing's category from the following options. Each category is described below:
    • QIoT Supported: This is a board/device that is fully supported and tested for compatibility with QIoT Suite Lite. QIoT-supported Things have pre-defined Thing type attributes and will push the sample code suitable for the current Thing to the device. (Arduino Yun:"Python", Raspberry Pi:"Node.js", Intel Edison:"Node.js")
    • Custom: Custom development board/device types.
  • Attributes (optional): Use the Thing attributes to describe the device's identification and functionality. Each attribute is a key-value pair.
Enter the IP address, Username and Password of the Thing and click "Connect" to test the connection. Proceed to the next step after successful connection.
Step 4: Add Resource
A Thing Resource is a sensor, peripheral, switch, or another data channel/state that needs to be transmitted or received. Adding a Resource means creating the data channel ID (MQTT → topic, HTTP and CoAP → URL) to connect with QIoT Suite Lite. Add these Resources to your device and set up according to your needs.
  • Resource Name: Enter a Resource name
  • Resource Description: Enter a Resource Description
  • Resource ID: Enter the Resource ID (Note: This Resource ID will be used to create a Topic in the QIoT Broker. The ID must be unique and the same device cannot have a duplicate ID. The corresponding sample code or in-house developed code can only be transmitted after entering the corresponding ID. See the description in the sample code and the linked file Resourceinfo.json.)
  • Resource Type: Select the Resource type
  • Data Type: Select a data type to be sent or received by the Resource
  • Unit: Select a data unit
  • Set the range (maximum and minimum) and default value
Step 5: Add API Key (optional)
Add an API Key in this step for third-party applications to access the QIoT Suite Lite API. To embed a QIoT Suite Lite dashboard gadget on a web page, you can use an API Key.
Step 6: Once added, the sample code, device configurations, connection data and SSL certificate key will be transmitted to the device. Upon successful transmission, the upload path will be displayed. You can find the sample code, connection data and SSL certificate key through this path.

User Profile

Edit user settings (the admin account cannot be edited. To change the password, you must go to the QTS Control Panel).
You can enter your first name, surname, and email address. It will show the account role and you can also change the password.

API Documentation for reference

API documentation for QIoT Suite Lite can be found through the API file link in the top-right corner.
For more information, visit the QIoT Suite Lite Blog: https://qiot.qnap.com/blog/


IoT applications

An IoT application contains a rule, a dashboard and all Things. An IoT application is made up of a single rule, a single dashboard and multiple Things.

Add IoT application

To add an IoT application, enter the IoT application name and description, and the rule through the dashboard.

Import IoT application

The "Import" button allows you to import previously-created IoT applications (including Things, rules and dashboards).

Export IoT application

This will save the configuration of an IoT application for backup or migration purposes. Click the IoT application to be exported (only one can be exported at one time), and click "Action" > "Export", save the file as a new file.

IoT application information

You can display the IoT application information and modify the IoT application name and description.

Stop IoT application

This will stop the IoT application. Services that require this IoT application will be affected.

Delete IoT application

This will delete the IoT application.
Note: Things under the IoT application will not be deleted. They can be reused by other IoT applications. If you want to delete them, please refer to the Thing section.
For more information, visit the QIoT Suite Lite Blog: https://qiot.qnap.com/blog/

Dashboard

The Dashboard presents information in a graphical manner.

How to init Dashboard

Users can choose to import data from the Rule Engine "QBroker" node.
There are two methods to use QBroker: Importing data from thing resource or importing data from the rule engine:
Method 1: Importing data from a thing resource
  1. Go to the Dashboard
  2. Click "Edit"
  3. Add a new pane
  4. Click  and select the widget type

  5. Enter information. In "Value" choose your thing resource (e.g., qiotsupported_)
  6. Click "Save"
  7. Click "Finished Editing"


Method 2: Importing data from rule engine
In the Rule Engine:
  1. Go to the rule engine
  2. Add a QBroker node and double click this node to edit its settings
  3. Choose "Custom topic" and enter your self-defined name in the "Topic" field (e.g., Dashboard)
    (Note: If you use the same topic name in another IoT application then it will receive the same data)
  4. Click "Done" and connect the data to output to this QBroker
  5. Click "Save"
In the Dashboard:
  1. Go to the dashboard
  2. Click "Edit"
  3. Add a new pane
  4. Click  and select the widget type

  5. Enter information. In "Value", choose your self-defined name (e.g., qiotrule_Dashboard)
  6. Click "Save"
  7. Click "Finished Editing"



Edit Widget

To set up a widget, click "Edit" in the top-right corner to edit the widget. Click Edit to finish editing.

Export Widget

You can use the created API in this step to export dashboard data to a custom web page.
Step 1
Click "Edit" on the top-right corner, and click the icon in the red box as seen in the below screenshot.
Step 2
Select the API Key to generate the below code. This code can be embedded in a web page.

Share Dashboard

Click  and choose "Share Public Link" and "Copy Public Link" to share dashboards with other users.
For more information, visit the QIoT Suite Lite Blog: https://qiot.qnap.com/blog/


Rule

Our Rule engine is based on Node-RED. For more information, visit https://nodered.org/
There are four customized QIoT nodes: QDashboard, QBroker(in), QBroker(out) and QHistoricData.
  • QDashboard: This node provides a Live Data API endpoint
  • QBroker: This node receives and transmits Thing data
  • QHistoricData: This node retrieves the maximum, minimum, and average values stored in the database
Refer to the information in the node to see how to use it. The data values received by QBroker must be in JSON format. For example: data transmitted to a Thing must be {"value": XXX}. Refer to QIoT Suite Lite Sample Code for more detailed usage.

QNAP Customized Node

QDashboard: This node provides a Live Data API endpoint. This API can be used by third-party  applications or dashboards to receive the data transmitted by this node.
1. Enter the node name
2. Select the Resource type
3. Live Data API (can be used for external services to access information in the dashboard)
4. Check the imported Resource type data attributes (checked by default)
5. Format the imported dashboard data (keep default)
(If you use the default format data, the data to be transmitted must be placed in msg.payload.value)
6. Click "Done" to save the settings
7. Click "Save" to deploy the node
QBroker In: This node receives Thing data
1. Deselect "Use custom topic"
2. Select Thing
3. Add Resource
4. Select Resource
5. Click "Done" to save the settings
6. Click "Save" to deploy the node
QBroker Out: This node transmits Thing data
1. Select "Use custom topic"
2. Select Thing
3. Select Resource
4. QoS settings
A QoS setting of 0 will reduce data reliability. 
0:at most once
1:at least once

5. Retain settings
True: The MQTT Broker will retain messages in this Topic. If you have a new subscriber, or if the previously-disconnected subscriber is reconnected, they will receive the last retained message (this option must be true if HTTP, HTTPS, and CoAP protocols are used to received data).

False: The MQTT Broker will "not" retain messages in this Topic. If you have a new subscriber, or if the previously-disconnected subscriber is reconnected, they will not be able to receive the last message
6. Click "Done" to save the settings
7. Click "Save" to deploy the node
QHistoricData: This node retrieves the maximum, minimum, and average values stored in the Database
1. Select Thing
2. Select Resource
3. Select the resolution
4. Select the interval
5. Select the range
6. Select the API Key
7. Read the sample code to learn how to use date range query
8. Click "Done" to save the settings
9. Click "Save" to deploy the node

Debug message

The Debug node and tab display all the messages and error messages encountered by the rule.
Below are a few common errors:
Data received by QBroker In is not in the {"value": XXX} format
QBroker In cannot parse incoming data if QIoT receives non-{"value": XXX} format data
Error:
Correct:
(Note: If QBroker Out is sent to the Sample Code provided by QIoT, the outgoing data must be packaged as {"value": XXX}, see Sample Code)
When QoS is set to 0, the rule engine will not be able to parse the data correctly. A QoS setting of 0 will reduce data reliability. 
QoS settings levels:
0:at most once
1:at least once
For more information, visit the QIoT Suite Lite Blog: https://qiot.qnap.com/blog/


Things

This page manages the Things. A Thing is a virtual object in QIoT Suite Lite that represents a real device. You can add, modify and delete Things.
A Thing is a device that links a number of peripheral devices (including sensors, actuators, and LED lights). Things can use various network connections (such as Wi-Fi and LAN) to connect to QIoT Suite Lite. Things can use MQTT, HTTP, CoAP to send telemetric data to the QIoT gateway (publish the data to the corresponding topic in the QIoT gateway/agent). Things can receive multiple instructions or update values for a particular peripheral by subscribing to a number of topics.
In QIoT Suite Lite, peripherals (such as sensors, actuators and LED lights) are called Resources. These Resources are connected to Things.
Thing features
  • QIoT Suite Lite treats a single Thing as a member of a general Things library. All Things for a single user are listed in the "Things" section.
  • An IoT application is a logical set of Things, a rule, and a dashboard. If a user adds a Thing to a specific IoT application, only a link is created between the Thing and the application. Things are not owned by the application.
  • A Thing is only referenced by IoT applications.
  • A single Thing may be referenced by multiple IoT applications.
  • If the user sets up a Thing from any location, all references to the Thing will be updated.
  • If a user removes the Thing from the IoT application, only the reference / link of the Thing with the application is removed, and the Thing will remain in the general library of Things section.
  • Below is the representation of Things in the QIoT gateway / agent:
  • qiot/things/user1/MyThing1
  • Here:
    • User1 is the logged-in user with a Thing
    • MyThing1 is the user-defined name of the Thing
    • qiot/things/user1/ is user1's namespace, all of the user's Things will be listed in this namespace.
Resource features
Because a Resource is connected to the Thing, multiple Things cannot share a single Resource.
  • If a user deletes the Resource of a Thing, all references to the Thing will reflect this change
  • Below is the representation of Resource in the QIoT gateway/agent:
  • qiot/things/user1/MyThing1/TempSensor1
    Here:
    • User1 is the logged-in user with a Thing
    • MyThing1 is the user-defined name of the Thing
    • qiot/things/user1/ is user1's namespace. All of the user's Things will be listed in this namespace.
    • TempSensor1 is the user-defined Resource name. Things can publish data to this topic, or subscribe to the topic in order to receive updates from the agent/QIoT gateway for this topic

Add Thing

Thing name: Enter a name
Description: Enter a description
Thing type: Select the Thing's category from the following options. Every category is described below:
  • QIoT support:  This is a board/device that is fully supported and tested for compatibility with QIoT Suite Lite. QIoT-supported Things have pre-defined Thing type attributes and will push the sample code suitable for the current Thing to the device. (Arduino Yun:"Python", Raspberry Pi:"Node.js", Inetl Edison:"Node.js")
  • Custom: A custom development board/device types.
  • Attributes (optional): Use Thing attributes to describe the device's identification and functionality. Every attribute is a key-value pair.

Thing information

Various detailed information about the Thing will be listed below, including device credentials, connection profiles and Thing connection permissions management.
The details page lists the Thing details, Thing device type, Thing type, and device credentials.
Thing details list the Thing name, description, creation time, REST API endpoint (local), REST API endpoint (myQNAPcloud), and MQTT Topic.
Device credentials can be used to manage SSL certificate keys.
The device connection page generates the connection file (resourceinfo.json) for each communication protocol. MQTTS will additionally generate the SSL certificate key. The generated files (resourceinfo.json, MQTTS requires additional SSL certificate key) must be uploaded to the device (if using the Sample Code, put in resourceinfo.json -> res /, SSL certificate key -> ssl /), and use these profiles to communicate with QIoT Suite Lite.
The three generated files must be downloaded.
Click "Download JSON file" to download the connection file (resourceinfo.json).
The rule page is where QIoT Suite Lite defines the authorization level of the Thing (the Thing's access to all other devices and topics for the same user). Users can control access to the device using a rule. A Rule is closely related to the Thing, and is automatically created with the device credentials.
After the rule is created, control will be selected by default. The Thing subject to the rule will have complete permissions control when publishing and subscribing to all other devices and topics of the user. If the user only grants certain permissions to certain devices, the user can choose "Selective Control" and configure the desired settings.

Mass deployment

Mass deployment allows you to upload information and resourceinfo.json, and commands via SSH to multiple devices (only for devices support SSH with port number 22).
Setting Device connection
Choose the Thing you want to set up and click "Setup".
Enter the device connection information:
You can test the connection by clicking "Test Connect". When finished, click "Save"
Setting Deploy information
Click the "Deploy" button:
There are two ways to deploy code to things:
  • Sample Code: Upload a file containing sample code provided by QNAP using your chosen protocol to your specified "Destination Folder". After setting, click "Deploy".

  • Custom Code: Upload your own code to your devices
    "Name": Enter a name for the code
    "Destination Folder": Enter a destination path
    "Source Code Package": Upload a zip file containing your code (must be smaller than 50MB). After uploading your file to QIoT Suite Lite and clicking deploy, the file will be automatically unzipped and uploaded to your device.
    Click "Deploy".

In "Resourceinfo & Certificates": Set up the deployment of the resourceinfo.json file to Things
  • Destination Folder: Enter a destination path
  • Choose protocol: Choose between MQTT, MQTTS, HTTP, HTTPS, or COAP (If you choose MQTTS, you must set an SSH certificate and upload the certificate to the Destination Folder. You can use an existing certificate or to create a new certificate)
Click "Deploy"
In "Command Execution": You can remotely run commands to start the service of your things. The commands and records will be saved in your home path (for example: ~/bundle)
Click "Run" to send commands to your device.


Mass Deployment

Choose multiple "things" and click "Deploy" to set all of the things’ deployment information at the same time (all of the things must complete the "Connection Setup")

Delete Thing

Click the Thing to be deleted and click "Delete". Things that are already linked to an IoT Application cannot be deleted. You must unlink it before deleting it.

Search Thing

To search for a Thing, enter keywords and the relevant Things will be listed.
For more information, visit the QIoT Suite Lite Blog: https://qiot.qnap.com/blog/


Thing Types

You can add, modify and delete Thing Types. Thing Types help you organize different custom Thing types. Thing Types supported by default in QIoT Suite Lite cannot be removed.

Add Thing Type

Enter the Thing type name, description, and Thing type attributes.

Delete Thing Type

Click the Thing type to be deleted and click "Delete".

Search Thing Type

Enter keywords and the relevant Thing Types will be listed.
For more information, visit the QIoT Suite Lite Blog: https://qiot.qnap.com/blog/


User

You can add, edit, delete, and list all users (QIoT Suite Lite only) .
Every user has separate IoT applications (rule, dashboard, Things), Things, Thing types
The default administrator is the QTS admin account. Only this account has permissions to add, delete, and modify a user.

Add User

Add users to QIoT Suite Lite. Except for admin permissions, users will have different permissions.
Each user has separate IoT applications (rule, dashboard, Things), Things, Thing types
Enter the Username, First Name (optional), Surname (optional), and Email (optional).
New users start with a randomized password. This password must be changed when you log in for the first time.

Edit user info

You can reset the First Name, Surname, Email, and generate a new password.

Delete User

Click the User to be deleted and click "Delete".

Search User

Enter keywords and the relevant users will be listed.
For more information, visit the QIoT Suite Lite Blog: https://qiot.qnap.com/blog/

Settings

The Settings page provides QIoT API Keys management, QIoT security settings, QIoT server network configuration, and myQNAPcloud service settings

API Keys

You can add API Keys for third-party applications to access the QIoT API. To embed a QIoT dashboard gadget on a web page, you can use API Keys ("adminSystemKeyForDashboard" is the default key name of the dashboard, and it cannot be changed).

Administrative Settings

Set QIoT device gateway settings: QIoT server network configuration and myQNAPcloud service settings.


  • QIoT device gateway settings

For device gateway settings, you can enable or disable mandatory use of SSL protocol, if you choose to enable, Things will only be able to connect using MQTTS and HTTPS.


  • QIoT server network configuration

Server network configuration lists all QNAP NAS network Interface IP addresses of QIoT Suite Lite. QIoT Suite Lite uses all available IP addresses to generate device credentials for MQTTS, and also uses these IP addresses as host addresses in the connection file (resourceinfo.json). If the QNAP NAS changes IP address, you must update to the new IP for QIoT connection.


  • myQNAPcloud service settings

You can use a myQNAPcloud DDNS address to connect your device to the NAS-managed QIoT Suite Lite.
You can use the Internet addresses generated by myQNAPcloud with supported protocols (such as MQTT, HTTP, HTTPS, CoAP). However, if you want to use MQTTS, the Internet addresses must be updated by QIoT Suite Lite server using the device gateway to produce device credentials for the object (prerequisites for using MQTTS).


  • Back up QIoT Suite Lite:

QIoT Suite Backup creates a backup copy of your entire QIoT Suite Lite system, including IoT Applications, device information and all stored sensor data. Your entire QIoT system can be restored by using the QIoT Suite Restore function.


  • Restore QIoT Suite Lite:

Restore your entire system from a QIoT Suite Backup. Please note that you can only restore QIoT Suite Lite to the same NAS.

System Services

This is a list of the gateway modules and the corresponding ports used by each module. You can edit and test ports to avoid port conflicts. 
Choose your gateway module, click  to edit the port, and click "Test" to check if port is not currently in use. If the port can be used, click "Apply". QIoT Suite Lite may need to be restarted to finish the setting.  

About

Displays the installed version of QIoT Suite Lite and allows you to download a debug log for troubleshooting technical issues.
For more information, visit the QIoT Suite Lite Blog: https://qiot.qnap.com/blog/

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...