In this tutorial, you will learn the basics of using Intel Edison (that runs on the Linux-based Yocto). You will then learn how to seamlessly connect your devices to QNAP NAS using QIoT Suite Lite.
Please ensure your Intel Edison and NAS are on the same LAN.
Lesson 1: Configure your devicesIn this lesson, you configure your Intel Edison device with an operating system, set up your development environment, and deploy an application to Intel Edison.
1.1 Download the Intel Edison drivers
Download the drivers for Intel Edison based on your host PC:
1.2 Configure and test your device
Getting started with Intel Edison
If this is your first time using Intel Edison, you will have to follow some steps to assemble it. Please follow steps 1-3 in the instructions:
- Step 1: Assemble boards and sensors.
- Step 2: Run setup tools.
Use the setup tool to flash the latest firmware on the Intel Edison development board via a convenient wizard. The setup tool also lets you enable SSH and WiFi connectivity to your board, as described in the steps to follow.
Download the Intel® XDK cross-platform integrated development environment. Verify and upload your onBoardBlink project to Intel Edison.
Creating your project
- Launch the Intel XDK.
- Follow the on-screen instructions to log in to your Intel® XDK account or sign up for a new Intel XDK account.
- From the Projects tab, click Start a New Project in the bottom left.
The Start a New Project page opens.
- In the Internet of Things Embedded Application list on the left, click Templates.
A list of templates are displayed on the right.
- Select the Onboard LED Blink template and click Continue.
- You can modify the directory to store your projects in the Project Directory.
- Enter a name for the project in Project Name.
- Click Create.
- Connect to the board.
- From the IoT Device drop-down list in the bottom left, select your development board.
The Connect to your IoT Device dialog box will open.
If your development board is not included in the drop-down list, you must connect to your board manually:
- Select Add Manual Connection and enter your board's IP address in Address.
- If you have created a user name and password to log in to your board, enter them in User Name and Password. Otherwise, leave the default values.
- Click Connect.
The daemon must be updated if it is out of date. This will disconnect from the board, as the daemon has to be restarted. Follow the instructions to reconnect when prompted.
- If the clock on your board and the Intel XDK IoT Edition is out of sync, click Sync.
A confirmation message will display the connection status and IP address of your development board.
- Click Dismiss.
Your board is now connected.
- Upload and run the project.
- Click the Develop tab and look for the IoT toolbar at the bottom of the window.
- Click the Upload icon to upload your project to the board.
- Click the Run icon to run your code.
You should see a flashing LED on your board.
- Click the Stop icon to stop the LED.
Congratulations, you have run your first IoT app using the Intel XDK IoT Edition. For more information on setting up Intel Edison, please refer here.
1.3 Install Nodejs and required libraries
- Open a terminal application on your computer and connect to Intel Edison.
- Install the latest nodejs.
root@Edison:~# opkg update
root@Edison:~# opkg install nodejs
- Install MQTT library and Promises library by entering the following commands:
root@Edison:~# npm install mqtt
root@Edison:~# npm install q
Lesson 2: Create your device in QIoT Suite LiteIn this lesson, you will provision your QNAP QIoT Suite Lite software, and create your first device in QIoT Suite Lite.
2.1 Install QIoT Suite Lite
- QIoT Suite Lite can be installed from the App Center.
- Launch and log in QIoT Suite Lite. The default username and password is “admin”.
2.2 Create a new IoT Application
IoT applications are a combination of Things, Rules, and Dashboards. We recommend that you first create a “Things” in IoT application. This IoT application allows you to keep a record of all of the devices that are connected to your NAS.
Rules make it possible to build IoT applications that gather, process, analyze and act on data generated by connected devices. Rules can apply to data from one or many devices, and it can take one or many actions in parallel.
Dashboards turn your data into analytics and reports that provide real-time insights.
All these elements provide user a complete IoT application environment.
QIoT SetupIf this is your first time using QIoT Suite Lite, use QIoT Quick Setup to guide you through a quick setup of an IoT application.
- After reading the introduction, click Next.
- In the IoT Application tab, enter a name for your IoT Application.
Rule and Dashboard names will be generated automatically based on the IoT Application name.
- Click Next.
- In the Thing tab, click Add.
- Enter a name for your device and provide the device information (such as serial number and manufacturer) in Add attribute.
- If your device is already supported by QIoT, choose a pre-defined Thing Type. Click Add to add the device.
- 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.
- In the Resource tab, click Add Resource.
- 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.
- Click Next after you add all the resources (sensors) on your device.
If 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. 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.
- 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 it in a dashboard.
Comments