Is ZB_APS_ADDR_MODE_BIND_TBL_ID actually supported?

I am trying to modify the Zigbee light switch example to transmit commands to the first bound endpoint, rather than to a bulb address determined by the app logic:

 ZB_ZCL_ON_OFF_SEND_REQ(bufid,
bulb_ctx.short_addr,
ZB_APS_ADDR_MODE_BIND_TBL_ID,
0,
LIGHT_SWITCH_ENDPOINT,
ZB_AF_HA_PROFILE_ID,
ZB_ZCL_DISABLE_DEFAULT_RESPONSE,
cmd_id,
NULL);

I do not see this case handled in functions like zb_zcl_finish_and_send_packet_common() so that leads me to suspect that the implementation might not be complete.  The only place I ever see it mentioned is in include/zboss_api_aps.h, and only to define the symbol.  I do not have access to ZBOSS source code, however, so I can't see if it is used internally.

I used my Zigbee controller to perform the binding and it got a success indication back.  However the result of this command is a fatal error:

I: nRF5 802154 radio initialized
*** Booting Zephyr OS build v2.7.99-ncs1 ***
I: Starting ZBOSS Light Switch example
I: ZBOSS Light Switch example started
I: Production configuration is not present or invalid (status: -1)
I: Zigbee stack initialized
I: Joined network successfully on reboot signal (Extended PAN ID: xxxx, PAN ID: xxxx)
I: Send ON/OFF command: 2
E: ZBOSS fatal error occurred
I: nRF5 802154 radio initialized

If it is unsupported, what is the alternative?  Can/should I read the binding table from the app?

Parents
  • Just for anyone looking at this, the solution is (confusingly) to use ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT. This will look up all bound targets and send to them. I had to reverse-engineer ZBOSS to figure this out. ZB_APS_ADDR_MODE_BIND_TBL_ID is unimplemented in this code path and triggers a ZBOSS assert if used.

    Example:

    ZB_ZCL_ON_OFF_SEND_REQ(bufid,
    fake_addr,
    ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT,
    0,
    LIGHT_SWITCH_ENDPOINT,
    ZB_AF_HA_PROFILE_ID,
    ZB_ZCL_DISABLE_DEFAULT_RESPONSE,
    cmd_id,
    NULL);

Reply
  • Just for anyone looking at this, the solution is (confusingly) to use ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT. This will look up all bound targets and send to them. I had to reverse-engineer ZBOSS to figure this out. ZB_APS_ADDR_MODE_BIND_TBL_ID is unimplemented in this code path and triggers a ZBOSS assert if used.

    Example:

    ZB_ZCL_ON_OFF_SEND_REQ(bufid,
    fake_addr,
    ZB_APS_ADDR_MODE_DST_ADDR_ENDP_NOT_PRESENT,
    0,
    LIGHT_SWITCH_ENDPOINT,
    ZB_AF_HA_PROFILE_ID,
    ZB_ZCL_DISABLE_DEFAULT_RESPONSE,
    cmd_id,
    NULL);

Children
  • That is what I have been using, too.  I think Nordic recommended it to me in another (private) ticket a few months back.

    It works OK with the Philips Hue bulbs.  I've had less success with some of the Ikea bulbs; sometimes ZBOSS will inexplicably send my toggle command to the ZC rather than to the bulb itself, so the bulb state never changes.

    We've had so many of these weird undebuggable ZBOSS problems that my client is seriously thinking about scrapping the project and moving to OpenThread.

Related