zigpy / bellows

A Python 3 project to implement EZSP for EmberZNet devices
GNU General Public License v3.0
177 stars 86 forks source link

Always send `version(4)` when resetting #589

Closed puddly closed 8 months ago

puddly commented 8 months ago

This is the root cause of https://github.com/home-assistant/core/issues/102503.

Firmware crashes were seen on EZSPv6 but not on the v8 stick I was testing when I initially added this special case. A HUSBZB-1 running EZSPv8, however, still crashes. This PR removes the protocol version limitation for removing this config.

codecov[bot] commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (9cc1cde) 99.83% compared to head (fa56666) 99.83%.

:exclamation: Current head fa56666 differs from pull request most recent head 7370b7b. Consider uploading reports for the commit 7370b7b to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #589 +/- ## ========================================== - Coverage 99.83% 99.83% -0.01% ========================================== Files 68 68 Lines 4882 4881 -1 ========================================== - Hits 4874 4873 -1 Misses 8 8 ``` | [Files](https://app.codecov.io/gh/zigpy/bellows/pull/589?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy) | Coverage Δ | | |---|---|---| | [bellows/ezsp/\_\_init\_\_.py](https://app.codecov.io/gh/zigpy/bellows/pull/589?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=zigpy#diff-YmVsbG93cy9lenNwL19faW5pdF9fLnB5) | `99.40% <100.00%> (-0.01%)` | :arrow_down: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

MattWestb commented 8 months ago

I think EM35X and ÉFR32GM1X devices is getting short of RAM then stretching them to much but its also depends of the config of the firmware and its little different version around here. MG12, MG13 and all MG2X shall not getting problems with RAM so fast then they is having plenty of it as long the firmware is OK configured. I only running one EZSP / NCP with MG1P (Billy) and its restarting little now and then but no big problems (all test system is running RCP).

puddly commented 8 months ago

I'm renaming this PR because the problem is not what I initially suspected.

The root cause is...sending version(4) is required when you reset! Even though version(8) appears to work and the protocol version is upgraded, random crashes appear during startup. Sending version(4) before version(8) fixes the CONFIG_PACKET_BUFFER_COUNT issue as well.