esp-modem: esp_modem_set_urc buffer issues? seeing same URCs multiple times (IDFGH-14179) #706
Open
3 tasks done
Labels
Status: Opened
Issue is new
Answers checklist.
General issue report
I decided to test using the new urc callback feature but running in to some strange issues.
The esp_modem_set_urc(dce, urc_handler); is returning the same lines (or chunks of data) several times, from how I understand it. I've tried just printing whatever is returned without any kind of processing and the duplicate messages keeps coming. I'm not the most experienced with c programming so I might have misunderstood something here..
But in essence it's like every read seems to include previous data still in the buffer.
I verified that the modem isn't doing some funny stuff using an a different app on the esp32 which just let me to raw read/writes directly to the uart, and no problems there.
I've attached the code if it is of any help.
Here's a log while trying to debug what's going on:
the function i'm using:
I could do a lot more processing inside the urc_handler to work around this. But I thought it would be best to do the bare minimum here as to not cause any blocking in the uart. Just pass along urcs for handling in another task. Maybe this is the wrong approach?
It also seems that any at command processing by esp-modem will reset the urc buffer normally when looking at the logs. But when I signal to it that it's been processed it doesn't get consumed.
main.zip
The text was updated successfully, but these errors were encountered: