You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes, the examples use polling - so they're might not be that power efficient.
We'll look into introducing event callbacks to the library so you can block your user task and wait for Matter events to happen - it's a good idea.
I just realized what you need here is to replace the busy-looping with a simple delay() - that'll block the user task for the provided amount of time allowing the device to enter a low-power mode and also run the radio stack if necessary. We'll also introduce support for ArduinoLowPower to allow more control.
What I was thinking about is the ability to register a callback for your devices which is called when some property changes. This would allow you to block your user task and go low power until something changes - then only react to it once without constantly polling for changes. This will be very useful, so it'll be definitely coming.
Actually, a delay() fits perfectly if there is only one single task.
As the weather sensor can raise an interrupt, I am considering using events. This is what I did for the Low Power Home Network Weather Monitoring project based on sub-1GHz and TI-RTOS: idle mode required as little as 0.0267 mW.
Summary
In many examples, delay before two consecutive data acquisition is performed by polling.
arduino/libraries/Matter/examples/matter_sensor_multiple/matter_sensor_multiple.ino
Lines 61 to 67 in 65a739a
This might not be especially low-power.
How to use instead an event raised by a timer? As SiLabs core for Arduino seems to rely on FreeRTOS, the RTOS elements should be already available.
Thank you!
The text was updated successfully, but these errors were encountered: