cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB5MM-DK, connecting to Tuya gateway with zigbee

eskomj
Associate III

Hello,

How should I make connection to the Tuya gateway with zigbee? I have read zigbee wiki dokumentation about zigbee binding. I have understand that I should use "find and bind" mechanism in that case. I tried to find suitable example from github, but I'm not shure, which one is the closest to my case. The goal is to make some sensor value to be seen on Tuya smart home app.

Connectivity:Zigbee Binding - stm32mcu

STM32CubeWB/Projects/P-NUCLEO-WB55.Nucleo/Applications/Zigbee at master · STMicroelectronics/STM32CubeWB · GitHub

I understood that I should use method ZbStartupFindBindStart()

Esko

 

12 REPLIES 12

Hi @eskomj,

Thanks for the update.

Effectively, it seems that the end device doesn't send the association request due probably to the quality of the beacon frame as " lqi = 56 , cost = 5"

Indeed, the STM32WB Zigbee device is supposed to only select parent with a good beacon request cost =3 or lower.

To disable this check you need to enable the flag ZB_BDB_FLAG_IGNORE_COST_DURING_JOIN :

Please find below the change to apply in the function APP_ZIGBEE_StackLayersInit file (app_zigbee.c)

/**
* @brief Initialize Zigbee stack layers
* @param None
* @retval None
*/
static void APP_ZIGBEE_StackLayersInit(void)
{
APP_DBG("APP_ZIGBEE_StackLayersInit");

zigbee_app_info.zb = ZbInit(0U, NULL, NULL);
assert(zigbee_app_info.zb != NULL);

/* Create the endpoint and cluster(s) */
APP_ZIGBEE_ConfigEndpoints();

/* Configure the joining parameters */
zigbee_app_info.join_status = (enum ZbStatusCodeT) 0x01; /* init to error status */
zigbee_app_info.join_delay = HAL_GetTick(); /* now */
zigbee_app_info.startupControl = ZbStartTypeJoin;
enum ZbStatusCodeT status;
uint32_t val32 = ZB_BDB_FLAG_IGNORE_COST_DURING_JOIN;
status = ZbBdbSet(zigbee_app_info.zb, ZB_BDB_Flags, &val32, sizeof(val32));
/* Initialization Complete */
zigbee_app_info.has_init = true;

/* run the task */
UTIL_SEQ_SetTask(1U << CFG_TASK_ZIGBEE_NETWORK_FORM, CFG_SCH_PRIO_0);
} /* APP_ZIGBEE_StackLayersInit */

Could you please try with this new config and update the status ?

Best regards,

Ouadi

Thank you, Ouadi! The signal was too weak. I brough gateway closer. Was bit misleading when Nedis temperature sensor though worked. 

Ouadi
ST Employee

Have you been able to join the network ? if so, could you please click on "accepted as solution" ?

Best regards,

Ouadi