zigpy / bellows

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

Source routing fixes #626

Closed puddly closed 2 months ago

puddly commented 4 months ago

Two fixes:

  1. setSourceRoute is a no-op in EZSPv9 and above, the command does nothing. There is currently no known way to send packets with a specific source route in these EZSP versions. Maybe emberOverrideAppendSourceRouteHandler can help if we create a custom XNCP command to maintain a temporary table of source routes per NWK address?
  2. According to Silicon Labs, IEEE address discovery broadcasts are their solution to the missing source route problem. The coordinator will use them in place of normal routing commands to discover routes to a specific device if the NCP isn't aware of a source route to it. Enabling normal route discovery will actually cause issues with routers, as they will flip between source routing and normal routing when receiving these packets.

CC @TheJulianJES

codecov[bot] commented 4 months ago

Codecov Report

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

Project coverage is 99.16%. Comparing base (8eb257d) to head (2bc218e).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## dev #626 +/- ## ========================================== + Coverage 99.13% 99.16% +0.02% ========================================== Files 50 50 Lines 3456 3459 +3 ========================================== + Hits 3426 3430 +4 + Misses 30 29 -1 ```

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

TheJulianJES commented 4 months ago

Applied this fix on my production setup. Unfortunately, I'm still seeing "missing routes" when testing 7 minutes after rebooting HA (just unable to toggle certain lights). I'll do more testing later.

dmulcahey commented 4 months ago

I have a branch somewhere where I was trying to manually send a MTOR request right after startup. Wonder if that is worth exploring more.

dmulcahey commented 4 months ago

I have a branch somewhere where I was trying to manually send a MTOR request right after startup. Wonder if that is worth exploring more.

https://github.com/zigpy/bellows/compare/dev...dmulcahey:bellows:dm/refresh-routes

https://github.com/zigpy/bellows/compare/dev...dmulcahey:bellows:dm/improve-source-routing

looks like I had 2 branches out there.... maybe some combo of this + tweaking will help. I never got too far w/ testing.

puddly commented 4 months ago

I've implemented "dumb" source routing as a firmware extension. Alternate branches:

Network startup and mass command sending is now fast 😄