close

In this tutorial, you will learn how to connect to QIoT Suite Lite using MQTTS.

Refer to the following tutorial to learn how to connect different development boards to QioT Suite Lite: https://www.qnap.com/en/how-to/tutorial/qiot-suite-lite

Refer to the following link to learn how to establish IoT Application and Things: https://www.qnap.com/go/how-to/tutorial/article/how-to-show-dht11-data-on-qiot-dashboard

You can also consult the QNAP GitHub at https://github.com/qnap-dev/qnap-qiot-sdks

Open IoT Applications to get MQTTS settings



  • Open your IoT Applications and go to your Things.

  • Click the "Connect a Device" button.

  • Choose "MQTTS" and click "Generate a Device Certificate".

  • Click the respective links to download the Device Certificate, and Private Key.

  • Click "Download JSON file". The name of file will be "resourceinfo.json".


* More information about "resourceinfo.json"
The following is example code from resourceinfo.json:
	{
"host": [
"172.17.28.73"
],
"myqnapcloudHost": "Not Available",
"port": 28883,
"clientId": "rpi2_1509002899",
"username": "c08b5979-1f8f-42da-9085-d761707be65c",
"password": "r:e91d53d57729b9d0b59772f9f2a130dc",
"resources": [
{
"resourcename": "temp",
"resourceid": "temp",
"resourcetypename": "Temperature",
"datatype": "Float",
"unit": "°C",
"description": "",
"topic": "qiot/things/admin/rpi2/temp"
}
],
"caCert": "/v1/media/ca-crt.pem",
"clientCert": "/v1/media/7019512017-10-18_06-32-36/7019512017-10-18_06-32-36_certificate.pem",
"privateCert": "/v1/media/7019512017-10-18_06-32-36/7019512017-10-18_06-32-36_privatekey.pem"
}


  • Reference:

    1. "host" : The NAS IP

    2. "myqnapcloudHost": If you connect the myqnapcloud DDNS services on your NAS and it will provide a Internet hostname that can connect to QIoT Suite Lite. If your encounter issues with ports, then refer the following article: https://qiot.qnap.com/blog/en/2017/09/21/solve-problem-using-different-port-qiot-suite-lite-v1-0-41/

    3. "port": The MQTTS port.

    4. "clientId": Device identifiers.

    5. "username": The MQTT username.

    6. "password" : The MQTT password.

    7. "resources": Information of resources, including the following:

      • description: QIoT resource descriptions.

      • datatype: QIoT resource data types.

      • resourceid: QIoT resource identifiers.

      • topic: The MQTTS topic to publish and subscribe.

      • resourcename: QIoT resource names

      • resourcetypename: QIoT resource types names.

      • unit : QIoT resource units.





  • Type of Connection:
    "Connection":


    • Username : <username>

    • Password : <password>

    • Client ID : <clientId>

    • CA Certificate : Choose the "CA Certificate" you downloaded earlier.

    • Client Certificate : Choose the "Device Certificate" you downloaded earlier.

    • Client Key : Choose the "Private Key" you downloaded earlier.


    "Publish":

    • Topic : <topic>

    • Payload:

      • {"value" : <data>}




    "Subscribe":

    • Topic : <topic>



arrow
arrow
    全站熱搜
    創作者介紹
    創作者 tttt 的頭像
    tttt

    觀察筆記

    tttt 發表在 痞客邦 留言(0) 人氣()