cancel
Showing results for 
Search instead for 
Did you mean: 

How do I enable consistent data requests (polling) for setting a Nucleo board as Zigbee client?

VWu.1
Associate

I am using STM32WB Discovery kit for STM32WBB5MM MCUs for development. I've setup the board as a RFD, Centralized End Device. I can do MAC association with a Zigbee server just fine. However, it would stop sending data requests after 8 requests as shown below:

 [M0] [00000000.820][API] Scan Done - unscan channels 0x0

 [M0] [00000000.516][API]  Poll Request - g_MAC_SUCCESS_c State !

 [M0] [00000000.524][PLATFORM]        ZbZdoDeviceAnnce : Sending Device_Annce for 0xa708

[M4 APPLICATION] ZbStartup Callback (status = 0x00)

 [M0] [00000000.579][API]  Poll Request - g_MAC_SUCCESS_c State !

 [M0] [00000001.079][API]  Poll Request - g_MAC_SUCCESS_c State !

 [M0] [00000001.578][API]  Poll Request - g_MAC_SUCCESS_c State !

 [M0] [00000002.078][API]  Poll Request - g_MAC_SUCCESS_c State !

 [M0] [00000005.579][API]  Poll Request - g_MAC_SUCCESS_c State !

 [M0] [00000006.078][API]  Poll Request - g_MAC_SUCCESS_c State !

 [M0] [00000006.579][API]  Poll Request - g_MAC_SUCCESS_c State !

 [M0] [00000007.079][API]  Poll Request - g_MAC_SUCCESS_c State !

And I know it is not stuck anywhere because if I send a bit status report, it would send it out just fine along with a few more data requests. I'd like to keep the continuous polling with configurable period so that server can send unsolicited data to the client.

How do I configure that from STM32CubMX?

Thanks in advance for any help.

2 REPLIES 2
Remy ISSALYS
ST Employee

Hello,

Polling is required to get Indirect Data from Zigbee parent in SED (Sleepy End Device) case.

Keeping a SED in fast polling mode can be achieved using below API.

  • struct nwk_fastpoll_entry_t *ZbNwkFastPollRequest(struct ZigBeeT *zb, unsigned int delay, unsigned int timeout)

Delay is an offset to Fast Poll start and can not be higher than nwkFastPollPeriod.

nwkFastPollPeriod gives the Fast Poll period. It can be updated using dedicated API but it will impact every data exchange.

So, it is not advised to change default value (500 ms). nwkFastPollPeriod allowed range is 250 to 1000 ms.

Timeout is the amount of time Fast Poll will be enabled. If you want fast poll to remain active forever, timeout parameter shall be set to 0.

By default, a SED will wake up every EDKA_Timeout / 4 to send End Device Timeout Request.

Default EDKA_Timeout is 8 mn. So, End Device Timeout Requests are sent every 2 mn.

However, application is not notified of End Device Timeout Request RX.

As a result, it is hard to synchronize application & Zigbee stack to ensure successful data exchange with a SED.

In order not to remain in Fast Poll mode forever, you may also consider using the Poll Control cluster to exchange data with a SED.

Best Regards

Andrew_Holiczer
Associate

Hi,

you can also try something like this:

uint8_t timeout = 2;

ZbNwkSet(zigbee_app_info.zb, ZB_NWK_NIB_ID_EndDeviceTimeoutDefault, &timeout, sizeof(timeout));

Registering a poll cluster client enables you to config some parameters:

struct ZbApsAddrT addr;

   addr.endpoint = ENDPOINT_1;

   addr.mode = ZB_APSDE_ADDRMODE_SHORT;

   addr.nwkAddr = ZbShortAddress(zigbee_app_info.zb);

   struct ZbZclPollControlClientSetLongReq poll_long_req = {.interval = 4 * 60, .dst = addr};

   struct ZbZclPollControlClientSetShortReq poll_short_req = {.interval = 4 * 1, .dst = addr};

   struct ZbZclPollControlClientCheckinInfo poll_info = {.fast_poll_timeout = 4 * 60, .start_fast_poll = false, .dst = addr};

   status = zcl_poll_client_set_long_intvl_req(zigbee_app_info.poll_control_client_1, &poll_long_req, NULL, NULL);

   status = zcl_poll_client_set_short_intvl_req(zigbee_app_info.poll_control_client_1, &poll_short_req, NULL, NULL);

   status = zcl_poll_client_set_checkin_rsp(zigbee_app_info.poll_control_client_1, &poll_info);

Good luck and best regards.