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?

  • Hello,

    I am not sure what input parameters you used in the ZB_ZCL_ON_OFF_SEND_REQ(). Why did you choose to use ZB_APS_ADDR_MODE_BIND_TBL_ID instead of ZB_APS_ADDR_MODE_16_ENDP_PRESENT (which is used in the light switch example)?

    Do you see callbacks using the unmodified example in zb_zcl_finish_and_send_packet_common()? Or why do you expect it to be a callback there?

    And what callback exactly are you looking for? Do you want a confirmation from the receiver? In that case, I believe you need to change ZB_ZCL_DISABLE_DEFAULT_RESPONSE with ZB_ZCL_ENABLE_DEFAULT_RESPONSE, don't you agree?

    Or if you want a callback when the packet is sent, perhaps you want to look into adding a callback in the last input parameter, instead of NULL. If you look at the definition of ZB_ZCL_ON_OFF_SEND_REQ in zb_zcl_on_off.h, you can see that the last parameter is the "cb - callback to call to report send status".

    Best regards,

    Edvin

  • I changed: 1) ZB_APS_ADDR_MODE_16_ENDP_PRESENT to ZB_APS_ADDR_MODE_BIND_TBL_ID, and 2) bulb_ctx.endpoint to 0 (or 1).  The remainder of the arguments are the same as in the example.  Per the documentation for ZB_APS_ADDR_MODE_BIND_TBL_ID this would tell ZBOSS to send the command to the first bound endpoint, rather than to an explicitly specified address/endpoint.  This is what I want, because my application doesn't even know the endpoint address.

    If this is incorrect, could you please provide a rundown of how an application should handle the case where the controller has successfully bound it to another endpoint/node, and it now wants to send commands to that bound endpoint?  I have not found documentation on this anywhere.  The high level goal of this exercise (having a button control a light bulb directly) is in the original post on this ticket.

    > Do you see callbacks using the unmodified example in zb_zcl_finish_and_send_packet_common()? Or why do you expect it to be a callback there?

    I did not change any of the sample code regarding callbacks.  My only changes involved addressing.

  • Hello,

    Sorry, I have been busy for a couple of days. 

    Looking into this again now. 

    I interpret the documentation on this the same as you. Have you bound to anything with this device at the time when you call the ZB_ZCL_ON_OFF_SEND_REQ()? Or can the issue be that it is trying to access an address that isn't present anywhere? If so, what did you bind to? And what sort of endpoint did you bind to? Is it possible to send an on_off command to that endpoint?

    I understand that your "application doesn't know the endpoint address.", but does it know what sort of endpoint it is bound to, if any?

    Best regards,

    Edvin

  • Have you bound to anything with this device at the time when you call the ZB_ZCL_ON_OFF_SEND_REQ()? Or can the issue be that it is trying to access an address that isn't present anywhere? If so, what did you bind to? And what sort of endpoint did you bind to? Is it possible to send an on_off command to that endpoint?

    Yes, it is bound to a Hue light bulb.  If I hardcode the bulb's short address into the program and use ZB_APS_ADDR_MODE_16_ENDP_PRESENT, I am able to successfully send a toggle command.  Likewise, if I adapt Marte's sample code from https://devzone.nordicsemi.com/f/nordic-q-a/85787/binding-an-nrf52-zigbee-light-switch-to-a-light-bulb to grab the first entry from the gc_aps_bind_dst_table and translate that to a short address, it also successfully sends a toggle command to the bulb.  So that demonstrates that the binding is successful and that ZBOSS on the light_switch has stored the binding.

  • Hello,

    Is it possible for me to reproduce this using a couple of nRF52840 DKs? If so, can you please upload the projects/samples needed to replicate the issue here? (zip the project folders that you use, and let me know if you have any particular build command options).

    BR,
    Edvin

Related