-
Notifications
You must be signed in to change notification settings - Fork 41
Z-Stack rejects joins through routers unless coordinator is also permitting joins #53
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
Comments
So have you tried sending the same broadcast instead of unicast at startup? I see no harm sending MgmtPermitJoinReq as a broadcast with duration 0 at startup. |
Yes, that works. It's the unexpected behavior of |
so are you saying that if at some time you call |
and is this problem with both 3.0 and 1.2 or only 12 firmwares? |
Yep. Happens with the CC2531 and the CC2652R. Haven't tried Z-Stack 3 on the CC2531 but I don't think it'll behave differently. If |
Maybe it's possible to add the coordinator to some random group and send the I'll do more thorough testing in a few days. |
I don't have the low-level hardware or firmware access to test this, but it may be that Z-Stack will still send the transport key if a device tries to joins its network, even if the coordinator's beacons say that joins are not permitted. I'm unable to find any way to tell Z-Stack to permit joins without also advertising this in the coordinator's beacons. Is this what the EZSP |
I belive EZSP |
Send broadcast on startup and don't do anything on |
Good news: this does seem to be possible with firmware modifications and a new MT command. From what I understand:
I modified the permit joining command in the firmware to only set The new command would have to be something like Before I continue down this rabbit hole: @Adminiuga, is the purpose of |
Yes, permit_ncp() is solely for opening only coordinator for joining new devices |
Alright, so since bellows has |
On the other hand, if Maybe |
If we always call |
I'm going to close this issue for now. The root cause is known and the only software fix has been released. |
Fixed in a Z-Stack patch: Koenkk/Z-Stack-firmware@efac5ee (thanks @TheJulianJES) |
@TheJulianJES reported that joins done via specific devices do not work. I've confirmed this occurs with release 0.3.0 with multiple coordinators. The new device successfully associates through the target router but the coordinator kicks the new device off the network with an "APS remove device (0x07)" command instead of sending it the transport key.
Comparing the behavior of zigpy-znp and Z2M shows that the only difference is the following at startup:
ZDO.MgmtPermitJoinReq.Req(AddrMode=<AddrMode.NWK: 2>, Dst=0x0000, Duration=0, TCSignificance=1)
ZDO.MgmtPermitJoinReq.Req(AddrMode=<AddrMode.Broadcast: 3>, Dst=0xFFFC, Duration=0, TCSignificance=0)
The first command is sent on startup by zigpy-znp to fix the CC2531 Z-Stack Home 1.2 permanently permitting joins glitch. Unfortunately, it appears that sending any unicast permit join request to
0x0000
causes it to stop permitting joins later on. Sending a broadcast to all routers and the coordinator does not trigger this behavior. I've confirmed this on all of my Texas Instruments coordinators so it's not just a Z-Stack Home 1.2 bug.Since Home Assistant includes buttons to permit joins through specific routers as well as just the coordinator, I see two possible solutions:
ControllerApplication.permit
to always callControllerApplication.permit_ncp
as well. This has the unfortunate side effect of allowing new devices to join the coordinator directly as well as the desired router, which is not intuitive behavior.ControllerApplication.permit_ncp
a no-op in zigpy-znp and somehow disable the "add devices via this device" button in Home Assistant for the coordinator. Removing functionality is not ideal but all the visible buttons will do exactly what they say.The text was updated successfully, but these errors were encountered: