-
Notifications
You must be signed in to change notification settings - Fork 135
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
Implement URC Handling. (IDFGH-8812) #180
Comments
This could be implemented the same way as #156, i.e. installing a permanent callback which would check for a global set of URC first and only after that for replies to requests. So we could still create a DCE class that's command-able (=could add commands) and at the same time handles the URCs. I'll prepare a simple demo. |
Thanks so much.
Meisterschulen am Ostbahnhof
Mühldorfstr. 6
81671 München
Tel.: 089 416002 - 0
Fax: 089 416002 - 111
Internet: www.meisterschulen-münchen.de<http://www.meisterschulen-mchn.de>
|
any Progress @david-cermak ? |
Added as c61fe1f it's very simple and WIP. It only adds a user callback that could handle all received data. (needs to be removed before switching modes and applied again after) The other option is to reuse |
i will test it. a SIMCOM A7672E-FASE we can send here a AT+CGNSSPWR=1 command, will test now... |
Hi, Question: (from Vasil Nikolov) I understand the URC implementation following way:
|
@david-cermak could you please provide some feedback about the last questions from Franz? Thank you! |
Hi Franz and Vasil, sorry for not responding earlier.
This way, we're able to
we process the user callback first esp-protocols/components/esp_modem/examples/modem_console/main/my_module_dce.cpp Lines 73 to 75 in c61fe1f
...and then let the command library to parse the same data. esp-protocols/components/esp_modem/examples/modem_console/main/my_module_dce.cpp Lines 76 to 87 in c61fe1f
You need to be aware that the urc handler would still received all the replies, including the ones that belong to unrelated commands issued by the command library (by user)
Yes, the urc-handler gets always called (if enabled). The other part (lib-command processing) is called only if an AT command is in progress.
This works like a fork ( The only trouble might be the time, physically spent on processing the urc responses, since it actually delays processing the simultaneously active AT command. This wouldn't delay data reception, but might influence timeouts of the defined commands. |
Hello David,
thank you for the detailed explanation, what you really describe is a very good approach for the URC and it really makes sure that the command handling will not be broken.
As last takeout from your notes – we need to make sure that the URC handler is a very short and thus we will not impact the timeout handling of the AT commands.
Thank you again for the support!
Best Regards,
Vasil Nikolov
CEO and CO-Founder
Email: ***@***.******@***.***>
Phone: +359 888 200510
Banat 1
1407 Sofia
Bulgaria
***@***.***
www.rilabs.io<http://www.rilabs.io/>
From: david-cermak ***@***.***>
Sent: Thursday, March 2, 2023 6:14 PM
To: espressif/esp-protocols ***@***.***>
Cc: Vasil Nikolov ***@***.***>; Comment ***@***.***>
Subject: Re: [espressif/esp-protocols] Implement URC Handling. (IDFGH-8812) (Issue #180)
Hi Franz and Vasil,
sorry for not responding earlier.
The example of injecting a URC callback doesn't really change anything in the esp_modem layers, it just overrides the default command implementation using these two methods:
1. Traditional method for sending commands makes the class command-able, so it could be employed by the command library to run all/defined AT commands:
https://github.com/espressif/esp-protocols/blob/c61fe1f5f915b2d39dda81ea8ce701660991194c/components/esp_modem/examples/modem_console/main/my_module_dce.cpp#L51
1. The data callback that processes the replies
https://github.com/espressif/esp-protocols/blob/c61fe1f5f915b2d39dda81ea8ce701660991194c/components/esp_modem/examples/modem_console/main/my_module_dce.cpp#L70
This way, we're able to
* first call the user urc-callback (and after that)
* continue with processing the replies by the command library
…________________________________
a. For me it is important to understand how modem implementation differentiates between URCs and a normal response to AT commands
we process the user callback first
https://github.com/espressif/esp-protocols/blob/c61fe1f5f915b2d39dda81ea8ce701660991194c/components/esp_modem/examples/modem_console/main/my_module_dce.cpp#L73-L75
...and then let the command library to parse the same data.
https://github.com/espressif/esp-protocols/blob/c61fe1f5f915b2d39dda81ea8ce701660991194c/components/esp_modem/examples/modem_console/main/my_module_dce.cpp#L76-L87
i. There are commands which require longer time until a response is received.
You need to be aware that the urc handler would still received all the replies, including the ones that belong to unrelated commands issued by the command library (by user)
b. Can we receive URCs while we are waiting for a response to a certain AT Command?
Yes, the urc-handler gets always called (if enabled). The other part (lib-command processing) is called only if an AT command is in progress.
i. If yes then how can we be sure that responses to the AT Commands are forwarded to the URC handler instead to the command handler
This works like a fork (tee command in bash :-), we pass the same data to two handlers
The only trouble might be the time, physically spent on processing the urc responses, since it actually delays processing the simultaneously active AT command. This wouldn't delay data reception, but might influence timeouts of the defined commands.
(for example, if we're sending AT+CGC\r with timeout of 500ms and spend 600ms on urc processing, then it would fail, but should still work if we spend like 450ms on urc-processing, as the actual reply would simply queue so the data handler should make it in time)
—
Reply to this email directly, view it on GitHub<#180 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AISW2OROTO7EKPSAGUUAFNTW2DBNXANCNFSM6AAAAAASKKZCCY>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
https://gist.github.com/franz-ms-muc/b28a70d42a86bb2ed292e638a11fa152 i test the URC HAndler now in the CMUX Sample. but then never called. However, as i have extended Logging active, i see the URCs are coming in. however when i was testing it with the Console Sample it was working. think there is something to fix still. |
another Log with Net: |
@david-cermak did you look into this ? |
@franz-ms-muc Could you please also share the code where you install the handler? |
Ah, thanks,
i will look into the new master.
Cool.
Von: david-cermak ***@***.***>
Gesendet: Dienstag, 21. März 2023 17:57
An: espressif/esp-protocols ***@***.***>
Cc: Franz Höpfinger ***@***.***>; Mention ***@***.***>
Betreff: Re: [espressif/esp-protocols] Implement URC Handling. (IDFGH-8812) (Issue #180)
@franz-ms-muc<https://github.com/franz-ms-muc> Could you please also share the code where you install the handler?
Note that the change has already been merged to master (and release as modem-v1.0.0<https://github.com/espressif/esp-protocols/releases/tag/modem-v1.0.0>), so you should be able to play with URC directly in the console example. Does it work for you in the default example<https://github.com/espressif/esp-protocols/tree/master/components/esp_modem/examples/modem_console>?
—
Reply to this email directly, view it on GitHub<#180 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AQSZUH2UNRFN3WNLQAD346DW5HMUHANCNFSM6AAAAAASKKZCCY>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
[https://www.meisterschulen-mchn.de/images/meisterschulen/allgemein/4-logos/logofc.jpg]
Meisterschulen am Ostbahnhof
Mühldorfstr. 6
81671 München
Tel.: 089 416002 - 0
Fax: 089 416002 - 111
Internet: www.meisterschulen-münchen.de<http://www.meisterschulen-mchn.de>
|
Could you please close this issue if it work for you? Or comment and share the details if URC handling doesn't work as expected. |
hi, i tested like this: use this Commit: and the Outcome is this Log: +CGNSSPWR: READY! is a URC. |
making another Try: https://gist.github.com/diplfranzhoepfinger/6a3062d8861535f2b3927cdc6e5d299f there the URC Handler works. it seems the URC HAndler only works on "cmd xx" pls look into this. |
@david-cermak can you have a look into this ? Thanks! |
so, Test also URC Handling with latest Sample: |
with the A7672 it does not work: |
so we have: URC Handler working: URC Handler not working: |
and YEAH !!!! the URC Handler runs on the A7672 log here: https://gist.github.com/diplfranzhoepfinger/2d663b68e47f5cbf7a11a980548166ee i think it is a cool Feature ! now must implement the 2nd Layer above the URC Handler, a "URC Handler Parser" |
@timbo100 you can see my Cmux - Example, there i got it working. |
@diplfranzhoepfinger and team, thanks. while connected to a SIM7600 modem, I changed modem type to SHINY and it worked... I got connected, IP address, and tested the comm with mqtt broker. I really want to test sending an SMS Text message, does anyone know how to use the console to do this since that command is rather complicated??? It's unclear to me, other than new functionality added to custom modem, what the difference is between a SIM7600 vs SHINY. It would seem then that the Generic Modem is very close to SIM7600(?). Very much appreciated. |
Switch modem from SIM76000 to SHINY - how? |
While this is supported in the example by creating a custom module, it's not very user friendly. |
this was working well with the CMUX Example. I mean one Problem is it is C, so the Syntax will be different. Thanks, |
Hi Franz, If you want to use the idea in the modem example, you'd have to stay with C++. (as mentioned above, I'd like to add URC handler support to the library itself, so those overrides and customized factories won't be needed, planned for |
does this mean: |
Yes, it means that the URC will be an official API. The solution I offered before was just a workaround, and since the C++ implementation is very modular, we were able to simply inject a handler without changing the library code (100% user space) |
Hello,
Could you please check which URC solution was proposed by ESP?
Best Regards,
Vasil Nikolov
CEO and CO-Founder
Email: ***@***.******@***.***>
Phone: +359 888 200510
Banat 1
1407 Sofia
Bulgaria
***@***.***
www.rilabs.io<http://www.rilabs.io/>
From: david-cermak ***@***.***>
Sent: Tuesday, September 17, 2024 10:55 AM
To: espressif/esp-protocols ***@***.***>
Cc: Vasil Nikolov ***@***.***>; Comment ***@***.***>
Subject: Re: [espressif/esp-protocols] Implement URC Handling. (IDFGH-8812) (Issue #180)
Closed #180<#180> as completed via #620<#620>.
—
Reply to this email directly, view it on GitHub<#180 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AISW2ORFBS7OKYY5IXEUQSTZW7N35AVCNFSM6AAAAAASKKZCC2VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJUGI4DMMRXGIYDOMQ>.
You are receiving this because you commented.Message ID: ***@***.******@***.***>>
|
1.2.0 Features - Add support for guessing mode (52598e5) - Delete CMUX internal implementation even if terminal exit fails (0e0cbd6) - Add support for handling URC (1b6a3b3, espressif#180) - add ability to change ESP_MODEM_C_API_STR_MAX from Kconfig (1790989) - Added target test config with CHAP authentication (f8ae7de) - example add esp32p4 usb support (adafeae) - Publish mbedtls component (0140455) - host test support of the latest ESP-IDF release (3f74b4e) Bug Fixes - Fix console example to use urc/detect features (1a9eaf3) - Update target test builds to use external Catch2 (554f022) - Fix arguments names when spawn esp_modem_xxx declarations (b6792c5) - Remove catch dependency (c348076) - Examples: use local configs for MQTT topic/data (f5c13b9) - Fixed clang-tidy warnings (70fa3af) - Fix CI build per IDFv5.3 (d0c17ef) - Fixed UART task to check for buffered data periodically (4bdd90c, espressif#536) - Cleanup unused configs from PPPoS example (08a62cc) - Update CMUX example with SIM7070_gnss cleaned-up (56fe532) - Update console example with SIM7070_gnss format comments (5baaf54) - Fix remaining print format warnings (3b80181) Updated - docs(modem): Fix esp_modem_at_raw() description (C-API) (492a6a0) - ci(common): updated github actions(checkout, upload, download) v3 to 4, Ubuntu 20.04 to v22.04 (a23a002)
Hello @david-cermak Thanks, |
also next, we need to implement a URC Parser. Thanks, |
I did forget, sorry. Reopening -- will create v1.2.1 this week. |
@diplfranzhoepfinger Franz, since you're a regular user and also a contributor to |
1.2.1 Bug Fixes - Use higher GPIO range to support new chips (428fdbb, espressif#558) - Remove tests and support for IDFv4.4, added IDFv5.4 (433a033) - Fix typo GENETIC -> GENERIC in mode types (090b1ff, espressif#667) - Add support for URC handler into C-API (295d99d, espressif#180)
This is an epic addition to the C API and is going to drastically simplify several systems I'm maintaining. Thank you @david-cermak ! 🙏 🎉 |
also discussed in:
#156
#168
#179
The text was updated successfully, but these errors were encountered: