Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions GettingStartedGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Once completed, one can progress to the
&emsp;[2.1 Setup AWS IoT Core](#21-setup-aws-iot-core)<br>
&emsp;[2.2 Configure the project with the AWS IoT Thing Name and AWS device Endpoint](#22-configure-the-project-with-the-aws-iot-thing-name-and-aws-device-endpoint)<br>
&emsp;[2.3 Provision the ESP32-C3 with the private key, device certificate and CA certificate in Development Mode](#23-provision-the-esp32-c3-with-the-private-key-device-certificate-and-ca-certificate-in-development-mode)<br>
&emsp;[2.4 Quick Connect demo](#24-quick-connect-demo)<br>

[3 Build and flash the demo project](#3-build-and-flash-the-demo-project)<br>

Expand Down Expand Up @@ -154,6 +155,11 @@ python managed_components/espressif__esp_secure_cert_mgr/tools/configure_esp_sec

> **NOTE:** For convenience sake, you could place your key and certificate files under the `main/certs` directory.

### 2.4 Quick Connect demo

The Quick Connect demo differs from other demos as it does not require an AWS account. Refer to the [Getting Started Guide](./main/demo_tasks/quickconnect_v2_demo/GettingStarted.md)


## 3 Build and flash the demo project

Before you build and flash the demo project, if you are setting up the ESP32-C3
Expand Down
9 changes: 9 additions & 0 deletions main/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ if(CONFIG_GRI_ENABLE_SUB_PUB_UNSUB_DEMO)
list(APPEND MAIN_SRCS "demo_tasks/sub_pub_unsub_demo/sub_pub_unsub_demo.c")
endif()

# QuickConnect V2 demo
if(CONFIG_GRI_ENABLE_QUICKCONNECT_V2_DEMO)
list(APPEND MAIN_SRCS
"demo_tasks/quickconnect_v2_demo/quickconnect_v2_demo.c"
)
endif()

# Temperature Sub Pub and LED control demo
if(CONFIG_GRI_ENABLE_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO)
list(APPEND MAIN_SRCS
Expand All @@ -37,6 +44,7 @@ set(MAIN_INCLUDE_DIRS
"."
"demo_tasks/ota_over_mqtt_demo"
"demo_tasks/sub_pub_unsub_demo"
"demo_tasks/quickconnect_v2_demo"
"demo_tasks/temp_sub_pub_and_led_control_demo"
"demo_tasks/temp_sub_pub_and_led_control_demo/hardware_drivers"
"networking/wifi"
Expand All @@ -56,6 +64,7 @@ set(MAIN_REQUIRES
FreeRTOS-Libraries-Integration-Tests
unity
driver
esp_driver_tsens
)

idf_component_register(
Expand Down
40 changes: 37 additions & 3 deletions main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,43 @@ menu "Featured FreeRTOS IoT Integration"

endmenu # coreMQTT-Agent Manager Configurations

config GRI_ENABLE_QUICKCONNECT_V2_DEMO
bool "Enable QuickConnect V2 demo"
depends on !GRI_RUN_QUALIFICATION_TEST
default n

menu "Quick connect V2 demo configurations"
depends on GRI_ENABLE_QUICKCONNECT_V2_DEMO

config GRI_QUICKCONNECT_V2_DEMO_STRING_BUFFER_LENGTH
int "Topic name and payload buffer length"
default 700
help
Size of statically allocated buffers for holding topic names and payloads.

config GRI_QUICKCONNECT_V2_DEMO_DELAY_BETWEEN_PUB_LOOPS_MS
int "Delay between publish loops in milliseconds"
default 1000
help
Delay for each task between publish loops.

config GRI_QUICKCONNECT_V2_DEMO_MAX_COMMAND_SEND_BLOCK_TIME_MS
int "coreMQTT-Agent command post block time in milliseconds."
default 500
help
The maximum amount of time in milliseconds to wait for the commands to be posted to the MQTT agent should the MQTT agent's command queue be full. Tasks wait in the Blocked state, so don't use any CPU time.

config GRI_QUICKCONNECT_V2_DEMO_TASK_STACK_SIZE
int "Quick connect task stack size."
default 3072
help
The task stack size for each of the Quick Connect tasks.

endmenu # Quick connect V2 demo configurations

config GRI_ENABLE_SUB_PUB_UNSUB_DEMO
bool "Enable pub sub unsub demo"
depends on !GRI_RUN_QUALIFICATION_TEST
depends on !GRI_RUN_QUALIFICATION_TEST && !GRI_ENABLE_QUICKCONNECT_V2_DEMO
default y

menu "Sub pub unsub demo configurations"
Expand Down Expand Up @@ -308,7 +342,7 @@ menu "Featured FreeRTOS IoT Integration"

config GRI_ENABLE_TEMPERATURE_PUB_SUB_AND_LED_CONTROL_DEMO
bool "Enable temperature sensor pub sub and LED control demo"
depends on !GRI_RUN_QUALIFICATION_TEST
depends on !GRI_RUN_QUALIFICATION_TEST && !GRI_ENABLE_QUICKCONNECT_V2_DEMO
default y

menu "Temperature pub sub and LED control demo configurations"
Expand Down Expand Up @@ -378,7 +412,7 @@ menu "Featured FreeRTOS IoT Integration"

config GRI_ENABLE_OTA_DEMO
bool "Enable OTA demo"
depends on !GRI_RUN_QUALIFICATION_TEST
depends on !GRI_RUN_QUALIFICATION_TEST && !GRI_ENABLE_QUICKCONNECT_V2_DEMO
default y

menu "OTA demo configurations"
Expand Down
80 changes: 80 additions & 0 deletions main/demo_tasks/quickconnect_v2_demo/GettingStarted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# Getting Started With Quick Connect V2 Guide

**_NOTE:_** This guide covers only Quick Connect V2. For all other demos, please refer to the [Getting Started Guide](../../../GettingStartedGuide.md).

This guide contains instructions on how to setup, build and run only the Quick Connect V2 demo
without use of the security features of the ESP32-C3 i.e. without enabling the
DS peripheral, flash encryption and Secure Boot. The guide is meant to provide the
user with a friendly first-use experience.

[1 Pre-requisites](#1-pre-requisites)<br>

[2 Demo setup](#2-demo-setup)<br>

[3 Build and flash the demo project](#3-build-and-flash-the-demo-project)<br>

[4 Monitoring the demo](#4-monitoring-the-demo)<br>


## 1 Pre-requisites

For hardware and software requirements, refer to sections [1.1 Hardware Requirements](../../../GettingStartedGuide.md#11-hardware-requirements) and [1.2 Software Requirements](../../../GettingStartedGuide.md#12-software-requirements) in the [Getting Started Guide](../../../GettingStartedGuide.md)

## 2 Demo setup

### 2.1 Get credentials from Quick Connect V2

To get credentials for your device (Thing), visit [Quick Connect Credentials](https://quickconnect.freertos.aws.com/credentials) page and enter a desired device name (Thing Name) in the `Vend Credentials` section, and click the Vend button. Download both the `.crt` and `.key` files. These are your **PEM-encoded device certificate** and **PEM-encoded private key**. (An explanation of these entities is given in the [AWS IoT Core Setup Guide](../../../AWSSetup.md).)

### 2.2 Configure the project with the AWS IoT Thing Name and AWS device Endpoint

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also mention enabling the quick connect v2 demo?


The **AWS device Endpoint** is provided on the [Quick Connect Examples](https://quickconnect.freertos.aws.com/examples) page.

Follow the [2.2 Configure the project](../../../GettingStartedGuide.md#22-configure-the-project-with-the-aws-iot-thing-name-and-aws-device-endpoint) section in the [Getting Started Guide](../../../GettingStartedGuide.md) to configure your project.


### 2.3 Provision the ESP32-C3 with the private key, device certificate and CA certificate in Development Mode

For Quick Connect, use the following specific values:

- `CA_CERT_FILEPATH`: Use the file in the `main/certs` directory, or download the AWS Root CA certificate from [here](https://www.amazontrust.com/repository/AmazonRootCA1.pem).
- `DEVICE_CERT_FILEPATH`: The file path to the PEM-encoded device certificate (`.crt` file downloaded from the Quick Connect Website)
- `PRIVATE_KEY_FILEPATH`: The file path to the PEM-encoded private key (`.key` file downloaded from the Quick Connect Website)
- `KEY_ALG_INFO`: Use `RSA 2048`

For complete provisioning instructions, follow the [2.3 Provision the ESP32-C3](../../../GettingStartedGuide.md#23-provision-the-esp32-c3-with-the-private-key-device-certificate-and-ca-certificate-in-development-mode) section in the [Getting Started Guide](../../../GettingStartedGuide.md).


## 3 Build and flash the demo project

For build and flash instructions, follow [3 Build and flash](../../../GettingStartedGuide.md#3-build-and-flash-the-demo-project) section of the [Getting Started Guide](../../../GettingStartedGuide.md).

**NOTE:** If you encounter a ***stack overflow in task CoreMqttAgentCo has been detected*** <br>
run `idf.py menuconfig`. navigate to Featured FreeRTOS IoT Integration → coreMQTT-Agent Manager Configurations, and increse the `coreMQTT-Agent task stack size` and `Connection handling task stack size` from their default values.

## 4 Monitoring the demo

1. On the serial terminal console, confirm that the TLS connection was
successful and that MQTT messages are published.

```c
I (4115) core_mqtt_agent_manager: WiFi connected.
I (4115) app_wifi: Connected with IP Address:10.0.0.9
I (4115) esp_netif_handlers: sta ip: 10.0.0.9, mask: 255.255.255.0, gw: 10.0.0.1
I (4115) main_task: Returned from app_main()
I (4685) core_mqtt_agent_manager: TLS connection established.
I (5025) coreMQTT: MQTT connection established with the broker.
I (5025) core_mqtt_agent_manager: Session present: 0

I (5025) quickconnect_v2_demo: coreMQTT-Agent connected.
I (5025) core_mqtt_agent_manager: coreMQTT-Agent connected.
I (5025) quickconnect_v2_demo: Task "DemoTask" sending publish request to coreMQTT-Agent with message [{"label":"ESP32-S3 MCU Temperature","display_type":"line_graph","unit":"C","values":[{"value":0.0,"label":"temp"}]}] on topic "Thing-name" with ID 1.
I (5055) quickconnect_v2_demo: Task "DemoTask" waiting for publish 1 to complete.
I (5175) coreMQTT: Ack packet deserialized with result: MQTTSuccess.
I (5175) coreMQTT: State record updated. New state=MQTTPublishDone.

```
2. On the [Quick Connect Visualizer](https://quickconnect.freertos.aws.com/visualizer) page, enter your device name (Thing name) in the `Visualizing device data` section, then confirm that the MQTT messages from the device are being received and a graph is being displayed.
**Note**: This demo sends data in line graph format only. For other data visualization formats, refer to the [Quick Connect](https://quickconnect.freertos.aws.com/examples) documentation.
Loading
Loading