Re: Quectel EC21 with internal GSM MUX

Denis Kenzior <[email protected]> Tue, 30 Sep 2025 10:34:40 -0500
Newsgroups dev.linux.lists.ofono
Message-ID <[email protected]>
Hi Christian,

On 9/25/25 9:55 AM, Christian Meusel wrote:
> Hello,
> 
> I'm updating an embedded Linux system and reached the point where most things work but I'm still struggling with getting a Quectel EC21 back into operation.
> 
> I updated from Linux 5.12 with oFono 1.34 to Linux 6.1 with oFono 2.18. I also switched from using n_gsm as GSM MUX to oFono's internal MUX because n_gsm does not seem to receive responses from the modem when transitioning from plain AT to GSM MUX-ing on the serial line in Kernel 6.1. I can tell more of that story upon request, but I'm trying to cut the effort for debugging and fixing by using oFono's MUX for the moment.

If the kernel isn't getting responses, highly likely oFono won't either.  Did 
something change at the driver level? Have you tried git bisect?

> 
> For a Quectel M95 this is the end of the story as I can use a cellular data connection again.
> 
> But this is not the case for a Quectel EC21 in the same setup. After adding a delay for the modem to switch into GSM MUX mode, communication stalls after the first message from setup_aux [1] from plugins/quectel.c, I can see the first of the AT commands issued from this function on the wire, an OK response from the modem is received, and then communications stalls. None of the other commands appears on the wire. The other commands got queued according to further instrumentation of g_at_chat_send.
> 
>      Sep 25 14:45:48 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:ate_cb() 0x4f6400
>      Sep 25 14:45:48 target ofonod[4030]: at_chat_send_common: enqueued "AT+CMUX=0,0,5,127,10,3,30,10,2", len is 1
>      Sep 25 14:45:48 target ofonod[4030]: UART: > AT+CMUX=0,0,5,127,10,3,30,10,2\r
>      Sep 25 14:45:48 target ofonod[4030]: UART: < \r\n
>      Sep 25 14:45:48 target ofonod[4030]: UART: < OK\r\n

Not familiar with this hardware.  Is this a USB modem?  How many AT ports does 
it have?

>      Sep 25 14:45:48 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:cmux_cb() 0x4f6400
>      Sep 25 14:45:49 target ofonod[4030]: ../../../../../../workspace/sources/ofono/src/modem.c:get_modem_property() modem 0x4f6400 property Mux
>      Sep 25 14:45:49 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:cmux_activation_delay_cb() 0x4f6400
>      Sep 25 14:45:49 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:cmux_gatmux() 0x4f6400
>      Sep 25 14:45:49 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:create_chat() 0x4f6400
>      Sep 25 14:45:49 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:create_chat() 0x4f6400
>      Sep 25 14:45:49 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:identify_model() 0x4f6400
>      Sep 25 14:45:49 target ofonod[4030]: at_chat_send_common: enqueued "AT+CGMM", len is 1
>      Sep 25 14:45:49 target ofonod[4030]: Aux: > AT+CGMM\r
>      Sep 25 14:45:49 target ofonod[4030]: Aux: < \r\nEC21\r\n\r\nOK\r\n

Looks like it has multiple pre-multiplexed ports.  Why do you need multiplexing 
in this case?  I've also never seen / heard a modem support CMUX when it is 
already pre-multiplexed, but maybe such combinations do exist.

>      Sep 25 14:45:49 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:cgmm_cb() 0x4f6400 ok 1
>      Sep 25 14:45:49 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:cgmm_cb() 0x4f6400 model EC21
>      Sep 25 14:45:49 target ofonod[4030]: ../../../../../../workspace/sources/ofono/plugins/quectel.c:setup_aux() 0x4f6400
>      Sep 25 14:45:49 target ofonod[4030]: at_chat_send_common: enqueued "ATE0; &C0; +CMEE=1", len is 1
>      Sep 25 14:45:49 target ofonod[4030]: at_chat_send_common: enqueued "AT+QURCCFG="urcport","uart1"", len is 2
>      Sep 25 14:45:49 target ofonod[4030]: at_chat_send_common: enqueued "AT+CFUN?", len is 3
>      Sep 25 14:45:49 target ofonod[4030]: Aux: > ATE0; &C0; +CMEE=1\r
>      Sep 25 14:45:49 target ofonod[4030]: Aux: < \r\nOK\r\n
>      Sep 25 14:45:54 target ofonod[4030]: Aux: < \r\nNORMAL POWER DOWN\r\n
>      Sep 25 14:45:54 target ofonod[4030]: Modem: < \r\nPOWERED DOWN\r\n
>      Sep 25 14:45:54 target ofonod[4030]: Aux: < \r\nPOWERED DOWN\r\n
> 
> I'm digging into oFono's codebase for the first time. In setup_aux, I'm seeing g_at_chat_send-ing multiple requests in a row and g_at_chat_send-ing without a callback for the first time. Is this supposed to work or might this be the cause of the current "roadblock" on my way?

You can invoke g_at_chat_send however you like, even one after the other in the 
same function.  The underlying implementation still uses a command queue, so 
commands will be sent only when the modem channel is idle, or after receiving a 
final response from the modem (ERROR, OK, etc)

Regards,
-Denis