Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New OpenThread CLI Arduino Library for ESP32-C6 and ESP32-H2 #9908

Merged
merged 32 commits into from
Jun 24, 2024

Conversation

SuGlider
Copy link
Collaborator

Description of Change

Adds the OpenThread CLI Arduino Library.
It has some examples.

Only available for the C6 and H2.

Tests scenarios

Examples tested on C6 and H2.

Related links

@SuGlider SuGlider added this to the 3.0.2 milestone Jun 20, 2024
@SuGlider SuGlider self-assigned this Jun 20, 2024
Copy link
Contributor

github-actions bot commented Jun 20, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "feat(OThread): Add Library":
    • summary looks too short
    • scope/component should be lowercase without whitespace, allowed special characters are _ / . , * - .
  • the commit message "feat(openthread): New Scan Example":
    • summary looks too short
  • the commit message "feat(openthread): README.md":
    • summary looks too short
  • the commit message "feat(openthread): commentary":
    • summary looks too short
  • the commit message "feat(openthread): formatting text":
    • summary looks too short
  • the commit message "feat(openthread): onReceice example":
    • summary looks too short
  • the commit message "fix(OpenThread): fixes file list in CMakeLists.txt":
    • scope/component should be lowercase without whitespace, allowed special characters are _ / . , * - .
  • the commit message "fix(doc): fixing documentation apresentation":
    • body's lines must not be longer than 100 characters
  • the commit message "fix(openthread): Fixes JSON CI Files":
    • summary looks too short
  • the commit message "fix(openthread): Fixes JSON CI Files":
    • summary looks too short
  • the commit message "fix(openthread): Improves code":
    • summary looks too short
  • the commit message "fix(openthread): begin end":
    • summary looks too short
  • the commit message "fix(openthread): library properties":
    • summary looks too short
  • the commit message "fix(openthread): tx queue error":
    • summary looks too short

Please fix these commit messages - here are some basic tips:

  • follow Conventional Commits style
  • correct format of commit message should be: <type/action>(<scope/component>): <summary>, for example fix(esp32): Fixed startup timeout issue
  • allowed types are: change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 20 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses the Conventional Precommit Linter).

⚠️ Please consider squashing your 32 commits (simplifying branch history).
⚠️

The source branch "OpenThread" incorrect format:

  • contains uppercase letters. This can cause troubles on case-insensitive file systems (macOS).
    Please rename your branch.
Messages
📖 This PR seems to be quite large (total lines of code: 1503), you might consider splitting it into smaller PRs

👋 Hello SuGlider, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against 81d62e9

@SuGlider SuGlider marked this pull request as draft June 20, 2024 06:23
Copy link
Contributor

github-actions bot commented Jun 20, 2024

Test Results

 56 files   56 suites   9m 37s ⏱️
 21 tests  20 ✅ 0 💤  1 ❌
135 runs  125 ✅ 0 💤 10 ❌

For more details on these failures, see this check.

Results for commit 81d62e9.

♻️ This comment has been updated with latest results.

@SuGlider
Copy link
Collaborator Author

@lucasssvaz - Is it possible that the CI failures are related to using cached files that don't have the necessary file structure?

@P-R-O-C-H-Y
Copy link
Member

@SuGlider Also you have to fix the Arduino as IDF component as CI is failing for C6 and H2.

In file included from /__w/arduino-esp32/arduino-esp32/components/arduino-esp32/libraries/OpenThread/src/OThreadCLI.cpp:1:
/__w/arduino-esp32/arduino-esp32/components/arduino-esp32/libraries/OpenThread/src/OThreadCLI.h:5:10: fatal error: esp_openthread.h: No such file or directory
    5 | #include "esp_openthread.h"
      |          ^~~~~~~~~~~~~~~~~~
Missing "esp_openthread.h" file name found in the following component(s): openthread(/opt/esp/idf/components/openthread/include/esp_openthread.h). 
Maybe one of the components needs to add the missing header directory to INCLUDE_DIRS of idf_component_register call in CMakeLists.txt.

@SuGlider
Copy link
Collaborator Author

@SuGlider Also you have to fix the Arduino as IDF component as CI is failing for C6 and H2.

In file included from /__w/arduino-esp32/arduino-esp32/components/arduino-esp32/libraries/OpenThread/src/OThreadCLI.cpp:1:
/__w/arduino-esp32/arduino-esp32/components/arduino-esp32/libraries/OpenThread/src/OThreadCLI.h:5:10: fatal error: esp_openthread.h: No such file or directory
    5 | #include "esp_openthread.h"
      |          ^~~~~~~~~~~~~~~~~~
Missing "esp_openthread.h" file name found in the following component(s): openthread(/opt/esp/idf/components/openthread/include/esp_openthread.h). 
Maybe one of the components needs to add the missing header directory to INCLUDE_DIRS of idf_component_register call in CMakeLists.txt.

Openthread is already an IDF component.
https://github.com/espressif/esp-idf/tree/master/components/openthread
But there are 2 folders there that are external repositories and those should be cloned by CI in a recursive way.

When I use Arduino as Component, I clone IDF repository with all submodules, recursively and this error never happens.

@me-no-dev
Copy link
Member

@SuGlider I suggest you guard the library files with #if CONFIG_OPENTHREAD_ENABLED.

#include "sdkconfig.h"
#if CONFIG_OPENTHREAD_ENABLED
#include "esp_openthread.h"
//...
#endif /* CONFIG_OPENTHREAD_ENABLED */

@me-no-dev
Copy link
Member

Openthread is already an IDF component.

but it's not enabled in the default CI build. That's it's purpose

Copy link
Contributor

github-actions bot commented Jun 20, 2024

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32C6000.000.00000.000.00
ESP32H2000.000.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C6ESP32H2
ExampleFLASHRAMFLASHRAM
OpenThread/examples/COAP/coap_lamp----
OpenThread/examples/COAP/coap_switch----
OpenThread/examples/SimpleCLI----
OpenThread/examples/SimpleNode----
OpenThread/examples/SimpleThreadNetwork/LeaderNode----
OpenThread/examples/SimpleThreadNetwork/RouterNode----
OpenThread/examples/ThreadScan----
OpenThread/examples/onReceive----

@SuGlider SuGlider marked this pull request as ready for review June 20, 2024 17:39
Fixes the documentation first paragraph in order to make it easier fore reading. It also displays in the very top which SoC are supported by the library.
@SuGlider
Copy link
Collaborator Author

SuGlider commented Jun 24, 2024

@P-R-O-C-H-Y - DangerJS Linter fails... Is it a problem?

DangerJS checks (rules) output states:

Commit messages style......................................................................... Failed
Number of commits in Pull Request............................................................. Failed
Pull Request size (number of changed lines)................................ Passed (with suggestions)
Pull Request sufficient Description........................................................... Passed
Source branch name............................................................................ Failed
Target branch is project default branch....................................................... Passed

@lucasssvaz
Copy link
Collaborator

lucasssvaz commented Jun 24, 2024

@SuGlider The DangerJS failure is bc some of the wokwi tests failed
https://github.com/espressif/arduino-esp32/runs/26578220915

@SuGlider
Copy link
Collaborator Author

@SuGlider The DangerJS failure is bc some of the wokwi tests failed https://github.com/espressif/arduino-esp32/runs/26578220915

But all passed, only DangerJS failed.

CMakeLists.txt Outdated Show resolved Hide resolved
libraries/OpenThread/src/OThreadCLI.h Outdated Show resolved Hide resolved
@lucasssvaz lucasssvaz added Status: Pending Merge Pull Request is ready to be merged Area: Libraries Issue is related to Library support. labels Jun 24, 2024
@lucasssvaz lucasssvaz removed the Status: Pending Merge Pull Request is ready to be merged label Jun 24, 2024
Copy link
Collaborator

@lucasssvaz lucasssvaz left a comment

Choose a reason for hiding this comment

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

To avoid putting everything in a single line

@SuGlider
Copy link
Collaborator Author

@lucasssvaz - I have added more commented lines in the array. I think that it should get all in the right place. Could youforce running the formatting CI job on top of the current PR just to check if it changes anything else?
Thanks.

@lucasssvaz lucasssvaz added the Status: Pending Merge Pull Request is ready to be merged label Jun 24, 2024
Copy link
Collaborator

@lucasssvaz lucasssvaz left a comment

Choose a reason for hiding this comment

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

@SuGlider Yeah, looks good.

@SuGlider
Copy link
Collaborator Author

@me-no-dev - I guess that the PR is ready for merging. Please check if there is something else missing beside the Wokwi CI errors.

@me-no-dev me-no-dev merged commit d891ddf into espressif:master Jun 24, 2024
42 of 47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Libraries Issue is related to Library support. Status: Pending Merge Pull Request is ready to be merged
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants