<commit_before><h1 align = "center">AWS IoT Arduino Yún SDK</h1>

## What is AWS IoT Arduino Yún SDK

The AWS-IoT-Arduino-Yún-SDK allows developers to connect their Arduino Yún compatible Board to AWS IoT. By connecting the device to the AWS IoT, users can securely work with the message broker, rules and the Thing Shadow provided by AWS IoT and with other AWS services like AWS Lambda, Amazon Kinesis, Amazon S3, etc.

* [Overview](#overview)
* [Installation](#installation)
* [API documentation](#api)
* [Using the SDK](#usingthesdk)  
* [Example](#example)
* [Error code](#errorcode)
* [Support](#support)

****

<a name="overview"></a>
## Overview
This document provides step by step instructions to install the Arduino Yún SDK and connect your device to the AWS IoT.  
The AWS-IoT-Arduino-Yún-SDK consists of two parts, which take use of the resources of the two chips on Arduino Yún, one for native Arduino IDE API access and the other for functionality and connections to the AWS IoT built on top of paho-mqtt python package.
### MQTT connection
The AWS-IoT-Arduino-Yún-SDK provides APIs to let users publish messages to AWS IoT and subscribe to MQTT topics to receive messages transmitted by other devices or coming from the broker. This allows to interact with the standard MQTT PubSub functionality of AWS IoT. For more information on MQTT protocol, please see it [here](http://docs.aws.amazon.com/iot/latest/developerguide/protocols.html).
### Thing shadow
The AWS-IoT-Arduino-Yún-SDK also provides APIs to proviade access to thing shadows in AWS IoT. Using this SDK, users will be able to sync the data/status of their devices as JSON files to the cloud and respond to change of status requested by other applications. For more information on Thing Shadow, please see it [here](http://docs.aws.amazon.com/iot/latest/developerguide/iot-thing-shadows.html).

****

<a name="installation"></a>
## Installation
### Download AWS-IoT-Arduino-Yún-SDK  
Click [here](https://s3.amazonaws.com/aws-iot-device-sdk-arduino-yun/AWS-IoT-Arduino-Yun-SDK-1.0.0.zip) to download AWS-IoT-Arduino-Yún-SDK zip package and extract it to `AWS-IoT-Arduino-Yun-SDK` on your computer.
### Set up your Arduino Yún Board
Please follow the instructions from official website: [Arduino Yún Guide](https://www.arduino.cc/en/Guide/ArduinoYun).

### Installation on Mac OS/Linux
Before proceeding to the following steps, please make sure that you have `expect` installed on your computer and correctly installed the Arduino IDE.  
To install `expect`:  
For Ubuntu, simply run `sudo apt-get` install `expect`.  
For Mac, `expect` is installed as default.  
For Arduino IDE installation on Linux, please visit [here](http://playground.arduino.cc/Linux/All).

1. Setup the Arduino Yún board and connect it to WiFi. Obtain its IP address and password.  
2. Make sure your computer is connected to the same network (local IP address range).  
3. Download the AWS IoT CA file from [here](https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem).
4. Put your AWS IoT CA file, private key and certificate into `AWS-IoT-Arduino-Yun-SDK/certs`.  
5. Under `AWS-IoT-Arduino-Yun-SDK`, Modify `mySCP.sh` and `mySETUP.sh` and replace `[your_boards_IP]` with your board’s IP address and `[your_boards_IP]` with your password (default for Arduino Yún: “arduino”).  
6. Open a terminal, cd to `AWS-IoT-Arduino-Yun-SDK`. Do `chmod 755 mySCP.sh` and execute it as `./mySCP.sh`.  
	This will upload the python code and keys, CA files and certificates to openWRT running on the more powerful microcontroller on you Arduino Yún board.
7. In the same directory, do `chmod 755 mySETUP.sh` and execute it as `./mySETUP.sh`.  
	This will download and install libraries for openWRT to implement the necessary scripting environment as well as communication protocols.<commit_msg>Adding link to Paho.<commit_after><h1 align = "center">AWS IoT Arduino Yún SDK</h1>

## What is AWS IoT Arduino Yún SDK

The AWS-IoT-Arduino-Yún-SDK allows developers to connect their Arduino Yún compatible Board to AWS IoT. By connecting the device to the AWS IoT, users can securely work with the message broker, rules and the Thing Shadow provided by AWS IoT and with other AWS services like AWS Lambda, Amazon Kinesis, Amazon S3, etc.

* [Overview](#overview)
* [Installation](#installation)
* [API documentation](#api)
* [Using the SDK](#usingthesdk)  
* [Example](#example)
* [Error code](#errorcode)
* [Support](#support)

****

<a name="overview"></a>
## Overview
This document provides step by step instructions to install the Arduino Yún SDK and connect your device to the AWS IoT.  
The AWS-IoT-Arduino-Yún-SDK consists of two parts, which take use of the resources of the two chips on Arduino Yún, one for native Arduino IDE API access and the other for functionality and connections to the AWS IoT built on top of the [Eclipse Paho](https://eclipse.org/paho/clients/python/) paho-mqtt python package.
### MQTT connection
The AWS-IoT-Arduino-Yún-SDK provides APIs to let users publish messages to AWS IoT and subscribe to MQTT topics to receive messages transmitted by other devices or coming from the broker. This allows to interact with the standard MQTT PubSub functionality of AWS IoT. For more information on MQTT protocol, please see it [here](http://docs.aws.amazon.com/iot/latest/developerguide/protocols.html).
### Thing shadow
The AWS-IoT-Arduino-Yún-SDK also provides APIs to proviade access to thing shadows in AWS IoT. Using this SDK, users will be able to sync the data/status of their devices as JSON files to the cloud and respond to change of status requested by other applications. For more information on Thing Shadow, please see it [here](http://docs.aws.amazon.com/iot/latest/developerguide/iot-thing-shadows.html).

****

<a name="installation"></a>
## Installation
### Download AWS-IoT-Arduino-Yún-SDK  
Click [here](https://s3.amazonaws.com/aws-iot-device-sdk-arduino-yun/AWS-IoT-Arduino-Yun-SDK-1.0.0.zip) to download AWS-IoT-Arduino-Yún-SDK zip package and extract it to `AWS-IoT-Arduino-Yun-SDK` on your computer.
### Set up your Arduino Yún Board
Please follow the instructions from official website: [Arduino Yún Guide](https://www.arduino.cc/en/Guide/ArduinoYun).

### Installation on Mac OS/Linux
Before proceeding to the following steps, please make sure that you have `expect` installed on your computer and correctly installed the Arduino IDE.  
To install `expect`:  
For Ubuntu, simply run `sudo apt-get` install `expect`.  
For Mac, `expect` is installed as default.  
For Arduino IDE installation on Linux, please visit [here](http://playground.arduino.cc/Linux/All).

1. Setup the Arduino Yún board and connect it to WiFi. Obtain its IP address and password.  
2. Make sure your computer is connected to the same network (local IP address range).  
3. Download the AWS IoT CA file from [here](https://www.symantec.com/content/en/us/enterprise/verisign/roots/VeriSign-Class%203-Public-Primary-Certification-Authority-G5.pem).
4. Put your AWS IoT CA file, private key and certificate into `AWS-IoT-Arduino-Yun-SDK/certs`.  
5. Under `AWS-IoT-Arduino-Yun-SDK`, Modify `mySCP.sh` and `mySETUP.sh` and replace `[your_boards_IP]` with your board’s IP address and `[your_boards_IP]` with your password (default for Arduino Yún: “arduino”).  
6. Open a terminal, cd to `AWS-IoT-Arduino-Yun-SDK`. Do `chmod 755 mySCP.sh` and execute it as `./mySCP.sh`.  
	This will upload the python code and keys, CA files and certificates to openWRT running on the more powerful microcontroller on you Arduino Yún board.
7. In the same directory, do `chmod 755 mySETUP.sh` and execute it as `./mySETUP.sh`.  
	This will download and install libraries for openWRT to implement the necessary scripting environment as well as communication protocols.
{'fraction_non_alphanumeric': 0.09223547323014464, 'fraction_numerical': 0.006089824917533621, 'mean_word_length': 4.447823082239116, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 7, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5842213', 'n_tokens_mistral': 2492, 'n_tokens_neox': 2304, 'n_words': 1001}