Skip to main content
TMelz.1
Associate
Mar 3, 2022 6:55 PM UTC
Question

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

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?

This topic has been closed for replies.

3 replies

Andrew Neil
Super User
Mar 3, 2022 7:12 PM UTC

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...?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
TMelz.1
TMelz.1Author
Associate
Mar 4, 2022 3:45 AM UTC

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);
}

Andrew Neil
Super User
Mar 4, 2022 9:46 AM UTC

so step into that code and follow what actually happens.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.