Connect Grove Indoor Environment Kit for Intel Edison to QNAP NAS via QIoT Suite Lite
This section covers setting up aGrove Indoor Environment Kitfollowed by connecting thedevices to QIoT Suite Lite.
Setup your GroveIndoor Environment Kit for Intel Edison
1.1 What you will need
● An Intel Edison board
● Grove Indoor Environment Kit for Intel Edison
● AMicro B to Type A USB cable
● A power supply withat least7-15V DC and 1500mA
● A Wi-fi access point
The Intel Edison and NAS must be under the same LAN.
1.2 Set upIntel Edison
If you have not set up your Intel Edison, follow these guides for your respective operating system.
- Windows (32-bits)
1.3 Configure and test your devices
Step 1: Assemble the Intel Edison board
Step 2: Assemble the Indoor Environment Kit
Step 3: Connect the hardware
Use a 26AWG Grove Cable with the following connections:
Grove Modules | Connected to |
---|---|
Temperature & Humidity Sensor | I2C |
Moisture Sensor | A1 |
Light Sensor | A2 |
UV Sensor | A3 |
PIR Motion Sensor | D7 |
Encoder | D2 |
Button | D8 |
LCD RGB Backlight | I2C |
Relay | D4 |
Servo | D6 |
Buzzer | D5 |
The final device kit will be assembled similar to below image.
Step 4: Run setup tools
Use the setup tool toinstallthe latest firmware on the Intel® Edison development board. The setup tool also lets you enable SSH and Wi-Fi* connectivity to your board, as described in the steps to follow.
Take a note of the Edison's IP address as it will be required later.
1.4 Install Node.js and required libraries
● Open a terminal application on your computer and connect to Intel Edison.
● InstallNode.js and related libraries
root@Edison:~# opkg update
root@Edison:~# opkg upgrade mraa upm
root@Edison:~# opkg install nodejs
2. Create your 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 to QIoT Suite Lite. The default username and password is "admin".
2.2 Import a new sample application
● Download the sample application file: "iot_inbox.json" from Github.
● Import the "iot_inbox.json" file in the IoT Application Panel.
● Click the created application: iot_inbox
● Connect a Device by MQTTS
● Download Certificates
● Download resource info file
2.3 Install sample code on Intel Edison
● Open a terminal application on your computer and connect to Intel Edison via SSH.
● Download sample code.
root@Edison:~#git clonehttps://github.com/blackmesataiwan/Intel-Edison-QIot-Indoor.git
● Upload certificate files and resource informationfile to the Edison.
● Use FileZilla to upload files totheEdison with the following connection information.
- Host: <the IP address of the Edison>
- Port: 22
- Username: root
- Password: <the password defined in the setup tools>
After connecting totheEdison, uploadthesefiles tothedestination folder:
- Downloaded certificate files→Edison_side/ssl/
- Downloaded resourceinfo file→Edison_side/res/
2.4 Run sample code on Intel Edison and connect to QIoT
●OntheIntel Edison, open aTerminal application.
●Run the sample code you downloaded from Git.
root@Edison:~# cd ./Edison_side
root@Edison:~# npm install
Run in foreground mode:
root@Edison:~# node boot.js
Run in non-stop background mode:
root@Edison:~# sh autostart.sh
● After a few seconds,theEdison will try to connect to QIoT by MQTTS.After clicking the button the connected message will displayonyour LCD component.
Interact with your device sensor using QIoT Suite Lite
3.1 Dashboard Visualization in QIoT Suite Lite
Go to the Dashboard in the IoT Applications screen.The dashboard displays the sensor status in real-time by rotating the encoder, clicking the button or measuring soilmoisture.
3.2 Control your device usingthe Rule Engine
The sample rule engine provides youwithdefault action between sensors.Seethe Node-Red advanced dashboard todiscoverhow to interact with your sensor.
● Turn on/off the relay
The relay light goes on when clicking the switch button.
● Spin the Analog Servo
Adjust the angle value to spin the Servo.
● Play notes withtheBuzzer
Set and submit the value of volume and delay. The buzzer will play the notes.
● Alarm on when the illumination is low
The sample rule sets the buzzer to ring when the illumination value is lower than 10. You can cover the light sensor to lower the illumination value.