Connect Arduino Yun to QNAP NAS Via QIoT Suite Lite

by winniecheng in Workshop > Tools

2262 Views, 5 Favorites, 0 Comments

Connect Arduino Yun to QNAP NAS Via QIoT Suite Lite

47185-arduino.jpg

In this tutorial, you will learn the basics of working with Arduino Yun (that runs Linux). You will then learn how to seamlessly connect your devices to QNAP NAS using QIoT Suite Lite. This example is uses the DHT11 humidity and temperature sensor.

Configure Your Devices

1-2.png

1. Configure your devices

1.1 Download Arduino IDE

1.2 Configure and test your devices

If this is your first time using Arduino Yun, you will have to follow some steps to assemble it.

  1. Connect Arduino Yun to your PC with USB.
  2. Open your Arduino IDE and find Blink example.

Configure Your Board

1-3.png

Configure Your Port

1-4.png

Verify and Upload Your Blink Example to Arduino Yun

1-5.png

After Uploading Your Code to Arduino Yun, Check Your Arduino Yun and You Should See L13 Blinking

1-6.png

Connect Your DHT11 Sensor to "Ground", "5V", "Pin 2(Digital)" on Arduino Yun Respectively

1-7.jpg

Get the IP Address of Your Arduino Yun

1-8.png

  • Press and hold the Wi-Fi reset button for 5 seconds.

Go to Your Wi-Fi Settings and Choose "Arduino-Yun-XXXXXXX"(where "XXXXXXX" Is the MAC Address of Your Arduino Yun).

1-9.png

Open Your Browser and Go to "http://192.168.240.1" or "http://arduino.local". the Default Password Is "arduino".

1-10.png

Complete Your Board Setting and Link Your Arduino Yun to the Router You Are Using. Skip "API Setting"and Click "Save".

1-11.png

  • On your PC, change your Wi-Fi network to your router and now your NAS and Arduino will be on the same network.

Install Development Tools for Your Arduino Yun

1-12.png

  • Open a Terminal from http://arduino.local
  • Log in with the username "root" and your password. The default password is "arduino".

Install PIP and MQTT Library by Entering the Following Commands.

1-13.jpg

Create Your Device in QIoT Suite Lite

1-14.jpg

Install QIoT Suite Lite

  • QIoT Suite Lite can be installed from the App Center.

Launch and Log in to QIoT Suite Lite. the Default Username and Password Is "admin".

1-15.jpg

Create a New IoT Application

1-16.jpg
1-17.jpg

If this is your first time using QIoT Suite Lite, click "Quick Setup Wizard" to start the quick setup wizard. After reading the introduction, click "Next".

Create a New IoT Application

1-18.jpg

  • Enter the IoT Application name (for example: "app_1").
  • The Rule name and Dashboard name will be automatically generated based on the IoT Application Name.
  • Click "Next".

Click "+ Add" to Add This Application’s Device.

1-19.png

Click "+Add", in "Add Things"

1-20.jpg

  • Enter a name for your device (for example: "arduino") and enter the device information (such as serial number and manufacturer) in Add attribute.
  • If your device is already supported by QIoT (Arduino Yun,Raspberry Pi, Edison, and Linkit 7688 (Duo)), choose a pre-defined Thing Type.
  • Click Add.

Enter the IP Address, User Name, and Password of Your Device and Click the Connect Icon. QIoT Suite Lite Will Check the Connection With the Device. After the Connection Is Verified, Click Next.

1-21.jpg

In "Resources", Click "Add Resource".

qiot-arduino-v2_23.png

In "Add Thing Resource"

qiot-arduino-v2_24.png

  • Enter the name and ID for the sensor in Resource Name and Resource ID. Please note that the Resource ID will be used to create a Topic in the QIoT Broker. This ID should be unique for the device and no duplicates should be allowed for the same device.

In "API Keys"

qiot-arduino-v2_25.jpg

f you want to embed QIoT dashboard widgets into web pages or access QIoT APIs from third-party applications, go to the API Keys tab and click "Generate New API Key". Click "Done".

Your IoT Application Will Now Be Created.

qiot-arduino-v2_26.jpg

  • Node.js sample codes and related files (certificate, resource information) will be uploaded to the specified path on your device.

A Sample Dashboard Will Be Created.

qiot-arduino-v2_27.gif

Go to the Rule Tab to Define the Flow or Rules on How to Process the Data Sent From the Device, and How to Present in a Dashboard.

qiot-arduino-v2_28.gif

More Information About QNAP QIoT

More information about QNAP QIoT, please visit https://www.qnap.com/solution/qiot-suite/en/

More Tutorial by visiting https://www.qnap.com/en/how-to/tutorial/qiot-suite...