Quectel EC2X TCP/IP AT commands support


I’m trying to use EC2X modem with TCP/IP AT commands. This means, using tcpip stack that is on the modem. I ran into an issue, where when board is trying to connect to the internet. At some point there is a check for a valid stack. And this always fails, because stack is not set anywhere. After some digging I realized that all other modules have some interface that gets the stack from the modem, only EC2X has nothing.

I found no help in the documentation, so I’m hoping somebody here had a similar issue in the past. Thanks!

Can you point me to the check that’s failing exactly?

btw, I believe that Mbed OS only supports Quectel EC2X out of the box on Multitech Dragonfly. They have some extra code that makes it work on their board: mbed-os/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L496xG/TARGET_MTS_DRAGONFLY_L496VG/ONBOARD_QUECTEL_EG25.cpp at master · ARMmbed/mbed-os · GitHub

Hey thanks for reply.

So the code failed in AT_CellularContext.cpp:523

 } else if (!(_nonip_req && _cp_in_use) && !get_stack()) {
NetworkStack *AT_CellularContext::get_stack()
    // use lwIP/PPP if modem does not have IP stack
    if (!_stack) {
        _stack = nsapi_ppp_get_stack();
    return _stack;

This get_stack function returned 0, if PPP was disabled (when ppp disabled, AT commands should be active). After little search, I discovered that inside other QUECTEL modems there are files with functions that will setup this stack, only EC2X does not have them.

Ah yeah, you’re right, looks like this driver is only set up to be used in PPP mode, not AT mode. That’s reinforced by the original PR. I think that AT mode would have to be implemented using the other drivers as a template if you need it.

I already ported the files from BG96. It seems to work “fine” with exception that I cannot send data to the sockets - modem returns ERROR. Is it possible that communication “protocol” differs between the models?

Thank you!

Yes, I suspect that it may. However, I’m not too knowledgeable about cellular modems so I’m afraid that’s the most I can say. My advice would be to check the datasheets for both parts for differences, and also to start logging the AT commands for your modem to see where it’s going wrong.

If you do get it working, please do submit your driver as a contribution to GitHub - mbed-ce/mbed-os: Arm Mbed OS is a platform operating system designed for the internet of things !

Yeah, this sounds like the way to go.
Thank you for the help!