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

Add ESP-NOW Arduino library #9395

Merged
merged 42 commits into from
Apr 3, 2024

Conversation

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

@P-R-O-C-H-Y P-R-O-C-H-Y commented Mar 20, 2024

Description of Change

This PR adds an ESP-NOW library, which can be used for easier local network communication between devices.

Tests scenarios

Tested on multiple SoCs with the ESP-NOW examples included in this PR.

Related links

@P-R-O-C-H-Y P-R-O-C-H-Y added the Area: Libraries Issue is related to Library support. label Mar 20, 2024
@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Mar 20, 2024
Copy link
Contributor

github-actions bot commented Mar 20, 2024

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "Add ESP NOW Serial Example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Add LMK back":
    • summary looks empty
    • type/action looks empty
  • the commit message "Add argument to receive callback to know if a message was broadcasted":
    • summary looks empty
    • type/action looks empty
  • the commit message "Add broadcast address constant":
    • summary looks empty
    • type/action looks empty
  • the commit message "Add broadcast example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Add comment":
    • summary looks empty
    • type/action looks empty
  • the commit message "Add documentation":
    • summary looks empty
    • type/action looks empty
  • the commit message "Add logs":
    • summary looks empty
    • type/action looks empty
  • the commit message "Add network example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Add skip file":
    • summary looks empty
    • type/action looks empty
  • the commit message "Apply @lucasssvaz suggestions to docs":
    • summary looks empty
    • type/action looks empty
  • the commit message "Apply @suglider suggestions from code review":
    • summary looks empty
    • type/action looks empty
  • the commit message "Apply suggested changes":
    • summary looks empty
    • type/action looks empty
  • the commit message "Change comment":
    • summary looks empty
    • type/action looks empty
  • the commit message "Change comments":
    • summary looks empty
    • type/action looks empty
  • the commit message "Change return value to align with other APIs":
    • summary looks empty
    • type/action looks empty
  • the commit message "Fix ESP_NOW_Serial":
    • summary looks empty
    • type/action looks empty
  • the commit message "Fix example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Fix example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Fix example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Improve broadcast master example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Improve example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Improve example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Improve serial example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Make onRecieve also optional and make constructor protected":
    • summary looks empty
    • type/action looks empty
  • the commit message "Remove examples using IDF's API":
    • summary looks empty
    • type/action looks empty
  • the commit message "Simplify example":
    • summary looks empty
    • type/action looks empty
  • the commit message "Skip esp-now example for esp32h2":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update espnow.rst":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update examples":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update libraries/ESP_NOW/src/ESP32_NOW.cpp":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update libraries/ESP_NOW/src/ESP32_NOW.cpp":
    • summary looks empty
    • type/action looks empty
  • the commit message "Update libraries/ESP_NOW/src/ESP32_NOW_Serial.cpp":
    • summary looks empty
    • type/action looks empty
  • the commit message "fix examples links in docs":
    • summary looks empty
    • type/action looks empty
  • the commit message "fix(esp-now): Add check if Wifi is started.":
    • summary should not end with a period (full stop)
  • the commit message "make onSent optional and remove underscores for virtual functions":
    • summary looks empty
    • type/action looks empty

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 42 commits (simplifying branch history).
Messages
📖 This PR seems to be quite large (total lines of code: 2438), you might consider splitting it into smaller PRs

👋 Hello P-R-O-C-H-Y, 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 55a6193

libraries/ESP_NOW/src/ESP32_NOW.cpp Outdated Show resolved Hide resolved
libraries/ESP_NOW/src/ESP32_NOW.cpp Outdated Show resolved Hide resolved
@lucasssvaz
Copy link
Collaborator

lucasssvaz commented Mar 21, 2024

Can't communicate when using AP mode. Currently investigating.

EDIT: Figured it out. Not a problem with the Lib

@me-no-dev
Copy link
Member

@lucasssvaz H2 can't do ESP_NOW: https://github.com/espressif/arduino-esp32/actions/runs/8383399283/job/22959040267?pr=9395#step:5:903

@SuGlider SuGlider self-requested a review March 25, 2024 02:52
@lucasssvaz lucasssvaz self-assigned this Mar 25, 2024
Copy link
Collaborator

@SuGlider SuGlider left a comment

Choose a reason for hiding this comment

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

@P-R-O-C-H-Y - I've left a couple changes for your review.

@P-R-O-C-H-Y P-R-O-C-H-Y marked this pull request as ready for review April 2, 2024 10:46
@lucasssvaz lucasssvaz added the Status: Review needed Issue or PR is awaiting review label Apr 2, 2024
docs/en/api/espnow.rst Outdated Show resolved Hide resolved
docs/en/api/espnow.rst Outdated Show resolved Hide resolved
docs/en/api/espnow.rst Outdated Show resolved Hide resolved
docs/en/api/espnow.rst Outdated Show resolved Hide resolved
docs/en/api/espnow.rst Outdated Show resolved Hide resolved
libraries/ESP_NOW/src/ESP32_NOW.h Outdated Show resolved Hide resolved
Co-authored-by: Lucas Saavedra Vaz <[email protected]>
@lucasssvaz lucasssvaz requested a review from SuGlider April 2, 2024 19:11
Copy link
Member Author

@P-R-O-C-H-Y P-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

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

@me-no-dev, @SuGlider PR is ready, all examples tested.

@me-no-dev me-no-dev merged commit 1a80829 into espressif:master Apr 3, 2024
40 checks passed
Comment on lines +28 to +29
const uint8_t * addr() const;
bool addr(const uint8_t *mac_addr);

Choose a reason for hiding this comment

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

Why did nobody reacted on the fact that this setter and getter missing the prefix get and set like the other getter/setters below?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think it's necessary and needed to be get/set. It's pretty straightforward what it does and how to use it. Its also well documented.

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: Review needed Issue or PR is awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants