Skip to content

Commit 5aea48c

Browse files
author
Microchip Technology
committed
enable pullup on rx pin;update iot module reference for new version MCU16MID-602;update readme MCU16MID-604;update ivy version MCU16MID-605;MCU16MID-604 re add pictures;
1 parent b7b8305 commit 5aea48c

File tree

8 files changed

+134
-55
lines changed

8 files changed

+134
-55
lines changed

PICIoT.X/mcc_generated_files/cli/cli.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static uint8_t index = 0;
7070
static bool commandTooLongFlag = false;
7171

7272
const char * const cli_version_number = "1.0";
73-
const char * const firmware_version_number = "2.0.1";
73+
const char * const firmware_version_number = "2.0.2";
7474

7575
static void command_received(char *command_text);
7676
static void reset_cmd(char *pArg);

PICIoT.X/mcc_generated_files/pin_manager.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void PIN_MANAGER_Initialize (void)
8585
IOCPDC = 0x0000;
8686
IOCPUA = 0x1480;
8787
IOCPUB = 0x0000;
88-
IOCPUC = 0x0000;
88+
IOCPUC = 0x0200;
8989

9090
/****************************************************************************
9191
* Setting the Open Drain SFR(s)

PICIoT.X/nbproject/Makefile-genesis.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
#Mon Mar 09 20:39:46 UTC 2020
2+
#Fri Mar 13 05:33:06 UTC 2020
33
default.Pack.dfplocation=/opt/microchip/mplabx/v5.25/packs/Microchip/PIC24F-GA-GB_DFP/1.0.67
44
default.com-microchip-mplab-nbide-toolchainXC16-XC16LanguageToolchain.md5=e5736228501ef0825fa503ed0aa3576c
55
default.languagetoolchain.dir=/opt/microchip/xc16/v1.41/bin

README.md

+131-52
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,82 @@ Devices: \| **PIC24FJ128GA705(MCU)** \| **WINC1510(Wi-Fi®)** \| **ECC608(Crypto
77
![Board](images/boardPIC.png)
88

99
---
10+
## Getting Started Guide
11+
+ Below describes the Out of Box (OOB) operation of the development board.
12+
+ More detailed information can be found further below this document.
13+
+ For accessing production hex files, release notes, and Known Issues please click the [release tab](https://github.com/microchip-pic-avr-solutions/pic-iot-aws-sensor-node/releases)
14+
15+
### Materials
16+
+ Internet Connection Device
17+
+ Wifi / Network Device
18+
+ Personal Computer
19+
+ Serial Terminal (optional)
20+
21+
### Operation
22+
1. Connect board to PC using USB-micro cable.
23+
+ The LEDs will **Cycle** upon startup: **BLUE-->GREEN-->YELLOW-->RED**.
24+
+ Short delay: **BLUE-->GREEN-->YELLOW-->RED**.
25+
26+
2. The **BLUE LED** will begin to blink, this indicates the board is attempting to join the local **ACCESS POINT**.
27+
28+
3. On connecting to **Access Point** the blinking will stop, and the **LED** will become **STATIC**.
29+
+ By **Default**, the device will attempt to use:
30+
+ **WPA/WPA2**
31+
+ Network Name: **MCHP.IOT**
32+
+ Password: **microchip**
33+
34+
4. To use custom Credentials, the board will appear on the PC enumerated as a mass storage device under the name **CURIOSITY**.
35+
+ Credentials can be downloaded as the file **WIFI.CFG** using the **CLICK-ME.HTM** file stored on the **CURIOSITY** device.
36+
37+
![URL Hosted Credentials](images/wifiCredentialsWeb.png)
38+
39+
5. After becoming connected to the **ACCESS POINT**, the **GREEN LED** will begin to blink, this indicates the board is attempting to establish a web connection with cloud providing service.
40+
+ **GREEN LED** will stop blinking and remain **ON** when connection is established.
41+
+ Using the in-module TCP/IP stack pre-configured with provisioned credentials; the device establishes a **MQTT** connection with the IoT Broker provider (AWS).
42+
43+
![Status Display](images/awsConnection.png)
44+
45+
6. After successfully establishing MQTT connection, the **YELLOW LED** will blink. (250 mSec)
46+
+ Indicating data exchanged between the End-Device (PIC-IoT), and BROKER (AWS). (every (1) Sec)
47+
48+
7. Connect to the www.avr-iot.com/aws/**{thingName}**, or www.pic-iot.com/aws/**{thingName}**, device specific website to view publish/subscribe data.
49+
+ **{thingName}** is the unique identifier for the development board.
50+
+ This page can be also be found via launching the **CLICK-ME.HTM** file on the **CURIOSITY** device.
51+
+ This page can be also be found by scanning the QR code on the back of the development board.
52+
53+
![Connecting](images/picawsLeverage.png)
54+
55+
8. There will be (2) scrolling graphs visible.
56+
+ (1) shows temperature sensor
57+
+ (1) shows the light sensor value.
58+
59+
![AwsGraphs](images/awsGraphs.png)
60+
61+
9. Click on the **What's Next** button beneath the graphs to peform action(s) from the cloud.
62+
63+
10. Select the **Implement a Cloud-Controlled Actuator** to demostrate cloud performed behaviors.
64+
65+
![AwsNext](images/awsNext.png)
66+
67+
11. Click on the **Learn More** button to expand page interface.
68+
+ Scroll to the bottom of **Step 5** where a panel will read **Control Your Device**.
69+
70+
![AwsLearnMore](images/awsLearnMore.png)
71+
72+
12. By default only a **Toggle** feature is demostrated.
73+
+ **Custome implmentations are described further on above the panel.**
74+
75+
![AwsControl](images/awsControl.png)
76+
77+
13. Trigger an action by simply pressing the **Send to device** button beneath actuator fields.
78+
+ All Actuator data is sent as one message when the **Send to device** button is pressed.
79+
+ When **Toggled** the **YELLOW LED** will remain on for **(2) Seconds**.
80+
+ When unselected, the **YELLOW LED** will remain off for **(2) Seconds**.
81+
+ Because **Toggle** manipulates the **desired** state; the state **must** be changed to observe the behavior.
82+
83+
14. If desired, additional basic messaging can be seen to a connected Serial Terminal at the expected 9600 baud rate.
84+
85+
![DeltaSubTerminalMessage](images/DeltaToggle.png)
1086

1187
## Requirements
1288

@@ -145,7 +221,54 @@ General Out-Of-Box operation is as described below:
145221

146222
---
147223

148-
## Out Of Box (OOB) Operation
224+
## Understanding the Device Shadow in AWS
225+
226+
1. The AWS broker allows for the use of Shadow Topics. The Shadow Topics are used to retain a specific value within the Broker, so End-Device status updates can be managed.
227+
+ Shadow Topics are used to restore the state of variables, or applications.
228+
+ Shadow Topics retain expected values, and report if Published data reflects a difference in value.
229+
+ When difference exist, status of the delta is reported to those subscribed to appropriate topic messages.
230+
231+
![ShadowTopic UserStory](images/AWS_ShadowUserStory.png)
232+
233+
2. Updates to the device shadow are published on $aws/things/{ThingName}/shadow/update topic.
234+
When a message is sent to the board by changing the value of the **toggle** fiels in **Control Your Device** section:
235+
+ This message is published on the $aws/things/{ThingName}/shadow/update topic.
236+
+ If the curent value of **toggle** in the device shadow is different from the **toggle** value present in the AWS Device Shadow, the AWS Shadow service reports this change to the device by publishing a message on $aws/things/{ThingName}/shadow/update/delta topic.
237+
+ The JSON structure of the message sent should appear as below
238+
```json
239+
{
240+
"state": {
241+
"desired": {
242+
"toggle": [value]
243+
}
244+
}
245+
}
246+
```
247+
248+
3. The meta data, and delta difference will be reported via the Serial Terminal upon a difference between desired/reported.
249+
250+
![Delta Metadata](images/DeltaToggle.png)
251+
252+
4. In response to this, the end device publishes a message to $aws/things/{ThingName}/shadow/update topic.
253+
+ This message is published to **report** the update to the **toggle** attribute.
254+
+ The JSON structure of the message sent should appear as below
255+
```json
256+
{
257+
"state": {
258+
"reported": {
259+
"toggle": [value]
260+
}
261+
}
262+
}
263+
```
264+
265+
5. Application flow when using the device shadow
266+
267+
![Message After Delta](images/SequenceOfEvents.png)
268+
269+
---
270+
271+
### Detailed Operation
149272
0. There are three possible variations within application behavior possible by holding push buttons on startup
150273
+ Default behavior: No Button Pressed
151274
+ Soft AP: SW0 is Held on startup (see description farther in document)
@@ -158,14 +281,16 @@ General Out-Of-Box operation is as described below:
158281

159282
2. The **BLUE LED** will begin to blink, this indicates the board is attempting to join the local **ACCESS POINT**.
160283

161-
![Connecting](images/picawsLeverage.png)
284+
![Connecting_2](images/picawsLeverage.png)
162285

163286
3. Update the Wi-Fi Credentials; upon connecting the blinking will stop, and the **LED** will become **STATIC**. Below are the easiest methods to update credentials.
164287
+ The board will appear on the PC enumerated as a mass storage device under the name **CURIOSITY**. Credentials can be downloaded as the file **WIFI.CFG** using the **CLICK-ME.HTM** file stored on the **CURIOSITY** device.
165288

166289
![URL Hosted Credentials](images/wifiCredentialsWeb.png)
167290

168-
+ This will launch the URL: https://pic-iot.com/pic-iot/aws/{thingName} The file produced with entered credentials is produced through the WINC module, and no information is shared through the internet. Drag and Drop, or Copy and Paste the **WIFI.CFG** file onto the **CURIOSITY** device to load new credentials onto the IoT demonstration board.
291+
+ This will launch the URL: https://pic-iot.com/aws/{ThingName}.
292+
+ After entering credentials, the **.CFG** file is produced through the web browser. No information is shared through the internet.
293+
+ Drag and Drop, or Copy and Paste the **WIFI.CFG** file onto the **CURIOSITY** device to load new credentials onto the IoT demonstration board.
169294

170295
![WiFi Config](images/wifiNotepad.png)
171296

@@ -181,7 +306,8 @@ General Out-Of-Box operation is as described below:
181306

182307
![Telemetry Data](images/PublishDataToAWS.png)
183308

184-
6. Connect to the www.avr-iot.com, or www.pic-iot.com, device specific website to view publish/subscribe data. This page can be found via launching the **CLICK-ME.HTM** file on the **CURIOSITY** device.
309+
6. Connect to the www.avr-iot.com/aws/{thingName}, or www.pic-iot.com/aws/{thingName}, device specific website to view publish/subscribe data.
310+
+ This page can be found via launching the **CLICK-ME.HTM** file on the **CURIOSITY** device.
185311
+ There will be (2) scrolling graphs visible. (1) shows temperature sensor, (1) shows the light sensor value.
186312
+ Additional graphs can be produced altered through the published topic message.
187313

@@ -205,55 +331,8 @@ General Out-Of-Box operation is as described below:
205331
+ Device which required updates to the 'Desired' state which differs from their last 'Reported' value will receieve a published message on the '.../delta' MQTT topic.
206332
+ Upon reception the device will report the updated 'Desired' value for the attribute with timestamp on the console.
207333

208-
![Delta Subscribe Message](images/DeltaToggle.png)
209-
210-
---
211-
212-
## Understanding the Device Shadow in AWS
334+
![Delta Subscribe Message 2](images/DeltaToggle.png)
213335

214-
1. The AWS broker allows for the use of Shadow Topics. The Shadow Topics are used to retain a specific value within the Broker, so End-Device status updates can be managed.
215-
+ Shadow Topics are used to restore the state of variables, or applications.
216-
+ Shadow Topics retain expected values, and report if Published data reflects a difference in value.
217-
+ When difference exist, status of the delta is reported to those subscribed to appropriate topic messages.
218-
219-
![ShadowTopic UserStory](images/AWS_ShadowUserStory.png)
220-
221-
2. Updates to the device shadow are published on $aws/things/{ThingName}/shadow/update topic.
222-
When a message is sent to the board by changing the value of the **toggle** fiels in **Control Your Device** section:
223-
+ This message is published on the $aws/things/{ThingName}/shadow/update topic.
224-
+ If the curent value of **toggle** in the device shadow is different from the **toggle** value present in the AWS Device Shadow, the AWS Shadow service reports this change to the device by publishing a message on $aws/things/{ThingName}/shadow/update/delta topic.
225-
+ The JSON structure of the message sent should appear as below
226-
```json
227-
{
228-
"state": {
229-
"desired": {
230-
"toggle": [value]
231-
}
232-
}
233-
}
234-
```
235-
236-
3. The meta data, and delta difference will be reported via the Serial Terminal upon a difference between desired/reported.
237-
238-
![Delta Metadata](images/DeltaToggle.png)
239-
240-
4. In response to this, the end device publishes a message to $aws/things/{ThingName}/shadow/update topic.
241-
+ This message is published to **report** the update to the **toggle** attribute.
242-
+ The JSON structure of the message sent should appear as below
243-
```json
244-
{
245-
"state": {
246-
"reported": {
247-
"toggle": [value]
248-
}
249-
}
250-
}
251-
```
252-
253-
5. Application flow when using the device shadow
254-
255-
![Message After Delta](images/SequenceOfEvents.png)
256-
257336
---
258337

259338
## Additional Operations

images/awsControl.png

64.1 KB
Loading

images/awsGraphs.png

111 KB
Loading

images/awsLearnMore.png

136 KB
Loading

images/awsNext.png

105 KB
Loading

0 commit comments

Comments
 (0)