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

Router firmware is open for new device joins on powercycle. #30

Closed
Adminiuga opened this issue Jan 31, 2019 · 11 comments
Closed

Router firmware is open for new device joins on powercycle. #30

Adminiuga opened this issue Jan 31, 2019 · 11 comments

Comments

@Adminiuga
Copy link

@Adminiuga Adminiuga commented Jan 31, 2019

Hi,
I'm running CC2531 with router firmware to extend coverage for my Xiaomi devices, but the problem I'm having that whenever CC2531 is power cycled, it opens network for new device joins which pretty much can expose the entire network.

Is there a setting for the router firmware not to allow joins on restart?

@Koenkk

This comment has been minimized.

Copy link
Owner

@Koenkk Koenkk commented Jan 31, 2019

@ptvoinfo is this some setting in the firmware?

@ptvoinfo

This comment has been minimized.

Copy link

@ptvoinfo ptvoinfo commented Jan 31, 2019

@Koenkk I didn't find the corresponding setting.
@Adminiuga How to check it? I think the router just re-transmits all packets to a coordinator and it allows or rejects the device.

@Adminiuga

This comment has been minimized.

Copy link
Author

@Adminiuga Adminiuga commented Jan 31, 2019

@ptvoinfo I don't think a Zigbee router just re-transmits all packets to coordinator. For a brand new (or factory reset) zigbee device to join the network, it must find a router which "permits" new joins. A Zigbee router can be told to "permit new joins" by sending it a ZDO 'Mgmt_permit_joining_req' command Cluster_ID==0x0036 only after that a new device can join the network and fetch the network key from the trust center.

So I don't have a direct way to verify it, but indirectly it goes like this:

  1. Normally I can't just join a new device to zigbee network
  2. I remove an existing device (color bulb) or factory reset it. Upon power cycle, it just changes color indicating that it is not joined to the network. No matter how many times I powercycle it, or how long I wait it won't join the network
  3. The bulb joins the network only after I call for "zha.permit" service
  4. Alternatively I just power cycle a CC2531 router and bulb joins the network without me calling zha.permit. If I remove the bulb from the network it immediately rejoins it, because CC2531 is still open for new joins. In the traces I can see that the reported parent (the router which allowed the new device into the network) is CC2531 router

let me do some more digging to see if I could get a neighbor table from an adjacent device

@Adminiuga

This comment has been minimized.

Copy link
Author

@Adminiuga Adminiuga commented Jan 31, 2019

Unfortunately the "neighbor table' from an adjacent device has "unknown" status for new joins. But I was able to reproduce and confirm issue again:

  1. power cycle CC2531 router
  2. remove a device from Zigbee network
  3. it immediately joins again through CC2531 router

If a send Mgmt_permit_joining_req ZDO request with a duration of 10s, then after 10s CC2531 stops accepting new joins. So it behaves correctly in respect to ZDO mgmt_permit_joining behavior, just for whatever reason it defaults to allowing new joins on a power cycle.

@Adminiuga

This comment has been minimized.

Copy link
Author

@Adminiuga Adminiuga commented Feb 1, 2019

@ptvoinfo any chance you could provide a .patch file for CC2531 router firmware?
Trying to compile it, but without too much luck for now. Is there any reason you went with Z-Stack 1.2.2 instead of 3.0.2?

@ptvoinfo

This comment has been minimized.

Copy link

@ptvoinfo ptvoinfo commented Feb 1, 2019

@Adminiuga

This comment has been minimized.

Copy link
Author

@Adminiuga Adminiuga commented Feb 2, 2019

I can't reproduce the issue anymore with the new firmware. Will update my other routers and do more testing, but so far looks good!

@ptvoinfo

This comment has been minimized.

Copy link

@ptvoinfo ptvoinfo commented Feb 2, 2019

@Adminiuga Does the router allow you to pair a device after a command from the coordinator?

@Adminiuga

This comment has been minimized.

Copy link
Author

@Adminiuga Adminiuga commented Feb 4, 2019

@ptvoinfo yes, I send 0x0034 ZDO request specifically to CC2531 and pair my Xiaomi sensors. Using the routers mostly for xiaomi devices, as those are picky about their parent devices.

@Adminiuga

This comment has been minimized.

Copy link
Author

@Adminiuga Adminiuga commented Feb 4, 2019

I've updated both of my CC2531 routers and so far everything is running good. I consider this fixed and going to close this one.

@abmantis

This comment has been minimized.

Copy link

@abmantis abmantis commented Sep 30, 2019

@ptvoinfo @Adminiuga are the firmware files in this repo updated with this fix? The ones for CC2531 are from 09 2018.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.