Hello,
What is the recommendation to transmit large data (1-2 kB) from ZED to coordinator using Zigbee/Zboss library ?
Are there any tested examples ? (I couldn't find any in the SDK)
Thanks,
Sebastien
Hello,
What is the recommendation to transmit large data (1-2 kB) from ZED to coordinator using Zigbee/Zboss library ?
Are there any tested examples ? (I couldn't find any in the SDK)
Thanks,
Sebastien
Hi Sebastien,
What kind of packets are you going to transmit?
The maximum total size of a Zigbee packet is 128 bytes, but Zigbee use something called APS fragmentation, which allows you to send larger data units by fragmenting the data into smaller packets which are then sent and reassembled on the receiver side. Fragmentation is handled automatically by the stack when you allocate a buffer using zb_buf_get() or zb_buf_get_out_delayed_ext() and set max_size to the required payload size.
Best regards,
Marte
Hi Sebastien,
What kind of packets are you going to transmit?
The maximum total size of a Zigbee packet is 128 bytes, but Zigbee use something called APS fragmentation, which allows you to send larger data units by fragmenting the data into smaller packets which are then sent and reassembled on the receiver side. Fragmentation is handled automatically by the stack when you allocate a buffer using zb_buf_get() or zb_buf_get_out_delayed_ext() and set max_size to the required payload size.
Best regards,
Marte
Hi Marte,
That would be raw data.
As far as I can see in SDK 4.2.0 the usable payload for a zigbee frame is 52 bytes
/** MAC hdr: 9 3 (hdr, seq num) + 2 * 3 (short dst and src; dst panid) NWK hdr: 8 4 + 2*2 (dst, src short) NWK security: 18 APS hdr: 8 (max, without ext header and security) MAC footer: 2 Total: 9 + 8 + 18 + 8 + 2 = 45 bytes So we can send: 127 - 45 = 82 bytes */ #define ZB_APS_GUARANTEED_PAYLOAD_SIZE_WO_SECURITY \ ((MAX_PHY_FRM_SIZE) \ - ((MAX_MAC_OVERHEAD_SHORT_ADDRS) \ + (ZB_NWK_BASE_HDR_SIZE) \ + (ZB_NWK_MAX_SECURITY_HDR_SIZE) \ + (ZB_APS_BASE_HDR_SIZE)))
And the maximum number of fragments is 8 so not sure it's ideal.
Thanks,
Sebastien
Hi Sebastien,
I am not sure where you get that the maximum payload size is 52 from when the MAC, APS and NWK headers, security etc. are 45 bytes total, which leaves 82 bytes for the APS payload. The ZCL header only takes up a very small part of that.
Regardless, you are correct that the maximum number of APS fragments is 8, so fragmentation will not work for sending 1-2 kB of data.
Can you explain what you are trying to achieve? Why do you want to transmit 1-2 kB of data over Zigbee?
Best regards,
Marte
Sorry yes 82 bytes.
No I cannot communicate why we need to transmit such large data but this is what we want to do. Let's say it's arbitrary data that we want to read from the controller. The zigbee protocol has a Partition cluster but it doesn't seem implemented by ZBoss, not sure if there's something that has been tested / validated by ZBoss for such cases.
Hi Sebastien,
My reason for asking was that knowing what you want to achieve might make it easier to figure out the best solution to this.
If it is arbitrary data that you can split up and send in several packets yourself then you could do this manually without using the Partition cluster. This might be the easiest way to do this since, as you say, the Partition cluster is not implemented in ZBOSS. However, it is also possible to implement the Partition cluster yourself and use that.
I am not aware of anything like this being tested in ZBOSS, but I will verify with the developers.
Best regards,
Marte