Skip to content

Commit

Permalink
Updating labels to be common with AWS IoT and Insight on Things app. …
Browse files Browse the repository at this point in the history
…Bumping version to 1.1.0. Updated Documentation.
  • Loading branch information
David Cowden authored and David Cowden committed Jun 16, 2016
1 parent 12fa201 commit 39568be
Show file tree
Hide file tree
Showing 14 changed files with 416 additions and 408 deletions.
Binary file added documents/images/merge-close.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/images/mhc-generate-code-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 11 additions & 4 deletions documents/iot-ethernet-firmware-compile-and-program.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ You will need the following Microchip development tools to program and develop w
- 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.07.01 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)
- Download and install the latest 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.26, 3.30 tested)
- Download and install the latest XC32 compiler for your OS from here (Install both v1.40 and v1.40B - Part Patch): [Microchip MPLAB<sup>&reg;</sup> XC32 Compiler](http://www.microchip.com/xc32) (v1.40 with v1.40B part patch tested)

---

### Compiling and programming the IoT Ethernet Board
Test platform is MAC OS X, these instructions may vary slightly on different OS.

#### Compiling the Firmware
1. Extract the zip file downloaded from the git repository to a location of your choice
Expand All @@ -30,10 +31,13 @@ You will need the following Microchip development tools to program and develop w
- 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__
- 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%28MHC%29%20and%20MPLAB%20Harmony%20Graphics%20Composer%20%28v1.07.01%29.pdf)
- Open the MHC; The MHC will prompt asking to choose a Harmony framework to use, select "Yes" and select the location of your v1.07.01 Harmony install and click "OK"
- 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 v1.07.01 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)
- The MHC merge tool will show differences between code sets. Ignore the differences and hit "Close" for each file
- A settings window will pop up, check only the box "Create a backup...": ![](images/mhc-generate-code-settings.png)
- The MHC merge tool will show differences between code sets. Ignore the differences and hit "Close" for each file ![](images/merge-close.png)
- We can now try compiling and programming the code.

#### Programing the IoT Ethernet Board
1. Connect the PICKit&trade; 3 to your computer using the provided USB cable.
Expand All @@ -50,3 +54,6 @@ If you are having trouble, check to make sure that each of the issues bellow are

#### Project won't compile due to missing files
- Often times a project won't compile if you are on a Windows machine due to a limitation in the path length. Windows OS has a max path length of 260 characters, so file paths are sometimes truncated when attempting to compile which leads to files not being found by the compiler. Try putting the project in the topmost directory, usually "C:/". For more information please see [MSDN article from Microsoft](https://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx#maxpath).

#### Project won't compile due to errors such as missing ADCxxx registers
- As of the v1.1.0 release the latest compiler for XC32 is v1.40. This compiler must be updated with the v1.40B which is the "Part Patch". This installer will update your XC32 v1.40 comipler with the required files to compile for the part on the IoT Ethernet Kit. Again, this can be downloaded at [Microchip MPLAB<sup>&reg;</sup> XC32 Compiler](http://www.microchip.com/xc32).
12 changes: 6 additions & 6 deletions documents/iot-ethernet-out-of-box-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,26 +174,26 @@ To setup and run the demo follow these instructions:
- 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 bytes of the MAC address on the board
- 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 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 client certificate into the box labeled Client Public Cert.
- 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 private key into the box labeled Client Private Key.
- 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 full UUID
- 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
- 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
Expand Down Expand Up @@ -223,7 +223,7 @@ If you are having trouble connecting with the starter kit, check to make sure th
- Check that your access point is not blocking MAC addresses.

#### DNS Resolved Failed
- Check that the AWS Endpoint you configured your starter kit with is correct.
- Check that the AWS IoT Endpoint Address you configured your starter kit with is correct.
- Check that you have a valid internet connection on your network

#### Status and Error Code Table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@
<property key="enable-unroll-loops" value="false"/>
<property key="exclude-floating-point" value="false"/>
<property key="extra-include-directories"
value="../src;../src/IoT-Ethernet;../src/system_config/IoT-Ethernet/framework;../src/wolfmqttsdk/;../../../microchip/harmony/v1_07_01_SUBSET;../src/system_config/IoT-Ethernet;../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/framework;../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/third_party/rtos/FreeRTOS/Source/portable/MPLAB/PIC32MZ;../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/third_party/rtos/FreeRTOS/Source/include;../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/third_party/tcpip/wolfssl"/>
value="../src;../src/IoT-Ethernet;../src/system_config/IoT-Ethernet/framework;../src/wolfmqttsdk/;../../../microchip/harmony/v1_07_01_SUBSET;../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/framework;../src/system_config/IoT-Ethernet;../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/third_party/rtos/FreeRTOS/Source/portable/MPLAB/PIC32MZ;../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/third_party/rtos/FreeRTOS/Source/include;../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/third_party/tcpip/wolfssl"/>
<property key="generate-16-bit-code" value="false"/>
<property key="generate-micro-compressed-code" value="false"/>
<property key="isolate-each-function" value="true"/>
Expand All @@ -669,7 +669,7 @@
<property key="additional-options-chop-files" value="false"/>
</C32-AR>
<C32-AS>
<property key="extra-include-directories-for-assembler" value=""/>
<property key="extra-include-directories-for-assembler" value=";"/>
<property key="extra-include-directories-for-preprocessor"
value="../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/third_party/rtos/FreeRTOS/Source/portable/MPLAB/PIC32MZ;../../../../../../../microchip/harmony/v1_07_01_ORIGINAL/third_party/rtos/FreeRTOS/Source/include;../src/system_config/IoT-Ethernet;"/>
</C32-AS>
Expand Down
24 changes: 13 additions & 11 deletions software/aws-iot-ethernet/firmware/src/app.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
APP_DATA appData;
extern APP1_DATA app1Data;

#define APP_HARDWARE "iot_ethernet_dm990004"
#define APP_FIRMWARE_VERSION "1.1.0"

char topic_awsUpdate[128];
char topic_awsUpdateDelta[128];

Expand All @@ -107,7 +110,6 @@ static int mPacketIdLast;
// WolfMQTT Callbacks for network connectivity
int APP_tcpipConnect_cb(void *context, const char* host, word16 port, int timeout_ms)
{

uint32_t timeout = 0;
timeout = SYS_TMR_TickCountGet();
SYS_CONSOLE_PRINT("App: DNS: Resolving host '%s'\r\n", &appData.host);
Expand Down Expand Up @@ -548,7 +550,7 @@ void APP_Tasks ( void )
break;
}

// If user presses switch 2 and 3 on powerup, the configuration will be erased
// If user presses switch 2 and 3 on power up, the configuration will be erased
case APP_NVM_ERASE_CONFIGURATION:
{
if((BSP_SWITCH_StateGet(BSP_SWITCH_3_CHANNEL, BSP_SWITCH_3_PORT) == BSP_SWITCH_STATE_ASSERTED)
Expand All @@ -558,9 +560,9 @@ void APP_Tasks ( void )
APP_NVM_Write(NVM_HOST_ADDRESS_SPACE, appData.host);
APP_NVM_Erase(NVM_CLIENT_CERTIFICATE_SPACE);
APP_NVM_Erase(NVM_CLIENT_KEY_SPACE);
SYS_CONSOLE_MESSAGE("************************************\r\n"
"App: Erasing host and certificates!\r\n"
"************************************\r\n");
SYS_CONSOLE_MESSAGE("***************************************\r\n"
"App: Erasing configuration!\r\n"
"***************************************\r\n");
appData.state = APP_TCPIP_WAIT_INIT;
break;
}
Expand All @@ -571,7 +573,7 @@ void APP_Tasks ( void )
// Load the configuration stored in NVM on powerup
case APP_NVM_LOAD_CONFIGURATION:
{
SYS_CONSOLE_MESSAGE("App: Loading host and certificates from NVM\r\n");
SYS_CONSOLE_MESSAGE("App: Loading AWS IoT Endpoint Address and AWS Certificate/Certificate Private Key\r\n");
APP_NVM_Read(NVM_HOST_ADDRESS_SPACE, appData.host, sizeof(appData.host));
APP_NVM_Read(NVM_CLIENT_CERTIFICATE_SPACE, appData.clientCert, sizeof(appData.clientCert));
APP_NVM_Read(NVM_CLIENT_KEY_SPACE, appData.clientKey, sizeof(appData.clientKey));
Expand Down Expand Up @@ -678,7 +680,7 @@ void APP_Tasks ( void )
xQueueSendToFront(app1Data.lightShowQueue, &lightShowVal, 1);
SYS_CONSOLE_PRINT("App: Board online. mDNS online. IP addr %d.%d.%d.%d online. All systems nominal.\r\n",
ipAddr.v[0],ipAddr.v[1],ipAddr.v[2],ipAddr.v[3]);
SYS_CONSOLE_PRINT("App: MAC Address '%s'\r\n", appData.uuid);
SYS_CONSOLE_PRINT("App: AWS Thing Name (MAC Address) '%s'\r\n", appData.uuid);
SYS_CONSOLE_MESSAGE("App: Waiting for configuration...\r\n");
appData.state = APP_TCPIP_WAIT_CONFIGURATION;
}
Expand Down Expand Up @@ -710,11 +712,11 @@ void APP_Tasks ( void )
SYS_CONSOLE_MESSAGE("App: Writing configuration to NVM - failed\r\n");
while(1);
}
SYS_CONSOLE_PRINT("App: Configured host '%s'\r\n", appData.host);
SYS_CONSOLE_PRINT("App: Configured AWS IoT Endpoint Address '%s'\r\n", appData.host);
}
else if(validConfig)
{
SYS_CONSOLE_PRINT("App: Found configuration - host '%s'\r\n", appData.host);
SYS_CONSOLE_PRINT("App: Found configuration - AWS IoT Endpoint Address '%s'\r\n", appData.host);
}
appData.lightShowVal = BSP_LED_INTIAL_CONNECT;
xQueueSendToFront(app1Data.lightShowQueue, &appData.lightShowVal, 1);
Expand Down Expand Up @@ -851,8 +853,8 @@ void APP_Tasks ( void )
publish.topic_name = topic_awsUpdate;
publish.packet_id = mqttclient_get_packetid();
char publishPayload [MAX_BUFFER_SIZE];
sprintf(publishPayload, "{\"state\":{\"reported\":{\"led1\":\"%s\",\"led2\":\"%s\",\"led4\":\"%s\",\"led3\":\"%s\"}}}",
appData.led1val ? "on" : "off", appData.led2val ? "on" : "off", appData.led3val ? "on" : "off", appData.led4val ? "on" : "off");
sprintf(publishPayload, "{\"state\":{\"reported\":{\"led1\":\"%s\",\"led2\":\"%s\",\"led4\":\"%s\",\"led3\":\"%s\",\"hardware\":{\"type\":\"%s\",\"firmware_version\":\"%s\"}}}}",
appData.led1val ? "on" : "off", appData.led2val ? "on" : "off", appData.led3val ? "on" : "off", appData.led4val ? "on" : "off", APP_HARDWARE, APP_FIRMWARE_VERSION);
publish.buffer = (byte *)publishPayload;
appData.led1val ? BSP_LEDOn(BSP_LED_1_CHANNEL, BSP_LED_1_PORT) : BSP_LEDOff(BSP_LED_1_CHANNEL, BSP_LED_1_PORT);
appData.led2val ? BSP_LEDOn(BSP_LED_2_CHANNEL, BSP_LED_2_PORT) : BSP_LEDOff(BSP_LED_2_CHANNEL, BSP_LED_2_PORT);
Expand Down
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ fieldset textarea {
padding-right: 10px;
padding-top: 10px;
padding-bottom: 5px;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
font-size: 12pt;
-webkit-transition: height .5s;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div id="footer">Copyright &copy; 2015 Microchip Technology, Inc. Ver 1.0.0</div>
<div id="footer">Copyright &copy; 2016 Microchip Technology, Inc. Ver 1.1.0</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<div class="rounded_container" id="network_config">
<div id="column_wrap">
<div id="column1">
<p align="right">Server Address:</p>
<p align="right">Client Public Cert:</p>
<p align="right">Client Private Key:</p>
<p align="right">AWS IoT Endpoint Address:</p>
<p align="right">AWS Certificate:</p>
<p align="right">AWS Certificate Private Key:</p>
</div>
<div id="column2">
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ <h2>Connecting to server...</h2>

<p>The IoT Ethernet board is now connecting to your AWS IoT Endpoint</p>

<p>This is the server you entered and your board's UUID:</p>
<p>This is the server you entered and your board's AWS Thing Name (MAC Address):</p>
<ul>
<li><b>AWS IoT Endpoint:</b> ~remoteServer~</li>
<li><b>UUID:</b> ~uuid~</li>
<li><b>AWS IoT Endpoint Address:</b> ~remoteServer~</li>
<li><b>AWS Thing Name (MAC Address):</b> ~uuid~</li>
</ul>
</div>
</div>
Expand Down
Loading

0 comments on commit 39568be

Please sign in to comment.