Skip to content

Commit

Permalink
Update for 202407.00 release information (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
chinglee-iot authored Jul 26, 2024
2 parents f760ec8 + 49a9e08 commit 87cc57a
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 317 deletions.
105 changes: 105 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Release automation

on:
workflow_dispatch:
inputs:
commit_id:
description: 'Commit ID/branch to tag and create a release for'
required: true
version_number:
description: 'Release Version (Eg, v202212.00)'
required: true

env:
repository_compressed_name: ${{ github.event.repository.name }}v${{ github.event.inputs.version_number }}
repostiory_zip_name: ${{ github.event.repository.name }}.zip

jobs:
tag-commit:
name: Tag commit
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_id }}
- name: Configure git identity
run: |
git config --global user.name ${{ github.actor }}
git config --global user.email ${{ github.actor }}@users.noreply.github.com
- name: create a new branch that references commit id
run: git checkout -b ${{ github.event.inputs.version_number }} ${{ github.event.inputs.commit_id }}
- name: Tag Commit and Push to remote
run: |
git tag ${{ github.event.inputs.version_number }} -a -m "Release ${{ github.event.inputs.version_number }}"
git push origin --tags
- name: Verify tag on remote
run: |
git tag -d ${{ github.event.inputs.version_number }}
git remote update
git checkout tags/${{ github.event.inputs.version_number }}
git diff ${{ github.event.inputs.commit_id }} tags/${{ github.event.inputs.version_number }}
create-zip:
needs: tag-commit
name: Create ZIP and verify package for release asset.
runs-on: ubuntu-latest
steps:
- name: Install ZIP tools
run: sudo apt-get install zip unzip
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_id }}
path: ${{ github.event.repository.name }}
submodules: recursive
- name: Checkout disabled submodules
run: |
cd ${{ github.event.repository.name }}
git submodule update --init --checkout --recursive
- name: Create ZIP
run: |
zip -r ${{ env.repostiory_zip_name }} ${{ github.event.repository.name }} -x "*.git*"
ls ./
- name: Validate created ZIP
run: |
mkdir zip-check
mv ${{ env.repostiory_zip_name }} zip-check
cd zip-check
unzip ${{ env.repostiory_zip_name }} -d ${{ env.repository_compressed_name }}
ls ${{ env.repository_compressed_name }}
diff -r -x "*.git*" ${{ env.repository_compressed_name }}/${{ github.event.repository.name }}/ ../${{ github.event.repository.name }}/
- name: Create artifact of ZIP
uses: actions/upload-artifact@v2
with:
name: ${{ env.repostiory_zip_name }}
path: zip-check/${{ env.repostiory_zip_name }}
create-release:
needs: create-zip
name: Create Release and Upload Release Asset
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.version_number }}
release_name: ${{ github.event.inputs.version_number }}
body: ${{ github.event.inputs.version_number }} Release
draft: false
prerelease: false
- name: Download ZIP artifact
uses: actions/download-artifact@v2
with:
name: ${{ env.repostiory_zip_name }}
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.repostiory_zip_name }}
asset_name: ${{ env.repostiory_zip_name }}
asset_content_type: application/zip
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog for ESP32-C3 MCU Featured FreeRTOS IoT Integration

## v202407.00 ( July 2024 )
- [#88](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/88) Update Long Term Support (LTS) libraries to 202406.01-LTS:
* [coreMQTT v2.3.1](https://github.com/FreeRTOS/coreMQTT/blob/v2.3.1)
* [coreHTTP v3.1.1](https://github.com/FreeRTOS/coreHTTP/tree/v3.1.1)
* [corePKCS11 v3.6.1](https://github.com/FreeRTOS/corePKCS11/tree/v3.6.1)
* [coreJSON v3.3.0](https://github.com/FreeRTOS/coreJSON/tree/v3.3.0)
* [backoffAlgorithm v1.4.1](https://github.com/FreeRTOS/backoffAlgorithm/tree/v1.4.1)
* [AWS IoT Device Shadow v1.4.1](https://github.com/aws/Device-Shadow-for-AWS-IoT-embedded-sdk/tree/v1.4.1)
* [AWS IoT Device Defender v1.4.0](https://github.com/aws/Device-Defender-for-AWS-IoT-embedded-sdk/tree/v1.4.0)
* [AWS IoT Jobs v1.5.1](https://github.com/aws/Jobs-for-AWS-IoT-embedded-sdk/tree/v1.5.1)
* [AWS MQTT file streams v1.1.0](https://github.com/aws/aws-iot-core-mqtt-file-streams-embedded-c/tree/v1.1.0)

- [#79](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/79) Fix out of order PUBACK and PUBLISH handling
- [#71](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/71) Update Security Feature guide to cover ESP-IDF latest version changes
- [#77](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/77) Notify other tasks that OTA is stopped when fail to activate new image
- [#76](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/76) Post OTA_STOPPED_EVENT once new image verification finished
- [#68](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/68) Shrink idle and timer task stack and OTA buffers to fit into mimimal size when using ESP IDF v5.1
- [#66](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/66) Add C linage for C++ support
- [#64](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/64) Fix GPIO level in temperature sensor pub sub and LED control demo
- [#57](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/57) Add matrix build for supported targets
- [#43](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/43) Add process loop call in MQTT Agent manager to fix TLS connection dropped.
- [#20](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/20) Updated esp_secure_cert_mgr and IDF v5.0 support

## v202212.00 ( December 2022 )
- [#12](https://github.com/FreeRTOS/iot-reference-esp32c3/pull/12) Update Long Term Support (LTS) libraries to 202210.01-LTS:
* [coreMQTT v2.1.1](https://github.com/FreeRTOS/coreMQTT/blob/v2.1.1/CHANGELOG.md)
Expand Down
152 changes: 3 additions & 149 deletions GettingStartedGuide.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ Once completed, one can progress to the
&emsp;[6.1 Prerequisite](#61-prerequisite)<br>
&emsp;[6.2 Steps for each test case](#62-steps-for-each-test-case)<br>

[7 Run AWS IoT Device Tester](#7-run-aws-iot-device-tester)<br>
&emsp;[7.1 Prerequisite](#71-prerequisite)<br>
&emsp;[7.2 Download AWS IoT Device Tester](#72-download-aws-iot-device-tester)<br>
&emsp;[7.3 Configure AWS IoT Device Tester](#73-configure-aws-iot-device-tester)<br>
&emsp;[7.4 Running the FreeRTOS qualification 2.0 suite](#74-running-the-freertos-qualification-20-suite)<br>

## 1 Pre-requisites

### 1.1 Hardware Requirements
Expand Down Expand Up @@ -610,15 +604,11 @@ I (3444) ota_over_mqtt_demo: Subscribed to topic $aws/things/thing_esp32c3_nonOt

### 6.1 Prerequisite

- Follow the
[OTA update with AWS IoT Guide](#5-perform-firmware-over-the-air-updates-with-aws-iot)
to create an OTA update and verify the digital signature, checksum and version
number of the new image. If firmware update is verified, you can run the tests on your device.
- Run `idf.py menuconfig`.
- Under `Featured FreeRTOS IoT Integration`, choose `Run qualification test`.
- Under `Component config -> Unity unit testing library`, choose `Include Unity test fixture`.

_Note: The log of module `esp_ota_ops`, `AWS_OTA` and `esp-tls-mbedtls` will be
_Note: The log of module `esp_ota_ops` and `esp-tls-mbedtls` will be
disabled when running the qualification test. You can change the log level by
`esp_log_level_set` in [main.c](./main/main.c)._

Expand All @@ -635,6 +625,7 @@ disabled when running the qualification test. You can change the log level by
- Set `Thing Name for Device Advisor Test/OTA end-to-end Test` to AWS IoT Thing under test.
- Build and run.
- See Device Advisor test result in the console.

2. MQTT Test
- Under `Featured FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Execution Test Configurations`,
choose `MQTT Test`.
Expand Down Expand Up @@ -678,23 +669,7 @@ disabled when running the qualification test. You can change the log level by
I (612755) qual_main: End qualification test.
```
4. OTA PAL Test
- Under `Featured FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Execution Test Configurations`,
choose `OTA PAL Test`.
- Build and run.
- See test result on target output.
- Example output
```c
I (905) qual_main: Run qualification test.
...
-----------------------
15 Tests 0 Failures 0 Ignored
OK
I (113755) qual_main: End qualification test.
```
5. Core PKCS11 Test
4. Core PKCS11 Test
- Under `Featured FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Execution Test Configurations`,
choose `CorePKCS#11 Test`.
- Build and run.
Expand All @@ -709,124 +684,3 @@ disabled when running the qualification test. You can change the log level by
OK
I (7518) qual_main: End qualification test.
```
## 7 Run AWS IoT Device Tester
This repository can be tested using
[AWS IoT Device Tester for FreeRTOS (IDT)](https://aws.amazon.com/freertos/device-tester/).
IDT is a downloadable tool that can be used to exercise a device integration with
FreeRTOS to validate functionality and compatibility with Amazon IoT cloud.
Passing the test suite provided by IDT is also required to qualify a device for
the [Amazon Partner Device Catalogue](https://devices.amazonaws.com/).
IDT runs a suite of tests that include testing the device's transport interface
layer implementation, PKCS11 functionality, and OTA capabilities. In IDT test
cases, the IDT binary will make a copy of the source code, update the header files
in the project, then compile the project and flash the resulting image to your
board. Finally, IDT will read serial output from the board and communicate with
the AWS IoT cloud to ensure that test cases are passing.
### 7.1 Prerequisite
- Follow the
[OTA update with AWS IoT Guide](#5-perform-firmware-over-the-air-updates-with-aws-iot)
to create an OTA update and verify the digital signature, checksum and version
number of the new image. If firmware update is verified, you can run the tests
on your device.
- Run `idf.py menuconfig`.
- Under `Featured FreeRTOS IoT Integration`, choose `Run qualification test`.
- Under `Component config -> Unity unit testing library`, choose `Include Unity test fixture`.
- Under `Featured FreeRTOS IoT Integration -> Qualification Test Configurations -> Qualification Execution Test Configurations`,
**DISABLE** all the tests.
- Run `idf.py fullclean` to clear local CMAKE cache.
_Note: The log of module `esp_ota_ops`, `AWS_OTA` and `esp-tls-mbedtls` will be
disabled when running the qualification test. You can change the log level by
`esp_log_level_set` in [main.c](./main/main.c)._
### 7.2 Download AWS IoT Device Tester
The latest version of IDT can be downloaded from the
[here](https://docs.aws.amazon.com/freertos/latest/userguide/dev-test-versions-afr.html).
This repository has been qualified by IDT v4.6.0 and test suite version 2.3.0 for
[FreeRTOS 202210-LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202210.01-LTS).
### 7.3 Configure AWS IoT Device Tester
Follow [the instructions to setup your AWS account](https://docs.aws.amazon.com/freertos/latest/userguide/lts-idt-dev-tester-prereqs.html#lts-config-aws-account).
Extract IDT for FreeRTOS to a location on the file system
- The `devicetester-extract-location/bin` directory holds the IDT binary, which
is the entry point used to run IDT
- The `devicetester-extract-location/results` directory holds logs that are
generated every time you run IDT.
- The `devicetester-extract-location/configs` directory holds configuration files
that are required to setup IDT
Before running IDT, the files in `devicetester-extract-location/configs` need
to be updated. We have pre-defined configures available in the
[idt_config](https://github.com/FreeRTOS/iot-reference-esp32c3/tree/main/idt_config).
Copy these templates to `devicetester-extract-location/configs`, and the rest of
this section will walk through the remaining values that need to be filled in.
You need to configure your AWS credentials for IDT.
- In `config.json`, update the `profile` and `awsRegion` fields
You need to specify the device details for IDT.
- In `device.json`, update `serialPort` to the serial port of your board as from
[PORT](./GettingStartedGuide.md#23-provision-the-esp32-c3-with-the-private-key-device-certificate-and-ca-certificate-in-development-mode).
Update `publicKeyAsciiHexFilePath` to the absolute path to `dummyPublicKeyAsciiHex.txt`.
Update `publicDeviceCertificateArn` to the ARN of the certificate uploaded when
[Setup AWS IoT Core](./GettingStartedGuide.md#21-setup-aws-iot-core).
You need to configure IDT the build, flash and test settings.
- In `build.bat` / `build.sh`, update ESP_IDF_PATH, and ESP_IDF_FRAMEWORK_PATH
- In `flash.bat` / `flash.sh`, update ESP_IDF_PATH, ESP_IDF_FRAMEWORK_PATH, and NUM_COMPORT
- In `userdata.json`, update `sourcePath` to the absolute path to the root of this repository.
- In `userdata.json`, update `signerCertificate` with the ARN of the
[Setup pre-requisites for OTA cloud resources](./GettingStartedGuide.md#51-setup-pre-requisites-for-ota-cloud-resources)
- Run all the steps to create a
[second code signing certificate](./GettingStartedGuide.md#51-setup-pre-requisites-for-ota-cloud-resources)
but do NOT provision the key onto your board.
- Copy the ARN for this certificate in `userdata.json` for the field
`untrustedSignerCertificate`.
### 7.4 Running the FreeRTOS qualification 2.0 suite
With configuration complete, IDT can be run for an individual test group, a
test case, or the entire qualification suite.
List all the available test groups, run:
```sh
.\devicetester_win_x86-64.exe list-groups
```

Run one or more specified test group, run e.g.:

```sh
.\devicetester_win_x86-64.exe run-suite --group-id FullCloudIoT --group-id OTACore
```

Run one or more specified tests, run e.g.:

```sh
.\devicetester_win_x86-64.exe run-suite --group-id OTADataplaneMQTT --test-id OTAE2EGreaterVersion
```

To run the entire qualification suite, run:

```sh
.\devicetester_win_x86-64.exe run-suite --skip-group-id FullPKCS11_PreProvisioned_RSA --skip-group-id FullPKCS11_Import_RSA --skip-group-id FullPKCS11_Core --skip-group-id FullTransportInterfacePlainText
```

For more information, `.\devicetester_win_x86-64.exe help` will show all available commands.

When IDT is run, it generates the `results/uuid` directory that contains the
logs and other information associated with your test run. See
[Understanding results and logs](https://docs.aws.amazon.com/freertos/latest/userguide/lts-results-logs.html)
for more details.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ git submodule update --init --recursive

This repository currently supports 3 demos implemented as FreeRTOS [tasks](https://www.freertos.org/taskandcr.html), each of which utilize the same MQTT connection. The demos use the [coreMQTT](https://www.freertos.org/mqtt/index.html) library, while the [coreMQTT-Agent](https://www.freertos.org/mqtt-agent/index.html) library is employed to manage thread safety for the MQTT connection. The demos are the following:

* **ota_over_mqtt_demo**: This demo uses the [AWS IoT OTA service](https://docs.aws.amazon.com/freertos/latest/userguide/freertos-ota-dev.html) for FreeRTOS to configure and create OTA updates. The OTA client software on the ESP32-C3 uses the [AWS IoT OTA library](https://www.freertos.org/ota/index.html) and runs in the background within a FreeRTOS agent (or daemon) task. A new firmware image is first signed and uploaded to the OTA service, and the project is then configured to store the corresponding public key certificate. The demo subscribes to, and listens on, an OTA job topic in order to be notified of an OTA update. Upon receiving notification of a pending OTA update, the device downloads the firmware patch and performs code signature verification of the downloaded image by using the public key certificate. On successful verification, the device reboots and the updated image is activated. The OTA client then performs a self-test on the updated image to check for its integrity.
* **ota_over_mqtt_demo**: This demo uses the [AWS IoT OTA service](https://docs.aws.amazon.com/freertos/latest/userguide/freertos-ota-dev.html) for FreeRTOS to configure and create OTA updates. The OTA client software on the ESP32-C3 follows the [Modular Over the Air Updates](https://freertos.org/freertos-core/over-the-air-updates/index.html) design and runs in the background within a FreeRTOS agent (or daemon) task. A new firmware image is first signed and uploaded to the OTA service, and the project is then configured to store the corresponding public key certificate. The demo subscribes to, and listens on, an OTA job topic in order to be notified of an OTA update. Upon receiving notification of a pending OTA update, the device downloads the firmware patch and performs code signature verification of the downloaded image by using the public key certificate. On successful verification, the device reboots and the updated image is activated. The OTA client then performs a self-test on the updated image to check for its integrity.
* **sub_pub_unsub_demo**: The demo creates tasks which subscribe to a topic on AWS IoT Core, publish a constant string to the same topic, receive their publish (since they are subscribed to the topic they publish to), and then unsubscribe from the topic in a loop.
* **temp_sub_pub_and_led_control_demo**: This demo creates a task which subscribes to a topic on AWS IoT Core. This task then reads the temperature from the onboard temperature sensor, publishes this information in JSON format to the same topic, and then receives this publish (since it is subscribed to the same topic it just published to) in a loop. This demo also enables a user to send a JSON packet back to the device to turn an LED off or on.

Expand Down
6 changes: 0 additions & 6 deletions idt_config/dummyPublicKeyAsciiHex.txt

This file was deleted.

23 changes: 0 additions & 23 deletions idt_config/windows/build.bat

This file was deleted.

19 changes: 0 additions & 19 deletions idt_config/windows/config.json

This file was deleted.

Loading

0 comments on commit 87cc57a

Please sign in to comment.