Connect Quectel module with quectel-CM

Build Quectel’s QConnectManager and use quectel-CM to connect an EC25 or EG25-G module in QMI mode; it sets the IP address, DNS and routes of the interface.

QConnectManager is Quectel’s connection manager for Linux; its program, quectel-CM, starts the data connection of the module and configures the IP address, DNS and routing of the interface. The commands are shown with the EG25-G.

Requirements

Finish the quickstart of the board first: Get started with Base HAT or Get started with 4G/LTE Cellular Modem Kit.

Required

Hardware

  • Base HAT or 4G/LTE Cellular Modem Kit with a Quectel moduleAssembled as in the quickstart of the Base HAT or the 4G/LTE kit, with the USB cable connected. For example an EC25 or EG25-G.

SIM

  • SIM card with data serviceIts APN: super for the Sixfab SIM. For another SIM, ask its provider.

Software

  • Linux with kernel 3.4 or laterFor example Raspberry Pi OS, Debian or Ubuntu.
  • Serial terminalTo send AT commands: see Send AT commands.

Stop ModemManager

  1. Stop and disable ModemManager

    On Raspberry Pi OS Bookworm and later, ModemManager is installed by default and can take over the module. Stop and disable it, or remove it with sudo apt purge modemmanager -y:

    sudo systemctl stop ModemManager.service
    sudo systemctl disable ModemManager.service

Install tools

  1. Install build tools and udhcpc

    sudo apt update
    sudo apt install -y build-essential wget unzip udhcpc

    quectel-CM uses udhcpc and its default.script to set the IP address, DNS servers and routes of the interface.

Set module to QMI mode

QMI mode is the factory setting of the EC25 and EG25-G. These commands apply to Quectel USB modules with the AT+QCFG="usbnet" setting; other module families can differ, see the QConnectManager Linux User Guide.

  1. Check setting

    AT+QCFG="usbnet"

    QMI mode answers +QCFG: "usbnet",0. With another value, continue.

  2. Set QMI mode and restart module

    AT+QCFG="usbnet",0
    AT+CFUN=1,1
  3. Check QMI control device

    After 10 to 15 seconds:

    ls /dev/cdc-wdm*

    The answer lists a device, for example /dev/cdc-wdm0.

Download and build QConnectManager

  1. Download and build quectel-CM

    cd ~
    wget https://sixfab.com/wp-content/uploads/2023/09/Quectel_QConnectManager_Linux_V1.6.5.zip
    unzip -q Quectel_QConnectManager_Linux_V1.6.5.zip
    mv Quectel_QConnectManager_Linux_V1.6.5 quectel-cm
    cd quectel-cm
    make

    make builds the quectel-CM program in the same directory.

Connect

  1. Start quectel-CM with APN

    Start quectel-CM with the APN of your SIM, here super for the Sixfab SIM:

    sudo ./quectel-CM -s super &

    -s takes the APN, then a username, a password and the authentication type (0 none, 1 PAP, 2 CHAP) if the operator uses them. The connection lasts as long as quectel-CM runs.

Verify

  1. Check interface address

    After a few seconds, wwan0 has an IP address:

    ip a show wwan0
    Result: wwan0 has an IP address.
  2. Ping through cellular interface

    Ping an address and a name through the interface; replies to the second also show that DNS works:

    ping -I wwan0 -c 3 8.8.8.8
    ping -I wwan0 -c 3 sixfab.com
    Result: replies to both; the replies to sixfab.com also show that DNS works.

Details

Stop connection

sudo killall quectel-CM

Troubleshooting

Check the USB cable and that the module is powered, the QMI mode (AT+QCFG="usbnet"), and that lsusb -t shows the qmi_wwan driver for the module.

Check that udhcpc is installed: quectel-CM uses it to configure the interface.

Check the SIM (AT+CPIN?), the registration (AT+CREG?) and the APN.

Power, SIM, antenna and USB checks are in the Base HAT troubleshooting; questions about QConnectManager in the Quectel forum.

Next steps