Jeżeli macie Intel Edison i chcecie podłączyć...

Jeżeli macie Intel Edison i chcecie podłączyć go do QNAP IoT Suit to poniższy artykuł na pewno będzie pomocny :) Connect Intel Edison to QNAP NAS via QIoT Suite Lite - Hackster.io

ahackster.imgix.net_uploads_attachments_301945_qiot_home_7B3J3RGsCk.png


GUIDE

Hardware components:
Intel Edison × 1| Intel-Edison.png


Software apps and online services:
QNAP QIoT Suite Lite| qiot-mqtts.png

STORY

Connect Intel Edison to QNAP NAS via QIoT Suite Lite

Get started with Intel Edison (Nodejs)

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 is on the same LAN.


Lesson 1: Configure your devices

In this lesson, you configure your Intel Edison device with an operating system, set up your development environment, and deploy an application to Intel Edison.
  • Download the Intel Edison drivers
Download the drivers for Intel Edison based on your host PC:
Windows users
Mac users
Linux users


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.
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 Wi-Fi* 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.
  • Connecting 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 to
IoT - Get Started with the Intel® Edison Development Board on Windows* 64-bit | Intel® Software


1.3 Install Nodejs and required libraries
  • Open a terminal application on your computer and connect to Intel Edison.
  • Install the latest nodejs
Kod:
root@Edison:~# opkg update
root@Edison:~# opkg install nodejs
  • Install MQTT library and Promises library by entering the following commands.
Kod:
root@Edison:~# npm install mqtt
root@Edison:~# npm install q


Lesson 2: Create your device in QIoT Suite Lite

In 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”.
ahackster.imgix.net_uploads_attachments_301947_image_pjtNA8l7c5349202d7a2ed5ea7dc7950018b45bc0.png



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.
  • If 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.
ahackster.imgix.net_uploads_attachments_301948_image_orAzmpDIQ876907e47fe0962cf6fc1f892b06bc8e.png

  • 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.
ahackster.imgix.net_uploads_attachments_301949_image_j1wjgQJ1j75cdc7ba9e2facc0d49c99eda5c4030b.png

ahackster.imgix.net_uploads_attachments_301950_image_EhKrb1ptid2a568d7bda45f4a1c8a5d7254dca45a.png

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.
ahackster.imgix.net_uploads_attachments_301951_image_6axrRfNMR2e701c39ed051ce68692bbdc1583842a.png

  • 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.
ahackster.imgix.net_uploads_attachments_301952_image_dYQkKVtFf35a321499c8811aa88a5b606b64afdf0.png

ahackster.imgix.net_uploads_attachments_301953_image_pwa4Z944j951ab7a0d5b7ba84e9b054f9213161cd.png

Click Next after you add all the resources (sensors) on your device.
ahackster.imgix.net_uploads_attachments_301954_image_TYsmhEA3v57c3ae9db59058e9861faad1f8a6e21a.png

  • 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.
ahackster.imgix.net_uploads_attachments_301955_image_EPkT5V7bW9e98c259ccf96b7b228b23d5362407ae.jpg

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.
ahackster.imgix.net_uploads_attachments_301956_image_MAokG1fE10719742afec2fc5aae2f7ba461d6db31.png

  • A sample dashboard will be created.
ahackster.imgix.net_uploads_attachments_301957_image_G5V2sYmXw4232ca0bff5ffdb897c61f86f48c6785.png

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.
ahackster.imgix.net_uploads_attachments_301958_image_9QpnlJXDCfb9628096cff977924b3b511489165b5.png



CODE
Github
GitHub - qnap-dev/qnap-qiot-sdks: QNAP QIoT - quickly structure your IoT environment and deployment