I have an application that requires invoking multiple commands to the same node in quick succession (multiple times a second).
To evaluate the feasibility of this, I flashed the Matter lightswitch sample on my NRF5340DK+NRF7002EK for a Matter over Wifi setup.
The commands work fine to turn the lightbulb on/off if I press button 2 normally, but if I spam button 2 quickly, after a while, it stops working for a long time, with CHIP_ERROR_NO_MEMORY errors
I: Notify Bounded Cluster | endpoint: 1 cluster: 6 I: 2366227 [DIS]Found an existing secure session to [1:00000000F2DB3567]! D: 2366234 [DIS]OperationalSessionSetup[1:00000000F2DB3567]: State change 1 --> 5 E: Invoke OnOff Command Request ERROR: Error CHIP:0x0000000B I: Button has been pressed, keep in this state for at least 500 ms to change light sensitivity of binded lighting devices. I: 2366427 [IN](S) Sending msg 201809704 on secure session with LSID: 33345 I: Notify Bounded Cluster | endpoint: 1 cluster: 6 I: 2366480 [DIS]Found an existing secure session to [1:00000000F2DB3567]! D: 2366487 [DIS]OperationalSessionSetup[1:00000000F2DB3567]: State change 1 --> 5 E: Invoke OnOff Command Request ERROR: Error CHIP:0x0000000B I: 2366500 [IN](S) Sending msg 201809699 on secure session with LSID: 33345 I: 2366525 [IN](S) Sending msg 201809702 on secure session with LSID: 33345 I: Button has been pressed, keep in this state for at least 500 ms to change light sensitivity of binded lighting devices. I: 2366692 [IN](S) Sending msg 201809705 on secure session with LSID: 33345 I: 2366710 [IN](S) Sending msg 201809700 on secure session with LSID: 33345
Then it fixes itself at a later point (after the session is marked as defunct, but that could be a red herring).
I: 2489896 [SC]SecureSession[0x20004768]: Moving from state 'kActive' --> 'kDefunct' I: 2489904 [DMG]Time out! failed to receive invoke command response from Exchange: 48681i E: Binding command was not applied! Reason: 32 I: Button has been pressed, keep in this state for at least 500 ms to change light sensitivity of binded lighting devices. I: Notify Bounded Cluster | endpoint: 1 cluster: 6 D: 2823110 [DIS]OperationalSessionSetup[1:00000000F2DB3567]: State change 1 --> 2 D: 2823119 [DIS]OperationalSessionSetup[1:17FAB8AF6174CC68]: State change 1 --> 2 I: 2823318 [DIS]Checking node lookup status after 200 ms I: 2823323 [DIS]Checking node lookup status after 196 ms I: 2823328 [DIS]Keeping DNSSD lookup active I: 2824273 [DIS]UDP:[......................]:5540: new best score: 3 D: 2824280 [DIS]Lookup clearing interface for non LL address I: 2824285 [DIS]UDP:[......................%wlan0]:5540: new best score: 7 I: 2824293 [DIS]Checking node lookup status after 1175 ms D: 2824298 [DIS]OperationalSessionSetup[1:00000000F2DB3567]: Updating device address to UDP:[......................]:5540 while in state 2 D: 2824312 [DIS]OperationalSessionSetup[1:00000000F2DB3567]: State change 2 --> 3 D: 2824320 [IN]SecureSession[0x20004820]: Allocated Type:2 LSID:33347 I: 2824326 [SC]Initiating session on local FabricIndex 1 from 0x7F0783EE8D41E3BA -> 0x00000000F2DB3567 I: 2824465 [EM]<<< [E:48682i S:0 M:156688477] (U) Msg TX to 0:0000000000000000 [0000] --- Type 0000:30 (SecureChannel:CASE_Sigma1) I: 2824478 [IN](U) Sending msg 156688477 to IP address 'UDP:[......................]:5540' I: 2824489 [SC]Sent Sigma1 msg D: 2824493 [DIS]OperationalSessionSetup[1:00000000F2DB3567]: State change 3 --> 4
Any thoughts on how to address this issue? I would like to know what specifically is running out of memory from attempting multiple invoke commands in quick succession. What are the limits?