-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
M5 ESP32 (all clusters app) : no resource for Read interaction when attempting to read from iOS chip tool app #14899
Comments
The default setup is that we can support up to 4 reads at once. See CHIP_IM_MAX_NUM_READ_HANDLER. Now why you're ending up in a state where there are apparently that many in flight at once... I do see quite a number of reads in the log. Depending on what's being read we could just have a bunch of them not completed, or there could be another deeper issue here. Enabling more verbose logging on the server so we could see what requests it's actually getting, and on the client so we can see what responses it got back, might be helpful... |
@bzbarsky-apple I assume we need some feedback, or queue here to handle a limit? (That said, when we hook this up to cached reads, that likely will help... short of not handling a large number in flight). |
The server is sending a RESOURCE_EXHAUSTED response, I would assume, but we don't usefully map that to a non-generic error in the Darwin framework right now. That said, in this case it's really not clear to me why we end up in the bad state... Need more detailed logs. |
will need to find a way to enable more verbose logging on ESP32 |
Need to compile so that ESP_LOGI and ESP_LOGV are not no-ops. Or just change |
@bzbarsky-apple I used the quick hack you mentioned.. Tested with SHA: cfab82d |
I also see a very similar situation with my M5Stack when toggling the OnOff state via the M5stack display so decided to investigate more. Our controller is reading an attribute on the Basic Cluster periodically and that works fine until I toggle the state of the OnOff attribute using the buttons on the M5 stack itself (Device->Light Bulb->Endpoint: 1->Cluster: OnOff -> Attribute: OnOff -> Toggle). After that, all subsequent reads fail because it seems like something is borked in src/app/reporting/Engine.cpp. I'll provide my logs below, including some custom ones I threw in there. It looks like after the Switch state is toggled, mRunScheduled is never set back to false and all subsequent read requests fail here. Reads will continue to "silently" fail this way until the CHIP_IM_MAX_NUM_READ_HANDLER limit of 4 reads is hit and then we'll start seeing the "No resources for Read interaction" log message start appearing. I don't know this code very well so I could be off but that's certainly what appears to be happening. Logs from doing this:
|
It looks like they did not quite succeed at attaching? @z-michel Trying your situation now. |
@bzbarsky-apple FYI, I should have also mentioned that our Controller's SDK (and therefore the corresponding M5 stack's SDK) is based off SHA from about a week ago: 4267a9b |
in the past 2 days this seems to be working better..not sure what fixed it |
@kean-apple Boris added the fix #15066 (merged) for the issue he mentioned above. Probably that fixed it? Closing this for now. Feel free to re-open in case you see it again |
Agreed. Not seeing this issue anymore |
Looking at the original steps here, it does look like we could have ended up in the racy state, mis-set the boolean, then never completed any of our reads until we ran out of ReadHandlers.... So yes, fixing the race could have fixed this. |
Problem
Hitting no resource for Read interaction errors when attempting to read Temp sensor on ESP32 M5 board using iOS chip tool app. This causes the iOS chip tool app to not display a value.
SHA: 2f785f4
Step to reproduce:
In step 4, I'm seeing this 50% of times I see follow errors and app doesn't reflect new value
I (100566) chip[EM]: Received message of type 0x10 with protocolId (0, 0) and MessageCounter:5070081 on exchange 46738r
I (102716) chip[EM]: Received message of type 0x2 with protocolId (0, 1) and MessageCounter:5070082 on exchange 46739r
I (102726) chip[IM]: no resource for Read interaction
I (102736) chip[IN]: Prepared secure message 0x3ffca0a4 to 0xFEBB776F12FC11DA (1) of type 0x1 and protocolId (0, 1) on exchange 46739r with MessageCounter:4339786.
I (102746) chip[IN]: Sending encrypted msg 0x3ffca0a4 with MessageCounter:4339786 to 0xFEBB776F12FC11DA (1) at monotonic time: 101973 msec
I (102816) chip[EM]: Received message of type 0x10 with protocolId (0, 0) and MessageCounter:5070083 on exchange 46739r
To recover, I need to reset the accessory and pair again
The text was updated successfully, but these errors were encountered: