2024-11-13 12:05 PM - edited 2024-11-13 12:05 PM
Hi,
i want to send sensor values from my STM to my Homeassistant via zigbee.
Therefore I have configured a temperature sensor cluster at one endpoint and because my device should also control LEDs, I have an onoff cluster.
I have tried to send my sensordata with
ZbZclAttrIntegerWrite(zigbee_app_info.temperature_meas_server_2, ZCL_WC_MEAS_ATTR_MEAS_VAL, 12);
As a start, i places this line into the "onOff_server_1_on" function, so that I could see, when I send an on command from my Homeassistant, the temperature gets send, which also works fine.
However, I tried calling the function with an external set routine cyclic (every 10s) from my ISR, which did not work and caused my processor to crash. Can anybody see a reason for that? I also attachted my app_zigbee.c here.
Thanks
Solved! Go to Solution.
2024-11-15 05:57 AM
Hi @vh789,
Can you please try to make a higher level of your Timer ISR ? From your ioc file, the timer is configured the highest priority ( level 0) which may have a conflict with the sequencer and IPCC management explaining that the ack is not received.
If this does not resolve the issue, please share the hole project to analyze.
Kind regards,
Ouadi
2024-11-14 01:05 AM
Hi @vh789,
Please find the answer to your problem following this post.
Solved: Re: STM32WB55 - First data sent but no one after c... - STMicroelectronics Community
Regards,
Ouadi
2024-11-14 08:47 AM
Hi Ouadi,
thanks for your reply. I have read the post that you linked and also tried to implement my write/set function as described there. However, this did not change the behaviour: as soon as the function is called, the Controller crashes / the program does not cunctinue.
As I understood from your linked post, the problen there was, that
ZbZclAttrIntegerWrite
only writes to an internal storage which has to be read out by the client over the air afterwards (e.g. with reporting).
This works for me already. As a test, i call the ZbZclAtrrIntegerWrite for temperature cluster (endpoint 22), when an "on" command on my OnOff cluster (endpoint 21) is received. This works fine, and my client can read out the themperature value that i set.
However, when I call the suggested function by you (see below) from my isr, the controller stops running.
void APP_ZIGBEE_WriteTempAttribute(float temp_val)
{
enum ZclStatusCodeT status;
float temp = temp_val*100;
int16_t temp_val_attr;
/* Write attribute */
temp_val_attr = (int16_t) temp ;
status = ZbZclAttrIntegerWrite(zigbee_app_info.temp_meas_server, ZCL_TEMP_MEAS_ATTR_MEAS_VAL, (int16_t)temp_val_attr);
}/*APP
2024-11-15 03:34 AM
Hi @vh789,
What do you mean by the controller stops running ? do you fail into a Hard fault ? please give more debug inputs?
I think that the issue may be linked to your ISR implementation.
Best regards,
Ouadi
2024-11-15 05:20 AM
Hi Oadi,
indeed I assumed that i was running into a hard fault, since the isr did not run anymore (shown by LED indicator and UART messages) and the device was not responding anymore via Zigbee.
However, the debugger shows that the controller stays here, after the isr calls the ..AttrWrite..
I cannot understand a lot from the call stack, however I can also share more of the project if you need. I attached my .ioc, to see my interrupt setup.
2024-11-15 05:57 AM
Hi @vh789,
Can you please try to make a higher level of your Timer ISR ? From your ioc file, the timer is configured the highest priority ( level 0) which may have a conflict with the sequencer and IPCC management explaining that the ack is not received.
If this does not resolve the issue, please share the hole project to analyze.
Kind regards,
Ouadi
2024-11-15 06:42 AM
Hi Oadi,
Thank you for that hint, setted the isr to lowest Prio and that did it!