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 Zigbee examples #9024

Merged
merged 7 commits into from
Feb 1, 2024
Merged

Conversation

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

@P-R-O-C-H-Y P-R-O-C-H-Y commented Dec 19, 2023

Description of Change

This PR adds 2 examples to demonstrate usage of Zigbee stack:

  • Zigbee_Light_Bulb -> Zigbee end device with LED.
  • Zigbee_Light_Switch -> Zigbee Coordinator switching the LED on/off of the end device.

Supported SoCs are ESP32C6 and ESP32-H2.

Tests scenarios

Tested locally by flashing Zigbee_Light_Bulb to ESP32-C6 DevKitM and Zigbee_Light_Switch to ESP32-H2 DevKitM.
CI is skipping the examples for now, as we cannot specify the FQBN.

Related links

Closes #8807
Blocked by #9025 (new GPIO Interrupt enable/disable methods) -> Merged

@P-R-O-C-H-Y P-R-O-C-H-Y added the Area: Libraries Issue is related to Library support. label Dec 19, 2023
@P-R-O-C-H-Y P-R-O-C-H-Y added this to the 3.0.0 milestone Dec 19, 2023
@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Dec 19, 2023
Copy link
Contributor

github-actions bot commented Dec 19, 2023

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message "fix(example): Removed Serial and updated readme.":
    • summary should not end with a period (full stop)

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 7 commits (simplifying branch history).
⚠️

The source branch "Zigbee-examples" incorrect format:

  • contains uppercase letters. This can cause troubles on case-insensitive file systems (macOS).
    Please rename your branch.

👋 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.
- 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 8169a43

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.

I have mixed feeling about it. It is an IDF code translated to compile in Arduino IDE.
I think that a broader work for creating comprehensive Arduino Classes would be more valuable.

This could be part of an example "in our own GH", but I'm sure this should be in the ESP32 Arduino repository.

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.

I agree with @SuGlider. Just like the BLEMesh examples were added to gist, I think should be added there and linked in the docs until we have a proper lib.

@VojtechBartoska VojtechBartoska added the Type: Example Issue is related to specific example. label Dec 20, 2023
@P-R-O-C-H-Y
Copy link
Member Author

@lucasssvaz @SuGlider Lets discuss it on todays meeting :)

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.

As we discussed in the meeting, LGTM. Just need to fix the CI.

@VojtechBartoska
Copy link
Contributor

Seems that we can close #8807 when this will be merged.

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

Added skip files for all SoCs to skip those examples in the Github CI, as we are not able now to specify FQNB separately for each example.

@P-R-O-C-H-Y P-R-O-C-H-Y mentioned this pull request Dec 21, 2023
5 tasks
@P-R-O-C-H-Y P-R-O-C-H-Y added the Status: Pending Merge Pull Request is ready to be merged label Dec 21, 2023
}

// Start Zigbee task
xTaskCreate(esp_zb_task, "Zigbee_main", 4096, NULL, 5, NULL);
Copy link
Member

Choose a reason for hiding this comment

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

why not run the main task in loop?

Copy link
Member

Choose a reason for hiding this comment

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

or the button task?

neopixelWrite(LED_PIN,0,0,0);

//Start Zigbee task
xTaskCreate(esp_zb_task, "Zigbee_main", 4096, NULL, 5, NULL);
Copy link
Member

Choose a reason for hiding this comment

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

this task looks like something that you can just execute here.

@VojtechBartoska VojtechBartoska modified the milestones: 3.0.0, 3.0.0-RC1 Jan 30, 2024
@me-no-dev
Copy link
Member

@P-R-O-C-H-Y ping

@me-no-dev me-no-dev removed the Status: Pending Merge Pull Request is ready to be merged label Jan 31, 2024
@P-R-O-C-H-Y
Copy link
Member Author

P-R-O-C-H-Y commented Feb 1, 2024

@me-no-dev Is it ok now?

  • Removed the nvs_flash_init()
  • In switch example, the button check now runs in loop
  • I kept the Zigbee task for both examples, to keep the same approach. As in the switch example the loop runs the Button check.
  • Fixed Zigbee ZCZR partition, in which I wrongly set an Offset.

@me-no-dev me-no-dev merged commit d14873a into espressif:master Feb 1, 2024
39 checks passed
@taiwansensortw
Copy link

I've seen examples of Zigbee devices like Zigbee_Light_Bulb and Zigbee_Light_Switch. Could you provide an example for a sensor, such as one for temperature and humidity? This would make the entire Zigbee architecture and usage clearer, allowing more people to get involved in this field.

@P-R-O-C-H-Y P-R-O-C-H-Y mentioned this pull request Aug 9, 2024
17 tasks
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. Type: Example Issue is related to specific example.
Projects
Development

Successfully merging this pull request may close these issues.

Support of Zigbee protocol
6 participants