cancel
Showing results for 
Search instead for 
Did you mean: 

Sending a Zigbee message from board to board triggered by I2C Temperature Sensor

TMelz.1
Associate

I am currently using 2 STM32WB55RG MCUs (one as a server and one as a client) with a Si7021-A20 temperature sensor that is completely functional on the "client" MCU and have no idea how to trigger a signal to be sent to the server from the client to turn on an LED when the temperature sensor exceeds a certain threshold.

I based my project on the ZigbeeOnOff server/client example code and have been having no luck finding any of the actual code for functions like ZbZclOnOffClientToggleReq which the example uses to send a message from client to server that toggles an LED on the server MCU when the 1st push-button is pressed.

Here is the datasheet for the temperature sensor, and attached (mirror) is the main.c file for our client MCU.

Can anyone point me in the right direction? also, does anyone know where I can find the actual code for functions that send Zigbee messages between boards?

3 REPLIES 3

In the example, have you found where the button press is handled? Can you step in the debugger from there to see where it goes...?

The button is handled as an external interrupt in the code below. Then, I believe app_zigbee.c handles the interrupt with APP_ZIGBEE_SW1_Process() task where the client sends the server a packet that turns on the LED on the server.

void EXTI4_IRQHandler(void)
{
  HAL_GPIO_EXTI_IRQHandler(BUTTON_SW1_PIN);
}

so step into that code and follow what actually happens.