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

Force TX after CCA failure on EZSP v7+ #576

Merged
merged 6 commits into from
Aug 4, 2023

Conversation

puddly
Copy link
Contributor

@puddly puddly commented Aug 4, 2023

EMBER_VALUE_FORCE_TX_AFTER_FAILED_CCA_ATTEMPTS seems to work in the latest Gecko SDK release! This allows the radio to force a transmit, even after CCA failures.

Normally this sounds like a bad idea but the alternative is to allow the radio to silently fail with a generic "delivery error" (TODO: figure out a way to infer the actual error code).

@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (f52d73e) 99.77% compared to head (e0ce7d9) 99.77%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #576   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files          67       67           
  Lines        4837     4855   +18     
=======================================
+ Hits         4826     4844   +18     
  Misses         11       11           
Files Changed Coverage Δ
bellows/ezsp/config.py 100.00% <100.00%> (ø)
bellows/ezsp/protocol.py 97.56% <100.00%> (+0.26%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@puddly
Copy link
Contributor Author

puddly commented Aug 4, 2023

It appears that this change is compatible with many more versions of EmberZNet than I thought: reading the value with getValue fails with EzspStatus.ERROR_INVALID_ID, but the write will still succeed. I've confirmed that the CCA bypassing works as far back as EmberZNet 7.1.1.0, and I'm sure previous releases too, meaning this PR will affect most modern EZSP adapters.

@puddly
Copy link
Contributor Author

puddly commented Aug 4, 2023

And with the adapter in a noisy environment, here are some traffic captures:

With CCA bypass (coordinator responds to beacon request)

image

Without CCA bypass (coordinator doesn't respond)

image

A device was only able to join (successfully might I add) in the first capture.

@MattWestb
Copy link
Contributor

Great finding and work done our master HACKER !!!!

@puddly puddly merged commit d5444cf into zigpy:dev Aug 4, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants