Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to post event to CHIP Platform event queue (CON-404) #313

Closed
jonsmirl opened this issue Apr 6, 2023 · 9 comments
Closed

Failed to post event to CHIP Platform event queue (CON-404) #313

jonsmirl opened this issue Apr 6, 2023 · 9 comments

Comments

@jonsmirl
Copy link
Contributor

jonsmirl commented Apr 6, 2023

I keep getting these errors, is there some way to make this queue longer?

E (92049) chip[DL]: Failed to post event to CHIP Platform event queue
E (92049) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
I (92049) esp_matter_attribute: ********** Endpoint 0x0003's Cluster 0x001E's Attribute 0xFFFD is 1 **********
E (92049) chip[DMG]: Error retrieving data from clusterId: 0x0000_001E, err = b
E (92059) chip[DL]: Failed to post event to CHIP Platform event queue
E (92059) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
E (92069) chip[DL]: Failed to post event to CHIP Platform event queue
E (92069) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
I (92069) chip[EM]: <<< [E:36347r S:43590 M:117479787 (Ack:121440306)] (S) Msg TX 
@github-actions github-actions bot changed the title Failed to post event to CHIP Platform event queue Failed to post event to CHIP Platform event queue (CON-404) Apr 6, 2023
@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 6, 2023

So does CONFIG_MAX_EVENT_QUEUE_SIZE end up in CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE?

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 6, 2023

Setting CONFIG_MAX_EVENT_QUEUE_SIZE to 50 instead of 25 seems to have made it go away. I also noticed that my commissioning was significantly faster. I guess it was dropping items from that queue and then having to trigger slow network retries
fabric.log

@shubhamdp
Copy link
Contributor

So does CONFIG_MAX_EVENT_QUEUE_SIZE end up in CHIP_DEVICE_CONFIG_MAX_EVENT_QUEUE_SIZE?

Yes, https://github.com/project-chip/connectedhomeip/blob/master/src/platform/ESP32/CHIPDevicePlatformConfig.h#L39

Increasing it to 50 would have increased the static DRAM usage by (25 * sizeof(ChipDeviceEvent))

@jonsmirl
Copy link
Contributor Author

jonsmirl commented Apr 7, 2023

I have 2MB of free PSRAM. Can we push it into PSRAM?

@shubhamdp
Copy link
Contributor

Right now I don't see any direct option for this. But, we can do a workaround.

Set CONFIG_MAX_EVENT_QUEUE_SIZE to higher value (say 50 as per your suggestion).

Set CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL to some value (eg: 1K), please make sure to set it to less than 50 * sizeof(ChipDeviceEvent) bytes.

By this method, all the allocations more than configured value will be from PSRAM.

@stefano055415
Copy link

stefano055415 commented May 2, 2023

@jonsmirl @shubhamdp

I too encounter the same problem

even on the light example

Has anyone solved it?

E (45129) chip[DL]: Failed to post event to CHIP Platform event queue
E (45129) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
E (45139) chip[DL]: Failed to post event to CHIP Platform event queue
E (45139) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
E (45299) chip[DL]: Failed to post event to CHIP Platform event queue
E (45299) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
E (45309) chip[DL]: Failed to post event to CHIP Platform event queue
E (45309) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
E (45319) chip[DL]: Failed to post event to CHIP Platform event queue
E (45319) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
E (45339) chip[DL]: Failed to post event to CHIP Platform event queue
E (45339) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
E (45349) chip[DL]: Failed to post event to CHIP Platform event queue
E (45349) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
E (45369) chip[DL]: Failed to post event to CHIP Platform event queue
E (45369) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000
E (45379) chip[DL]: Failed to post event to CHIP Platform event queue
E (45379) chip[CSL]: Failed to queue CHIP System Layer lambda event: 1000000

@jonsmirl
Copy link
Contributor Author

jonsmirl commented May 2, 2023

Set CONFIG_MAX_EVENT_QUEUE_SIZE higher. I ended up at 32 instead of 50. So it just needed a little more,

Something inside of chip probably should be blocking when the queue is full and then work to empty it before generating more entries.

@stefano055415
Copy link

@jonsmirl

Thanks, I tried and it actually works, I hope they fix it

@jonsmirl
Copy link
Contributor Author

More recent version of this issue: #656

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants