WebThingsIO / zigbee-adapter

Zigbee adapter add-on for WebThings Gateway
Mozilla Public License 2.0
46 stars 29 forks source link

Fix Match_Desc_rsp with the correct NWKAddrOfInterest #146

Closed otaviojr closed 5 years ago

otaviojr commented 5 years ago

Hi,

I was trying to add some Nyce Open/Close sensors I have. But, they were not working. So, digging arround I discovered that the Match Descriptor Response was sending an invalid NWKAddrOfInterest address forcing the sensor to leave the network.

The NWKAddrOfInterest of the response must be the same of the request. The device is asking if the coordinator has the cluster. We need to answer that the coordinator has it, not the device.

At Zigbee specification, page 165, you can find this reference:

"If the NWKAddrOfInterest field of the original Match_Desc_req was not equal to the broadcast network address for all devices for which macRxOnWhenIdle = TRUE (0xfffd), the remote device shall set the NWKAddrOfInterest field to the same network address that was specified in the original Match_Desc_req command."

After this change, all my Nyce Open/Close sensors joined the network without any problem.

regards

dhylands commented 5 years ago

I recommend that you never work out of master in your fork, and always create a branch per PR.

otaviojr commented 5 years ago

Just opened a new PR on a separated branch.