LinkIT One and Grove IoT Starter Kit Powered by AWS

Introduction

Primary reference: Grove IoT Starter Kits Powered by AWS , LinkIt ONE, MediaTek AWS IoT Guide

LinkIt ONE development board is an open source, high-performance development board for wearable and IoT product prototyping. It is based on MT2502 (ARM7EJ-S™ MCU) and integrates GSM, GPRS, Wi-Fi, Bluetooth BR/EDR/BLE, GPS, Audio decoder, and SD card connector on a single development board. The kit enables you to build up cloud computing connected projects that involve communications for smart cities, transportation and logistics.

You can use AWS IoT to accomplish two key tasks: secured data and flexible tele-operations. Data is a key component of any IoT device. When sending data to the cloud, over a cellular or Wi-Fi network, you need to make the telemetry is confidential, this can be overcome by different security mechanism offered by AWS. With AWS Rule Engine, you can build a complete solution with other AWS services for your project.

With MediaTek LinkIt™ ONE and Grove IoT Starter Kit Powered by AWS, you can create powerful Wearables, bleeding edge IoT devices, send your device data to Amazon Web Services. The kit includes a collection of Grove sensors for gathering data and peripherals to acquire visual interface on your device. And by adopting the AWS Cloud, your business will benefit from its flexibility, scalability and pay on-your-demand.

Included in the Box

![](https://github.com/SeeedDocument/LinkIT_One_and_Grove_IoT_Starter_Kit_Powered_by_AWS/raw/master/img/Aws_kit_linkit.JPG)
Board/Part Quantity Documentation
[LinkIt ONE](http://www.seeedstudio.com/depot/LinkIt-ONE-p-2017.html?cPath=122_142) 1 [ Read Here](/LinkIt_ONE "LinkIt ONE")
[Base Shield](http://www.seeedstudio.com/depot/Base-Shield-V2-p-1378.html?cPath=98_16) 1 [ Read Here](/Base_shield_v2 "Base shield v2")
[Grove - 3-Axis Digital Accelerometer(±16g)](http://www.seeedstudio.com/depot/Grove-3Axis-Digital-Accelerometer16g-p-1156.html?cPath=25_132) 1 [ Read Here](/Grove-3-Axis_Digital_Accelerometer_ADXL345 "Grove - 3-Axis Digital Accelerometer ADXL345")
[Grove - Light Sensor](http://www.seeedstudio.com/depot/Grove-Light-Sensor-p-746.html?cPath=25_27) 1 [ Read Here](/Grove-Light_Sensor "Grove - Light Sensor")
[Grove - LED Bar v2.0](http://www.seeedstudio.com/depot/Grove-LED-Bar-v20-p-2474.html) 1 [ Read Here](/Grove-LED_Bar "Grove - LED Bar")
[Grove - Moisture Sensor](http://www.seeedstudio.com/depot/Grove-Moisture-Sensor-p-955.html?cPath=25_27) 1 [ Read Here](/Grove-Moisture_Sensor "Grove - Moisture Sensor")
[Grove - Touch Sensor](http://www.seeedstudio.com/depot/Grove-Touch-Sensor-p-747.html?cPath=85_94) 1 [ Read Here](/Grove-Touch_Sensor "Grove - Touch Sensor")
[Grove - Temperature Sensor](http://www.seeedstudio.com/depot/Grove-Temperature-Sensor-p-774.html?cPath=25_125) 1 [ Read Here](/Grove-Temperature_Sensor_V1.2 "Grove - Temperature Sensor V1.2")
[Grove - OLED Display](http://www.seeedstudio.com/depot/Grove-OLED-Display-112-p-781.html?cPath=34_36) 1.12’’ 1 [ Read Here](/Grove-OLED_Display_0.96inch "Grove - OLED Display 0.96")
[Grove - Loudness Sensor](http://www.seeedstudio.com/depot/Grove-Loudness-Sensor-p-1382.html?cPath=25_128) 1 [ Read Here](/Grove-Loudness_Sensor "Grove - Loudness Sensor")
Micro USB Cable - 48cm 1

Features

  • Easy, complete and powerful development platform(LinkIt™ ONE).

  • Grove system with various functional modules.

  • Confidential communication between you application(web application, mobile apps, or controlling device) and you remote devices(sensors, actuators, embedded devices, or smart appliances) through AWS authorization service.

  • Leverage applications to AWS computing platform.

  • For building function-rich, edging and fantasy applications belong to future.

Get started

Configuring Your AWS IoT Service

At the very beginning, we need to get an AWS IoT service account, and do some configuring.

  • Create an AWS Account

  • Go to AWS IoT Console and open the AWS IoT Dashboard

    1. Click the Services on the top-left corner, and then click on AWS IoT, as shown at below image.

2. Click **Get started** button.

3. Click on **Create a Resource** and then click **Creat a thing**.

4. Click on **Connect a device**.

5. Select **Embedded C** and Click on **Generate certificate** and policy. Click links to download keys and certificate which will be used later.

6. Then we will get some code as shown at below. Copy the code into an empty document. We will use these code later. Then click on Return to Thing Detail.

Setup your LinkIt ONE development environment

This tutorial is under Windows(Windows 7 or above) system and Arduino IDE 1.5.7 with LinkIt SDK 1.1.17.

Note: This Version support Arduino IDE 1.5.7(And Arduino IDE 1.6.5) and LinkIt SDK 1.1.17 only.

Download example and run

AWS IoT Services support for the LinkIt ONE development board enables secure communication between smart projects and Amazon’s IoT optimized cloud. AWS IoT Services uses message broker(MQTT broker) and HTTP as its communication protocols. To support this on the LinkIt ONE development board the mbed TLS library for LinkIt ONE (a version of the mbed TLS library) is provided to offer Transport Layer Security (TLS). This library easily integrates with new and existing (embedded) applications and provides the building blocks for secure communication, cryptography, and key management.

  • Download sketch here

  • Then click Download ZIP to download the code. The code you downloaded is not an Arduino library, it’s a sketchbook, which had included all the library the project need.

Unzip the file you had downloaded from Github, you will get a folder named aws_mbedtls_mqtt-master, remove “-master” in the file name.

Configure Arduino IDE

1. Open your Arduino IDE(1.5.7), click File > Preferences > Sketchbook Location, browse to the folder we had mentioned above - ArduinoPhone-master. Then click OK to save it.

2. Close and relaunch Arduino IDE, click File > Sketchbook > aws_paho_shadow, then the code will be loaded.

Put key file into Storage of LinkIt ONE

1. The application development for AWS IoT Services is performed in the Arduino IDE. Before upload the sketch, add the certificates (.key or .crt files) created in section creating a certificate for a device or application communication into the LinkIt ONE development board's flash storage as follows.

Switch it into Mass Storage mode, as shown below. You need to disconnect power if no new-plugged-driver exists on your desktop OS.

2. Navigate to Computer, then Devices and Removable Storage. Open the removable disk drive corresponding to the LinkIt ONE development board.

3. Copy the keys and certificates files we download from AWS IoT into the disk.

And in the code we had downloaded, there’s file named VeriSign-Class 3-Public-Primary-Certification-Authority-G5 (1).pem in \aws_mbedtls_mqtt\root_cert in, copy it to the Remove Disk as well, and rename it to root-CA.crt

Then switch to UART mode( corner-most section of LinkIt ONE board).

Modify a little the code

Click File>Sketchbook>aws_paho_shadow to open the code.

1. Find the code below at aws_paho_shadow.h.

2. Recall to when we create a thing at AWS IoT:

Copy the code and replace it in aws_paho_shadow.h.

3. Configure your Wi-Fi AP:

4. Run win+R, enter cmd, and **ping** the address of AWS_IOT_MQTT_HOST
ping A2DWFZYZMAZJGZ.iot.us-east-1.amazonaws.com

Note that You need to replace the A2DWFZYZMAZJGZ.iot.us-east-1.amazonaws.com with the constant AWS_IOT_MQTT_HOST ‘s value, which can find in the previously copied code.

You will get:

And modify IP_ADDRESS(line 40) to this line of numbers. (Here is 54.164.100.76)

Hardware connection

Material required:

Upload code

Tip: refer to here for any library file(or header file) missing error prompted. Connect you LinkIt ONE to PC, and remember to insert the Wi-Fi antenna first. Open your Device Manage, you will find there are 2 COM Ports:

Click Tools>Board and choose LinkIt ONE. Click Tool>Ports and choost the number of MTK USB Debug Port. Finally, click Upload button to Upload the code.

Check the output

Note that you have to set antenna connected. Refer to here.

1. Change Arduino IDE Ports to MTK USB Moden Port, and open the Serial Monitor and set baud rate to 9600.

2. When you got _**...X.509 certificazte... ok**_, it means your device had connected to AWS successful. If there's something wrong, please re-power LinkIt ONE and try again.

Then let’s open AWS IoT website, sign in to your account. And click the thing you created minutes ago:

You will find a control panel on the right side.

You can check the status of Touch Sensor now. Try press the Touch Sensor, and update it.

3. You will find the status of Touch had changed. Then let's try to control the LED Bar. Click Update shadow.

4. And replace the code with below code(replace all existing code):
    {
      "desired": {
        "ledBarStatus": 5
      },
      "reported": {
        "Touch": false,
        "ledBarStatus": 0
      }
    }
5. Then click Update shadow, your LED Bar will change to Level 5.

Resource

Help us make it better

Thank you for choosing Seeed. A couple of months ago we initiated a project to improve our documentation system. What you are looking at now is the first edition of the new documentation system. Comparing to the old one, here is the progresses that we made:

  • Replaced the old documentation system with a new one that was developed from Mkdocs, a more widely used and cooler tool to develop documentation system.
  • Integrated the documentation system with our official website, now you can go to Bazaar and other section like Forum and Community more conveniently.
  • Reviewed and rewrote documents for hundreds of products for the system’s first edition, and will continue migrate documents from old wiki to the new one.

An easy-to-use instruction is as important as the product itself. We are expecting this new system will improve your experience when using Seeed’s products. However since this is the first edition, there are still many things need to improve, if you have any suggestions or findings, you are most welcome to submit the amended version as our contributor or give us suggestions in the survey below, Please don’t forget to leave your email address so that we can reply.

Happy hacking