In ECM (Ethernet Control Model) mode, the cellular module appears to Linux as a USB Ethernet interface, handled by the kernel’s cdc_ether driver; no extra software is needed.
Requirements
Finish the quickstart of the board first: Get started with Base HAT, Get started with 4G/LTE Cellular Modem Kit or Get started with Jetson Nano Cellular Modem Kit.
Hardware
- Base HAT, 4G/LTE Cellular Modem Kit or Jetson Nano Cellular Modem KitAssembled as in the quickstart of the Base HAT, the 4G/LTE kit or the Jetson Nano kit, with the USB cable connected.
- A module that supports ECMTested: Quectel EC25-A, EC25-E, EC25-AU and EG25-G; Telit LE910C1, LE910C4 (NF, EU, AP) and ME910C1-WW. The EC25-AF does not support ECM; other variants are not tested.
SIM
- SIM card with data serviceIts APN:
superfor the Sixfab SIM and the KORE Super SIM (formerly Twilio Super SIM).
Software
- Serial terminalTo send AT commands: see Send AT commands.
Stop ModemManager
On Raspberry Pi OS Bookworm and later, ModemManager is installed by default and can take over the module’s ports. Without ModemManager, skip this stage.
-
Stop and disable ModemManager
sudo systemctl stop ModemManager.service sudo systemctl disable ModemManager.serviceTo remove it instead, see Remove ModemManager.
Configure module
-
Check that Linux detects module
lsusbThe list shows the module, for example
ID 2c7c:0125 Quectel Wireless Solutions Co., Ltd. EC25 LTE modem. In the default QMI mode,lsusb -tshows theqmi_wwandriver on interface 4:$ lsusb -t |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 3, If 1, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 3, If 2, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 3, If 3, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 3, If 4, Class=Vendor Specific Class, Driver=qmi_wwan, 480M -
Open AT command port
Open the module’s AT port (
/dev/ttyUSB2) at 115200 baud, as in Send AT commands, and sendAT. The answer isOK. -
Set APN
AT+CGDCONT=1,"IPV4V6","super"Replace
superwith the APN of your SIM.superis the APN of the Sixfab SIM and of the KORE Super SIM (formerly Twilio Super SIM), with no username or password; for another SIM, ask its provider. -
Switch module to ECM mode
AT+QCFG="usbnet",1The module may restart by itself.
-
Restart module
AT+CFUN=1,1Wait about 30 seconds for the module to start again. After the restart,
lsusb -tshows thecdc_etherdriver instead ofqmi_wwan, and Linux has ausb0interface.
-
Check that Linux detects module
lsusbThe USB ID shows the module and its USB configuration:
Module Default (RmNet) ECM ECM setting LE910C1, LE910C4 1bc7:12011bc7:1206AT#USBCFG=4ME910C1-WW 1bc7:00361bc7:1102AT#USBCFG=3In the default mode,
lsusb -tshows theqmi_wwandriver on interface 2:$ lsusb -t |__ Port 2: Dev 4, If 0, Class=Vendor Specific Class, Driver=option, 480M |__ Port 2: Dev 4, If 1, Class=Vendor Specific Class, Driver=, 480M |__ Port 2: Dev 4, If 2, Class=Vendor Specific Class, Driver=qmi_wwan, 480M |__ Port 2: Dev 4, If 3, Class=Vendor Specific Class, Driver=option, 480M ... -
Open AT command port
Open the module’s AT port at 115200 baud, as in Send AT commands, and send
AT. The answer isOK. -
Set APN
AT+CGDCONT=1,"IPV4V6","super"Replace
superwith the APN of your SIM.superis the APN of the Sixfab SIM and of the KORE Super SIM (formerly Twilio Super SIM), with no username or password; for another SIM, ask its provider. -
Switch module to ECM mode
Send the ECM setting of your module from the table above, for example on an LE910C4:
AT#USBCFG=4The module restarts by itself. If it does not, restart it with
AT#REBOOT. It takes about 30 seconds to start again. -
Check that ECM driver is loaded
lsusbshows the ECM USB ID from the table, andlsusb -tshows thecdc_etherdriver on interfaces 2 and 3:$ lsusb -t |__ Port 1: Dev 112, If 0, Class=Vendor Specific Class, Driver=option, 480M |__ Port 1: Dev 112, If 1, Class=Vendor Specific Class, Driver=, 480M |__ Port 1: Dev 112, If 2, Class=Communications, Driver=cdc_ether, 480M |__ Port 1: Dev 112, If 3, Class=CDC Data, Driver=cdc_ether, 480M |__ Port 1: Dev 112, If 4, Class=Vendor Specific Class, Driver=option, 480M ...
Check network registration
-
Open AT port again
After the restart, open the AT port again. Registration can take a few minutes, depending on the network.
-
Check SIM and registration
Send each command:
Command Checks Expected answer AT+CPIN?SIM status +CPIN: READYAT+CSQSignal quality For example +CSQ: 25,99;99,99means no signalAT+CREG?Network registration +CREG: 0,1(home network) or+CREG: 0,5(roaming)AT+COPS?Operator For example +COPS: 0,0,"T-Mobile"AT+CGDCONT?APN of each context Context 1 with your APN, for example +CGDCONT: 1,"IPV4V6","super",…
Start connection
The module starts the data connection by itself once it is registered; the usb0 interface gets an IPv4 address from the module.
Start the connection:
AT#ECM=1,0
The answer is OK. The command activates the data context, so it returns ERROR when the SIM is not ready, the module is not registered or the APN is wrong; check the table above and send it again. The wwan0 interface then gets an IPv4 address from the module.
The APN and ECM settings stay in the module. After a restart of the module or the computer, or when the connection drops, send only AT#ECM=1,0 again.
Verify
The interface is usb0 (Quectel) or wwan0 (Telit); the name can differ with the operating system and kernel. The outputs below are from a Quectel module.
-
Check address and routing table
ip addr show usb0 route -n$ ip addr show usb0 6: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000 link/ether 6e:a6:1a:53:e6:e8 brd ff:ff:ff:ff:ff:ff inet 192.168.225.57/24 brd 192.168.225.255 scope global dynamic noprefixroute usb0 valid_lft 42918sec preferred_lft 42918sec$ route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.225.1 0.0.0.0 UG 100 0 0 usb0 0.0.0.0 192.168.68.1 0.0.0.0 UG 600 0 0 wlan0 192.168.68.0 0.0.0.0 255.255.255.0 U 600 0 0 wlan0 192.168.225.0 0.0.0.0 255.255.255.0 U 100 0 0 usb0The interface has an IPv4 address. With several interfaces, the one with the lowest metric carries the traffic: here
usb0(100) beforewlan0(600). -
Ping through cellular interface
ping -I usb0 -c 5 sixfab.comResult: five replies and0% packet loss; addresses and times differ by network.
Details
Remove ModemManager
Instead of stopping and disabling ModemManager, remove it:
sudo apt purge modemmanager -y
Troubleshooting
If the interface does not appear, restart the computer and check the SIM, the antennas, the module seating and the USB cable (Base HAT troubleshooting). Then check the module:
| Check | Command | Expected answer |
|---|---|---|
| ECM mode is set (Quectel) | AT+QCFG="usbnet" | +QCFG: "usbnet",1 |
| ECM mode is set (Telit) | AT#USBCFG? | 4 on the LE910C1 and LE910C4, 3 on the ME910C1-WW |
| The ECM context is active (Telit) | AT#ECM? | #ECM: 0,1. With 0,0, send AT#ECM=1,0,"","",0. |
| The SIM is detected | AT+CPIN? | +CPIN: READY |
| The module is registered | AT+CREG? | +CREG: 0,1 or +CREG: 0,5 |
| The APN is right and the context has an IP address | AT+CGCONTRDP (Quectel), AT+CGDCONT? (Telit) | Your APN and an IP address |
If wwan0 is listed by ip addr but has no IPv4 address, request one, and add a DNS server if names do not resolve:
sudo dhclient -v wwan0
echo "nameserver 8.8.8.8" | sudo tee -a /etc/resolv.conf
Next steps
- Send AT commands to cellular module Find the AT port and send commands with Minicom or ATCom.
- Create LTE Wi-Fi hotspot on Raspberry Pi Share the ECM connection of the Raspberry Pi over Wi-Fi.
- Connect cellular module in QMI mode with libqmi Another connection method: qmicli and the qmi_wwan driver.
- Connect Quectel module with quectel-CM Quectel’s connection manager for QMI mode.
- Base HAT troubleshooting Power, SIM, antenna, USB and UART checks.