Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(zigbee): Save network channel after 1st joining for faster rejoin#11123

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

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

Description of Change

This PR improves Zigbee rejoining process, as the network channel is saved to zb NVRAM, so after device reset the scanning will occur only on the saved channel saving time and energy.

Tests scenarios

Tested using sleepy example and HA. (did not test the actual power consumption, but the reconnection is a lot faster)

Related links

Closes#10746

@P-R-O-C-H-YP-R-O-C-H-Y added Status: Review neededIssue or PR is awaiting review Area: ZigbeeIssues and Feature Request about Zigbee labelsMar 14, 2025
@P-R-O-C-H-YP-R-O-C-H-Y self-assigned thisMar 14, 2025
@github-actions
Copy link
Contributor

github-actionsbot commentedMar 14, 2025
edited
Loading

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message"feaz(zigbee): Move function to private and add set method":
    • type/action should be one of [change,ci,docs,feat,fix,refactor,remove,revert,test]

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

  • followConventional Commits style
  • correct format of commit message should be:<type/action>(<scope/component>): <summary>, for examplefix(esp32): Fixed startup timeout issue
  • allowed types are:change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 10 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 theConventional Precommit Linter).

👋Hello P-R-O-C-H-Y, we appreciate your contribution to this project!


📘 Please review the project'sContributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you haveread and signed theContributor License Agreement for this project.

Click to see more instructions ...


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

DangerJS is triggered with eachpush 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 isnot 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 manuallyretry these Danger checks, please navigate to theActions 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 against677a984

@github-actions
Copy link
Contributor

github-actionsbot commentedMar 14, 2025
edited
Loading

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
ESP32S30⚠️ +2200.00⚠️ +0.03000.000.00
ESP32S20⚠️ +2240.00⚠️ +0.03000.000.00
ESP32C30⚠️ +1800.00⚠️ +0.03000.000.00
ESP32C60⚠️ +2040.00⚠️ +0.040⚠️ +160.00⚠️ +0.06
ESP32H20⚠️ +2020.00⚠️ +0.040⚠️ +160.00⚠️ +0.06
ESP320⚠️ +2240.00⚠️ +0.03000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
Zigbee/examples/Zigbee_Color_Dimmer_Switch⚠️ +1960⚠️ +2040⚠️ +1800⚠️ +178⚠️ +16⚠️ +1820⚠️ +2200
Zigbee/examples/Zigbee_Gateway⚠️ +2160⚠️ +2240⚠️ +1780----⚠️ +2240
Zigbee/examples/Zigbee_On_Off_Switch⚠️ +2160⚠️ +2120⚠️ +1780⚠️ +1780⚠️ +1800⚠️ +2120
Zigbee/examples/Zigbee_Range_Extender⚠️ +1960⚠️ +2000⚠️ +1760⚠️ +174⚠️ +16⚠️ +1760⚠️ +2120
Zigbee/examples/Zigbee_Thermostat⚠️ +2200⚠️ +2120⚠️ +1760⚠️ +178⚠️ +16⚠️ +1800⚠️ +2080
Zigbee/examples/Zigbee_Analog_Input_Output------⚠️ +1960⚠️ +198⚠️ +16--
Zigbee/examples/Zigbee_CarbonDioxide_Sensor------⚠️ +198⚠️ +16⚠️ +2000--
Zigbee/examples/Zigbee_Color_Dimmable_Light------⚠️ +202⚠️ +16⚠️ +2020--
Zigbee/examples/Zigbee_Contact_Switch------⚠️ +1980⚠️ +1960--
Zigbee/examples/Zigbee_Dimmable_Light------⚠️ +2000⚠️ +1980--
Zigbee/examples/Zigbee_OTA_Client------⚠️ +2020⚠️ +1980--
Zigbee/examples/Zigbee_Occupancy_Sensor------⚠️ +200⚠️ +16⚠️ +1960--
Zigbee/examples/Zigbee_On_Off_Light------⚠️ +1980⚠️ +1980--
Zigbee/examples/Zigbee_Pressure_Flow_Sensor------⚠️ +1960⚠️ +2020--
Zigbee/examples/Zigbee_Scan_Networks------⚠️ +1960⚠️ +1960--
Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy------⚠️ +204⚠️ +16⚠️ +1940--
Zigbee/examples/Zigbee_Temperature_Sensor------⚠️ +1980⚠️ +198⚠️ +16--
Zigbee/examples/Zigbee_Vibration_Sensor------⚠️ +2000⚠️ +1960--
Zigbee/examples/Zigbee_Wind_Speed_Sensor------⚠️ +198⚠️ +16⚠️ +2000--
Zigbee/examples/Zigbee_Window_Covering------⚠️ +2040⚠️ +2000--

@github-actions
Copy link
Contributor

github-actionsbot commentedMar 14, 2025
edited
Loading

Test Results

 76 files   76 suites   13m 48s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit677a984.

♻️ This comment has been updated with latest results.

Copy link
Member

@lucasssvazlucasssvaz left a comment

Choose a reason for hiding this comment

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

LGTM

@P-R-O-C-H-YP-R-O-C-H-Y added Status: In Progress ⚠️Issue is in progress and removed Status: Review neededIssue or PR is awaiting review labelsMar 14, 2025
Copy link
Collaborator

@SuGliderSuGlider left a comment

Choose a reason for hiding this comment

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

LGTM

@SuGliderSuGlider added Status: Pending MergePull Request is ready to be merged and removed Status: In Progress ⚠️Issue is in progress labelsMar 14, 2025
@P-R-O-C-H-YP-R-O-C-H-Y added Status: In Progress ⚠️Issue is in progress and removed Status: Pending MergePull Request is ready to be merged labelsMar 14, 2025
@P-R-O-C-H-Y
Copy link
MemberAuthor

Still in progress. Please don't change the labels :) Need a small update

SuGlider reacted with thumbs up emoji

@SuGlider
Copy link
Collaborator

Still in progress. Please don't change the labels :) Need a small update

Sorry. I've read "review pending, instead..."

@P-R-O-C-H-YP-R-O-C-H-Yforce-pushed thefeat/zigbee-rejoin-scan-enhancement branch from225ad7e to1ff918bCompareMarch 18, 2025 10:18
@P-R-O-C-H-YP-R-O-C-H-Y added Status: Review neededIssue or PR is awaiting review and removed Status: In Progress ⚠️Issue is in progress labelsMar 18, 2025
@SuGliderSuGlider self-requested a reviewMarch 18, 2025 18:07
Copy link
Collaborator

@SuGliderSuGlider left a comment

Choose a reason for hiding this comment

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

LGTM

@P-R-O-C-H-YP-R-O-C-H-Y removed the Status: Review neededIssue or PR is awaiting review labelMar 18, 2025
@P-R-O-C-H-YP-R-O-C-H-Y added the Status: Pending MergePull Request is ready to be merged labelMar 18, 2025
@P-R-O-C-H-Y
Copy link
MemberAuthor

Marking as Pending merge, tested also by community.

@me-no-devme-no-dev merged commite2915c4 intoespressif:masterMar 19, 2025
56 checks passed
@def1149
Copy link

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

After more testing .... this change has problems.

Using the updated sleepy temperature example:

  1. If remove the EP in ZHA Home it will automatically re-adds, without me activating Add Device, the next time it tries to connect.
    This occurs even if Zigbee.factoryReset() is called.

  2. I can't add the EP to a different controller after it has been added to a different controller then removed

It appears that the information about the first controller is saved in NVM and not cleared by a Zigbee.factoryReset() so it reconnects to the first controller unless I reflash the device and erase nvm

As an aside, to cause Zigbee.factoryReset() in the sleepy temperature example the BOOT button must be held for 60+ seconds to be down the next time the EP wakes from sleep. I added a wake on external I/O to force an immediate wakeup. The BOOT button I/O is not an available external wake-up pin so I jumped IO9 to IO2 so IO2 goes low when the BOOT button is pressed and wakes up the ESP32 It's a hack but it works 😁

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

P-R-O-C-H-Y commentedMar 21, 2025
edited
Loading

@def1149 To have the answer also here, I am able to reproduce this behavior also with other manufacturer devices.
It looks like ZHA is not closing the network when you leave the "add device" screen and keeping it open for some more time.

about the factoryReset() in sleepy sensor, I have also a reset button on my ESP devkit, so I just hold the BOOT button and click the RESET button to wake up the esp.

@def1149
Copy link

def1149 commentedMar 21, 2025
edited
Loading

@P-R-O-C-H-Y I'm going to remove a device that's been running overnight

Of course you're right about restarting and holding the boot button and pressing the reset to force a factoryReset()

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@lucasssvazlucasssvazlucasssvaz approved these changes

@SuGliderSuGliderSuGlider approved these changes

Assignees

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

Labels

Area: ZigbeeIssues and Feature Request about ZigbeeStatus: Pending MergePull Request is ready to be merged

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Zigbee: Improve the sleep sketch with regard to energy requirements

5 participants

@P-R-O-C-H-Y@SuGlider@def1149@lucasssvaz@me-no-dev

[8]ページ先頭

©2009-2025 Movatter.jp