Skip to content

Commit

Permalink
Adding v2.0.0-rc1 files
Browse files Browse the repository at this point in the history
  • Loading branch information
David Cowden authored and David Cowden committed Dec 23, 2016
1 parent 90496bc commit fa0f823
Show file tree
Hide file tree
Showing 79 changed files with 13,751 additions and 5,385 deletions.
Binary file added documents/images/configurationSelect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions documents/iot-ethernet-firmware-compile-and-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ This document will show you where to find the latest _released_ version of the f
You will need the following Microchip development tools to program and develop with the Microchip IoT Ethernet.

- Download the latest project for IoT Ethernet from here: [IoT Ethernet Project](https://github.com/MicrochipTech/aws-iot-firmware-pic32mz/releases/latest)
- Download and install Microchip MPLAB<sup>&reg;</sup> Harmony Integrated Software Framework v1.08.01 for your OS from here: [Harmony](http://www.microchip.com/mplab/mplab-harmony)
- Download and install Microchip MPLAB<sup>&reg;</sup> Harmony Integrated Software Framework v1.09 for your OS from here: [Harmony](http://www.microchip.com/mplab/mplab-harmony)
- Download and install Microchip MPLAB<sup>&reg;</sup> X IDE for your OS from here:
[Microchip MPLAB<sup>&reg;</sup> X IDE](http://www.microchip.com/mplabx) (3.35 tested)
- Download and install the v1.42 XC32 compiler for your OS from here: [Microchip MPLAB<sup>&reg;</sup> XC32 Compiler](http://www.microchip.com/xc32)
[Microchip MPLAB<sup>&reg;</sup> X IDE](http://www.microchip.com/mplabx) (3.40 Required)
- Download and install the v1.42 XC32 compiler for your OS from here: [Microchip MPLAB<sup>&reg;</sup> XC32 Compiler](http://www.microchip.com/xc32)

More information about Microchip tools can be found on [Microchip's developer help site](http://microchip.wikidot.com/swtools:start)

Expand All @@ -32,8 +32,10 @@ Example below is shown on MAC OS X, these instructions may vary slightly on diff
- Navigate to: ` <path-to-your-project>/aws-iot-firmware-pic32mz/software/aws-iot-ethernet/firmware`
- Select the project __aws-iot-ethernet.X__
- With your project opened, right click on the project __aws-iot-ethernet__ in the Projects tab and select __Set as Main Project__
- Select the configuration for the board you wish to program from the dropdown box at the top.
![](images/configurationSelect.png)
- Follow these directions to install the Microchip Harmony Configurator (MHC): [Steps to Install MHC](http://ww1.microchip.com/downloads/en/DeviceDoc/MPLAB%20Harmony%20Configurator%20(MHC)%20and%20MPLAB%20Harmony%20Graphics%20Composer.pdf)
- Open the MHC by clicking __Tools -> Embedded -> MPLAB Harmony Configurator__
- Open the MHC by clicking __Tools -> Embedded -> MPLAB Harmony Configurator__
- The MHC will prompt asking to choose a Harmony framework to use, select "Yes" and select the location of your Harmony install and click "OK"
- The MHC will then ask if you want to open the configuration file __IoT-Ethernet.mhc__ for the __aws-iot-ethernet__ project, select "Open" to proceed.
- With the new Harmony framework selected for your project, you will need to regenerate code by clicking the generate code button. ![](images/generateCode.png)
Expand Down
2 changes: 1 addition & 1 deletion documents/iot-ethernet-mplab-ipe.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ You will need the following Microchip development tools to program the Microchip

- Download the latest HEX file for IoT Ethernet from here: [IoT Ethernet Project](https://github.com/MicrochipTech/aws-iot-firmware-pic32mz/releases/latest)
- Download and install Microchip MPLAB<sup>&reg;</sup> X IDE for your OS from here:
[Microchip MPLAB<sup>&reg;</sup> X IDE](http://www.microchip.com/mplabx) (3.35 tested)
[Microchip MPLAB<sup>&reg;</sup> X IDE](http://www.microchip.com/mplabx)
- PICKit<sup>&trade;</sup> 3 In-Circuit Debugger/Programmer (or other programmer)

---
Expand Down
148 changes: 8 additions & 140 deletions documents/iot-ethernet-out-of-box-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,157 +16,25 @@ You will need the following Microchip development tools to run out of box demo
- Download and install [Insight on Things](https://github.com/MicrochipTech/aws-iot-insight-on-things-desktop-app) desktop application; [Download latest version](https://github.com/MicrochipTech/aws-iot-insight-on-things-desktop-app/releases/latest)
- To learn more about building the project from source or just upgrading the firmware, read [IoT Ethernet Firmware Compiling and Programing](iot-ethernet-firmware-compile-and-program.md) in our documents folder

#### AWS Tools and Applications
- You will need an AWS account to use AWS IoT.
- For more information how to setup an AWS Account please go to [AWS](http://aws.amazon.com) main page
- Please check with your IT or IS department on your company's policies on using cloud computing, or to see if you have a corporate AWS account that should be used.

- To use the AWS IoT services you will need to make use of _AWS Command Line Interface_ (awscli) tool. For more information on how to install, configure, and use the awscli tool please go to [AWS Command Line Interface User Guide](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html).

> NOTE: If you are a **Microchip Employee** we have a corporate AWS account that must be used. To setup your AWS IoT device please go to https://setup.iot.microchip.com for more information
---
### Setting Up the AWS IoT Service

To setup your AWS IoT service to work with the _IoT Ethernet Kit_ you will need to work with the awscli that you installed in the previous section.

1. Using the awscli you will need to find the endpoint that will be used for your AWS IoT account. To do this run the following command in your terminal/command window.

```
aws iot describe-endpoint
```
You will receive the following back that you will need to add to the firmware in the next section. The output will look like: `<random-string>.iot.us-east-1.amazonaws.com`
- Create certificates that will be used in the application firmware by running the following command in your terminal/command prompt window:

```
aws iot create-keys-and-certificate --set-as-active --output text
```
> You will need to copy the output on the terminal/command window to text files for the certs and private key. Please also note the _certificate arn_ value that will be used later in this section; it is the first long string of text that you will seen on the screen.
>
> NOTE: this is the only time that you will be able to see this information and make sure there is no text or spaces at the beginning of each of the files you create. For example in the output below you will need to remove the `KEYPAIR` text and spaces so that the first line of the private key starts with the dashes:
>
>```
>...
>Gmh/2ib2NsA8Tf+8drTQXf3gQ4oemdOfnA4IlXiFGA9QAP9i/krzYvaVAlSogLWh
>wRHaP1hzPuS9+0UjZkS1Uzyfqmd+vR4Om8S+t2VmEwYMJMG3mUaFXdhBhMDJ
>-----END CERTIFICATE-----
>
>KEYPAIR -----BEGIN RSA PRIVATE KEY-----
>MIIEpAIBAAKCAQEAynvp1r7jl9HzbAVCgVWzYmKu4O6nNM4wBZQ1YjHpSOL1+joF
>KKcXM8eS8jmUbHRJ84JeDrr9A50ok1cyUCDBPkf6c7VO4xWGzXruR3WoVjRYq3vc
>...
>```
- Create and attach the following policy that will allow your thing to publish and subscribe to the AWS IoT service
- First create a file that will have the policy information in it and save it to you computer:
> NOTE: Make sure you replace `<AWS-IoT Region>` and `<AWS Account Number>` with the AWS-IoT region and your AWS account number
```
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"iot:Connect"
],
"Resource": [
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:client/${iot:ClientId}"
]
},
{
"Effect": "Allow",
"Action": [
"iot:Publish"
],
"Resource": [
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topic/$aws/things/${iot:ClientId}/shadow/update",
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topic/$aws/things/${iot:ClientId}/shadow/get"
]
},
{
"Effect": "Allow",
"Action": [
"iot:Subscribe"
],
"Resource": [
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topicfilter/$aws/things/${iot:ClientId}/shadow/update/delta",
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topicfilter/$aws/things/${iot:ClientId}/shadow/update/accepted",
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topicfilter/$aws/things/${iot:ClientId}/shadow/update/rejected",
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topicfilter/$aws/things/${iot:ClientId}/shadow/get/accepted",
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topicfilter/$aws/things/${iot:ClientId}/shadow/get/rejected"
]
},
{
"Effect": "Allow",
"Action": [
"iot:Receive"
],
"Resource": [
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topic/$aws/things/${iot:ClientId}/shadow/update/delta",
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topic/$aws/things/${iot:ClientId}/shadow/update/accepted",
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topic/$aws/things/${iot:ClientId}/shadow/update/rejected",
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topic/$aws/things/${iot:ClientId}/shadow/get/accepted",
"arn:aws:iot:<AWS-IoT Region>:<AWS Account Number>:topic/$aws/things/${iot:ClientId}/shadow/get/rejected"
]
}]
}
```
- Load the policy to the AWS IoT services with the following command:

```
aws iot create-policy --policy-name 'MQTTandShadowPolicy' --policy-document file://<path-to-your-policy-document>
```
- You will need to attached this policy to a principal to allow the cert the rights to publish and subscribe to topics:

```
aws iot attach-principal-policy --principal '<certificate-arn>' --policy-name 'MQTTandShadowPolicy'
```
- Create a thing shadow based on the MAC address of the board:

```
aws iot create-thing --thing-name '<MAC Address of the board>'
```

---
### Running the Demo
There are two parts to running the demo. First you have to commission the demo so it knows how to talk to your AWS Account that you setup in the [Setting Up the AWS IoT Service](Setting Up the AWS IoT Service) section of this out of box guide. Second is sending and receiving data from AWS IoT.
There are two parts to running the demo. First you have to commission the demo so it knows how to talk to your AWS Account. Second is sending and receiving data from AWS IoT.

#### Commissioning
To setup and run the demo follow these instructions:

1. Plug the IoT Ethernet Kit into a router or switch using an ethernet cable
- Power the IoT Ethernet Kit by connecting the supplied Micro-USB cable to a power source and setting the power switch on the board to USB
- Connect your computer to the same network that the IoT Ethernet Kit is connected
- Your board will register a Multicast DNS (mDNS) name with the local network that will allow you to access a configuration webpage.
- Use a bonjour or multicast DNS service to find your board's IP address and enter the IP address into a web browser. The kit will have a service name such as `xxxxxx_IoT-E` where `xxxxxx` is the last six characters of the kit's MAC address.
- Alternatively you can try entering `xxxxxx_iot-e.local` into a web browser to navigate to the webpage where `xxxxxx` is the last six characters of the MAC address on the board
- Once the web browser finds and displays the IoT Ethernet Kit configuration webpage
- Enter your AWS IoT Endpoint Address that you received from the previous AWS IoT Service Setup section. The endpoint will have the form `<random-string>.iot.us-east-1.amazonaws.com`
- Copy and paste your AWS Certificate into the box labeled AWS Certificate.
- The cert should look like

```
-----BEGIN CERTIFICATE-----
<cert data>
-----END CERTIFICATE-----
```
- Copy and paste your AWS Certificate Private Key into the box labeled AWS Certificate Private Key.
- The key should look like

```
-----BEGIN RSA PRIVATE KEY----
<key data>
-----END RSA PRIVATE KEY-----
```
- Click the __Join__ button and a _Connecting to server_ page will appear showing the endpoint that the IoT Ethernet board will connect to along with the AWS Thing Name (MAC Address).
> NOTE: The information you enter above will be sent in the clear and is not secured as if you where using https; this is an option that you can add to your code later
1. Power the IoT Ethernet Kit by connecting the supplied Micro-USB cable to a computer that will be running the Insight on Things application in the next step and set the power switch on the board to USB.
- Download and install the [Insight on Things](https://github.com/MicrochipTech/aws-iot-insight-on-things-desktop-app) application v2.0.0 or greater.
- Follow the instructions for running the Insight on Things application.
- You will see a LEDs D1-D6 light up while the board gets initial data from the server.
- If not, please see the [Status and Error Code Table](Status and Error Code Table) table below for more information
- If not, please see the [Status and Error Code Table](Status and Error Code Table) table below for more information.
- The board is now connect and running; there are two blue LED status indicator on the board.
- LED D6 will flash briefly when transmitting data
- LED D5 will flash briefly when receiving data
- LED D6 will flash briefly when transmitting data.
- LED D5 will flash briefly when receiving data.

#### Sending and Receiving Data with AWS IoT
This demo is controlled though the AWS IoT shadow registors by the [Insight on Things](https://github.com/MicrochipTech/aws-iot-insight-on-things-desktop-app) desktop application that we provide you. [Click here download the latest version](https://github.com/MicrochipTech/aws-iot-insight-on-things-desktop-app/releases/latest). You will need to follow the README.md guide on the github page to setup this application.
This demo is controlled though the AWS IoT shadow registers by the [Insight on Things](https://github.com/MicrochipTech/aws-iot-insight-on-things-desktop-app) desktop application that we provide you. [Click here download the latest version](https://github.com/MicrochipTech/aws-iot-insight-on-things-desktop-app/releases/latest). You will need to follow the README.md guide on the github page to setup this application.

---

Expand Down
Loading

0 comments on commit fa0f823

Please sign in to comment.