This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52 custom payload with ZigBee ZBOSS

Hello,

I would like to create a star network (with no routers) in ZigBee with nRF52 (also with multiprotocol BLE). I examined the relevant SDK (nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8) for examples and I found all of them kind of overwhelming for me. I don't want to conform to any ZCL predefined profiles, I'm not developing any home automation or such. I would like to send/receive simple, custom payloads with variable length.
I noticed there is the APS module in the ZBOSS library that has zb_aps_send_user_payload()function:

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.1.0%2Fgroup__aps__user__payload.html&anchor=ga11b3dc62d0eb864aaa699083ce1cf1ac

It looks like it's meant to send custom low-level data to a device. Is it true?
What is the proper way to send custom binary packets to devices in a network?

Thank you for your help.

Best Regards,
rmakl

Parents
  • Hi rmakl,

    zb_aps_send_user_payload send user payload using APS, which is the Application Support Sublayer in Zigbee, and sits above the NWK (Network) layer. This layer is below the AF (Application Framework) and the ZDO (Zigbee Device Object). Although the Zigbee application interface is formed by both APS and AF, you should use the functions in AF, and not in APS, as AF has a set of routines (API) that is used to interact with Zigbee, while APS is more about filtering out packets, generating automatic retries for failed packages, maintaining application-level tables, etc.

    In addition to this, Zigbee is built in such a way that you're supposed to use the clusters in ZCL (Zigbee Cluster Library), which is contained in the AF, in your project. These clusters implement the device functionality, and the application uses the API to parse ZCL commands. Therefore, you should find a cluster that does what you want your project to do and use that in your application, rather than trying to use functions on the APS layer. However, there are ways to declare custom clusters and configure default ZCL command handler override, but I would not recommend doing this unless you have experience with Zigbee.

    As you've seen in the examples, you have to implement several things in order to get Zigbee to work, such as signal handlers, callback functions, declaring attributes, etc. It can be overwhelming, but they are needed for Zigbee to work. The simplest way to implement your project would be to begin with the light control example, and then find which ZCL cluster matches what you want to do, and then try to implement that cluster in your project. There's a guide on implementing a Zigbee end product with ZCL that can be of help. Since you're asking about sending binary packets, you can take a look at the binary input cluster. There's also the messaging cluster, which is used for passing text messages between Zigbee devices. You should also check out the ZCL specification for the clusters you want to use.

    You also mentioned that you wanted to use Zigbee in multiprotocol with BLE. In the SDK, this is done using dynamic multiprotocol, where the radio hardware is time-sliced between the protocols. We also have some Zigbee multiprotocol examples you can check out.

    Best regards,

    Marte

Reply
  • Hi rmakl,

    zb_aps_send_user_payload send user payload using APS, which is the Application Support Sublayer in Zigbee, and sits above the NWK (Network) layer. This layer is below the AF (Application Framework) and the ZDO (Zigbee Device Object). Although the Zigbee application interface is formed by both APS and AF, you should use the functions in AF, and not in APS, as AF has a set of routines (API) that is used to interact with Zigbee, while APS is more about filtering out packets, generating automatic retries for failed packages, maintaining application-level tables, etc.

    In addition to this, Zigbee is built in such a way that you're supposed to use the clusters in ZCL (Zigbee Cluster Library), which is contained in the AF, in your project. These clusters implement the device functionality, and the application uses the API to parse ZCL commands. Therefore, you should find a cluster that does what you want your project to do and use that in your application, rather than trying to use functions on the APS layer. However, there are ways to declare custom clusters and configure default ZCL command handler override, but I would not recommend doing this unless you have experience with Zigbee.

    As you've seen in the examples, you have to implement several things in order to get Zigbee to work, such as signal handlers, callback functions, declaring attributes, etc. It can be overwhelming, but they are needed for Zigbee to work. The simplest way to implement your project would be to begin with the light control example, and then find which ZCL cluster matches what you want to do, and then try to implement that cluster in your project. There's a guide on implementing a Zigbee end product with ZCL that can be of help. Since you're asking about sending binary packets, you can take a look at the binary input cluster. There's also the messaging cluster, which is used for passing text messages between Zigbee devices. You should also check out the ZCL specification for the clusters you want to use.

    You also mentioned that you wanted to use Zigbee in multiprotocol with BLE. In the SDK, this is done using dynamic multiprotocol, where the radio hardware is time-sliced between the protocols. We also have some Zigbee multiprotocol examples you can check out.

    Best regards,

    Marte

Children
No Data
Related