TECHSHIP IS A GLOBAL SUPPLIER OF WIRELESS COMPONENTS

Register
FAQs /
Question

How to step by step set up a data connection over QMI interface using qmicli and in-kernel driver qmi_wwan in Linux?

Solution

Several cellular modules based on Qualcomm chipsets implements the Qualcomm Qualcomm MSM (QMI) Interface.
There is a open source Linux in-kernel driver supporting this interface and it is called qmi_wwan. The library libqmi can be used to communicate with the cellular devices over the interface and do necessary configurations to trigger the data connection over the cellular network.

Sierra Wireless MC74**/EM74** series: requires RAW-IP configuration.
Sierra Wireless EM75** series: requires RAW-IP configuration.
Telit LM940: requires RAW-IP configuration.
Telit LN94x series: requires RAW-IP configuration.
Simcom SIM7500/SIM7600/SIM7600*-H series: requires RAW-IP configuration (supported in qmi_wwan driver kernel 4.18+).
Simcom SIM7100 series: 802.3 IP framing supported.
Sierra Wireless MC73**/EM73** series: 802.3 IP framing supported.

First install the libqmi Linux library e.g. by using your system package manager like apt etc. (more details about libqmi here: https://www.freedesktop.org/wiki/Software/libqmi/)

Verify that you have the Linux in-kernel qmi_wwan driver installed for the cellular modules exposed QMI interface endpoint over USB:
lsusb -t
Can look e.g. like this:
...
|__ Port 1: Dev 3, If 2, Class=Vendor Specific Class, Driver=qmi_wwan, 480M
...

If the driver is not correctly loaded, please verify that the module is set to expose the correct USB endpoints configuration toward the host system and that you have followed the provided guides from the cellular module vendors, regarding how to implement the module in Linux.

Libqmi expose a command line interface that can be used to communication with the module over QMI interface.
The qmicli help will output information about all commands available:
qmicli --help-all

The cellular modules QMI control interface are usually named cdc-wdm* e.g.:
qmicli --device=/dev/cdc-wdm0

In order to allow parallel commands to be execute on the module over QMI interface, it is recommended to use the libqmi proxy function. This can be done by including the attribute -p or --device-open-proxy in every qmicli command.

If a SIM pin is required for the SIM card, use command bellow:
qmicli --device=/dev/cdc-wdm0 -p --dms-uim-verify-pin=PIN,1234

The name of the related network interface to QMI control channel can be acquired with the command:
qmicli --device=/dev/cdc-wdm0 --device-open-proxy --get-wwan-iface

The most recent Qualcomm based cellular modules only expose QMI interfaces that can support Raw-IP mode. Sierra Wireless EM/MC74 and EM75 series modules, Telit LM940 and LN940 series for example require this.
Check what IP-mode the host system is configured for:
qmicli --device=/dev/cdc-wdm0 --get-expected-data-format
Check what IP-mode the cellular module require:
qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wda-get-data-format

to change qmi_wwan driver to use Raw-IP.
Disable the network interfaces exposed by the cellular module:
ip link set dev wwan0 down
Trigger the Raw-IP support:
echo Y > /sys/class/net/wwan0/qmi/raw_ip
Enable the network interfaces again:
ip link set dev wwan0 up

Now the data connection in the cellular module can be activated e.g. with a IPv4 type configuration on the specified APN:
qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-start-network="ip-type=4,apn=data.tre.se" --client-no-release-cid

Once "Network started" is displayed, you can send a DHCP request on the network interface.
Please note that not all DHCP clients in Linux can support Raw-IP format, udhcpc however support this for IPv4 over Raw-IP.
udhcpc -q -f -n -i wwan0

Disconnect the data bearer and data connection over QMI by command bellow and providing the network handle and CID returned at connection activation:
qmicli --device=/dev/cdc-wdm0 --device-open-proxy --wds-stop-network=NETWORK_HANDLE --client-cid=CID

Additional useful commands:

Request module manufacturer:
qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-get-manufacturer

Get module model:
qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-get-model

Get firmware version:
qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-get-revision

Get module IDs (IMEI etc.):
qmicli --device=/dev/cdc-wdm0 --device-open-proxy --dms-get-ids

Get SIM card status:
qmicli --device=/dev/cdc-wdm0 --device-open-proxy --uim-get-card-status

Recent cellular modules like Sierra Wireless EM7565 require at least libqmi V1.20. Check version with command:
qmicli --version

If the connection was successfully set up established, you now have data connectivity. A ping to a remote server using the cellular network interface can for example prove this:
ping -I wwan0 8.8.8.8

The ifconfig Linux tool can show the current details for the network interface:
ifconfig wwan0

libqmi is well integrated and supported in ModemManager tool for Linux. ModemManager again is well integrated and supported when using NetworkManager tool in Linux. Please note however that these two tools expect the cellular module interfaces to only be used by them so if you manually want to use the libqmi library or AT commands interfaces, please turn off/disable ModemManager and NetworkManager first.

The libqmi is a generic open source library for Linux systems and QMI protocol from Qualcomm, therefor there are several commands only working on selected devices and not necessarily on supported in the specific device you use, resulting in an error message.

Recently added

Question

How to collect initial diagnostics data and logs for Simcom SIM7000 series cellular modules, needed when requesting Techship technical support?

Solution

In order to troubleshoot and solve a technical problem, we ask you to please provide information about your system and logs from the related Simcom module when creating a technical support ticket.

Problem description of what exact problem is and in what precise situations present.

Describe the host system:
-Hardware (system board, peripherals...)
-Operating system and detailed versions (E.g. Windows, Linux release, kernel...)
-Drivers and driver versions

Identify the precise details of cellular module found on label:
-Model
-SKU/BOM or P/N code
(For RMA returns the IMEI number is mandatory)

If you are running on a Linux based system, please capture the terminal logs bellow:
uname -a
lsusb
lsusb -t
ifconfig -a
ls -l /dev/serial/by-id
ls -l /sys/bus/usb-serial/devices
dmesg

The logs from the cellular module firmware can be acquired by accessing the USB enumerated serial (COM) interfaces accepting AT commands. They can be named modem, AT, PC UI etc. (In Windows device manager, found under modem or serial interfaces). Send the following AT commands bellow to module and capture the output and include them when creating the the technical support ticket.

Test that you get a reply with command:
AT
Command echo enabled:
ATE1
Basic module info:
ATI
Detailed module version info:
AT+SIMCOMATI
Verbose error reporting:
AT+CMEE=2
Module model:
AT+CGMM
Firmware version:
AT+CGMR
IMEI Code:
AT+CGSN
Operational mode:
AT+CFUN?
Pin status:
AT+CPIN?
Get mobile operation band:
AT+CBAND?
Preferred band selection:
AT+CNBP?
Show network system mode:
AT+CNSMOD?
Preferred order CAT-M and NB-IoT:
AT+CMNB?
Preferred network mode:
AT+CNMP?
List network operator info:
AT+COPS?
Network registration status:
AT+CREG?
Network GPRS registration status:
AT+CGREG?
Network EPS registration status:
AT+CEREG?
Signal strength:
AT+CSQ
Request UE system info:
AT+CPSI?
Packet domain attach status
AT+CGATT?
List APN details/PDP profiles:
AT+CGDCONT?
AT$QCPDPP?
PDP profiles attach status:
AT+CGACT?
Show PDP IP address:
AT+CGPADDR
AT+CGCONTRDP
RM network interface status:
AT$QCRMCALL?
Power Saving Mode Setting:
AT+CPSMS?
Entended-DRX Setting:
AT+CEDRXS?
Get Network APN in CAT-M or NB-IOT:
AT+CGNAPN
Service Domain Preference:
AT+CSDP?
LTE Cat-M cell lock configuration:
AT+MCELLLOCK?
LTE NB-IOT cell lock configuration:
AT+NCELLLOCK?
NB-IOT Scrambling Feature config:
AT+NBSC?
APN configuration mode:
AT+CAPNMODE?
Query RRC State:
AT+CRRCSTATE?
CAT-M and NB-IOT band config:
AT+CBANDCFG?
Module crash reset status:
AT+CEDUMP?
NB-IOT band scan optimization config:
AT+CNBS?
Service Domain Preference For NB-IOT:
AT+CNDS?
Network information:
AT+CENG?

The support ticket can be created after login at: https://techship.com/technical_support/

Question

How do we integrate SparkLan devices using Mediatek MT7612U chipset in Linux systems?

Solution

The Mediatek MT7612U chipset can be supported by the Linux in-kernels wireless drivers starting from kernel version 4.19.
https://wireless.wiki.kernel.org/en/users/drivers/mediatek

(For older kernels please relate to driver source downloadable package "Sparklan Linux Drivers 3.0.0.1 v4" linked in the FAQ attached files section)

Usage of in-kernel driver in Linux kernel 4.19 and later:

Plug in the device and check if the correct Linux driver module is loaded correctly for the wifi module by command lsusb and lsusb -t as bellow:
lsusb
Bus 002 Device 005: ID 0e8d:7612 MediaTek Inc.

lsusb -t
|__ Port 3: Dev 5, If 0, Class=Vendor Specific Class, Driver=mt76x2u, 5000M

If the "Driver=mt76x2u" is not shown the driver module fails to load correctly for the wifi module, please check with command dmesg if the device has been detected at all and if the firmware file have failed to load:

dmesg
...
usb 2-3: USB disconnect, device number 2
usb 1-3: new high-speed USB device number 2 using xhci_hcd
usb 2-3: new SuperSpeed Gen 1 USB device number 3 using xhci_hcd
usb 2-3: New USB device found, idVendor=0e8d, idProduct=7612, bcdDevice= 1.00
usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-3: Product: 802.11ac WLAN
usb 2-3: Manufacturer: MediaTek Inc.
usb 2-3: SerialNumber: 000000000
usb 2-3: reset SuperSpeed Gen 1 USB device number 3 using xhci_hcd
mt76x2u 2-3:1.0: ASIC revision: 76120044
mt76x2u 2-3:1.0: Direct firmware load for mediatek/mt7662u_rom_patch.bin failed with error -2
mt76x2u: probe of 2-3:1.0 failed with error -2
...

If that is the case, make sure to download the latest firmware files bellow from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/mediatek and place the firmware files in the directory:
/lib/firmware/mediatek/

Firmware files:
mt7662u.bin
mt7662u_rom_patch.bin

Once in place, reboot the system or replug the USB device and the the correct driver should be loaded for the module.

Question

What firmware versions are related to the specific SKU/BOM codes of cellular modules?

Solution

Sierra Wireless
10839 Sierra Wireless EM7565, CAT-12, M.2 CBRS ENABLED
SKU: 1104207 Firmware: 01.07.02.00 GENERIC

10692 Sierra Wireless EM7565 LTE CAT-12 M.2
SKU: 1103520 Firmware: 01.07.02.00 GENERIC

10375 Sierra Wireless EM7455 LTE Cat 6
SKU: 1103582 Firmware: 02.24.05.06 GENERIC/AT&T/SPRINT/VERIZON
SKU: 1103780 Firmware: 02.24.05.06 GENERIC/AT&T/SPRINT/VERIZON

10427 Sierra Wireless EM7430
SKU: 1103733 Firmware: 02.24.05.06 GENERIC/DOCOMO/KDDI/SOFTBANK/TELSTRA

10374 Sierra Wireless MC7455 LTE Cat 6
SKU: 1103789 Firmware: 02.24.05.06 GENERIC/AT&T/BELL/ROGERS/SPRINT/TELUS/US CELLULAR/VERIZON/VODAFONE

10397 Sierra Wireless MC7430 mPCIe
SKU: 1103737 Firmware: 02.24.05.06 GENERIC/DOCOMO/KDDI/SOFTBANK/TELSTRA

10840 Sierra Wireless EM7511
SKU: 1103989 Firmware: 01.07.02.00 AT&T/GENERIC

Huawei:
10278 Huawei ME909s-120 mPCIe:
SKU: 55010273 Firmware: 11.617.01.00.00
SKU: 55010782 Firmware: 11.617.09.00.00

Simcom:
10689 SIMCom SIM7600E-H LTE SMT EU
SKU: S2-107EQ-Z1W27 Firmware: LE11 B07 SIM7600M22
SKU: S2-107EQ-Z1W2L Firmware: LE11 B08 SIM7600M22
SKU: S2-107EQ-Z1W3S Firmware: LE11 B09 SIM7600M22
SKU: S2-107EQ-Z1W4J Firmware: LE11 B10 SIM7600M22
SKU: S2-107EQ-Z1W51 Firmware: LE11 B11 SIM7600M22

10690 SIMCom SIM7600E-H LTE mPCIe EU
SKU: S2-107ER-Z1W2L Firmware: LE11 B07 SIM7600M22
SKU: S2-107ER-Z1W2L Firmware: LE11 B08 SIM7600M22
SKU: S2-107ER-Z1W3S Firmware: LE11 B09 SIM7600M22
SKU: S2-107ER-Z1W4J Firmware: LE11 B10 SIM7600M22
SKU: S2-107ES-Z1W51 Firmware: LE11 B11 SIM7600M22

10818 SIMCom SIM7600E-H LTE CAT 4 -mPCIE with Audio
SKU: S2-107ES-Z1W27 Firmware: Firmware: LE11B07SIM7600M22
SKU: S2-107ES-Z1W2L Firmware: LE11B08SIM7600M22
SKU: S2-107ES-Z1W3S Firmware: LE11B09SIM7600M22
SKU: S2-107ES-Z1W4J Firmware: LE11B10SIM7600M22
SKU: S2-107ES-Z1W51 Firmware: LE11B11SIM7600M22

10710 SIMCom SIM7600E-H LTE CAT-4 mPCIe SIM
SKU: S2-107Q0-Z1W27 Firmware: LE11 B07 SIM7600M22
SKU: S2-107Q0-Z1W2L Firmware: LE11 B08 SIM7600M22
SKU: S2-107Q0-Z1W3S Firmware: LE11 B09 SIM7600M22
SKU: S2-107Q0-Z1W4J Firmware: LE11 B10 SIM7600M22
SKU: S2-107Q0-Z1W51 Firmware: LE11 B11 SIM7600M22

SIM7600SA-H SMT type
SKU: S2-107BH-Z1W27 Firmware: LE11 B07 SIM7600M22
SKU: S2-107BH-Z1W2L Firmware: LE11 B08 SIM7600M22
SKU: S2-107BH-Z1W3S Firmware: LE11 B09 SIM7600M22
SKU: S2-107BH-Z1W4J Firmware: LE11 B10 SIM7600M22
SKU: S2-107BH-Z1W51 Firmware: LE11 B11 SIM7600M22

10757 SIMCom SIM7600SA-H LTE CAT-4 mPCIe
SKU: S2-107KX-Z1W27 Firmware: LE11 B07 SIM7600M22
SKU: S2-107KX-Z1W2L Firmware: LE11 B08 SIM7600M22
SKU: S2-107KX-Z1W3S Firmware: LE11 B09 SIM7600M22
SKU: S2-107KX-Z1W4J Firmware: LE11 B10 SIM7600M22
SKU: S2-107KX-Z1W51 Firmware: LE11 B11 SIM7600M22

SIM7600SA-H LTE CAT 4 -mPCIE with Audio
SKU: S2-107KY-Z1W27 Firmware: LE11 B07 SIM7600M22
SKU: S2-107KY-Z1W2L Firmware: LE11 B08 SIM7600M22
SKU: S2-107KY-Z1W3S Firmware: LE11 B09 SIM7600M22
SKU: S2-107KY-Z1W4J Firmware: LE11 B10 SIM7600M22
SKU: S2-107KY-Z1W51 Firmware: LE11 B11 SIM7600M22

10810 SIMCom SIM7600SA-H LTE CAT-4 mPCIe with SIM holder
SKU: S2-107QZ-Z1W2L Firmware: LE11 B08 SIM7600M22
SKU: S2-107QZ-Z1W3S Firmware: LE11 B09 SIM7600M22
SKU: S2-107QZ-Z1W4J Firmware: LE11 B10 SIM7600M22
SKU: S2-107QZ-Z1W51 Firmware: LE11 B11 SIM7600M22

SIM7600E SMT type
SKU: S2-107EP-Z1W2P Firmware: LE11 B01 SIM7600M21-A
SKU: S2-107EP-Z1W4D Firmware: LE11 B02 SIM7600M21-A

10812 SIMCom SIM7600E CAT-1 mPCIe
SKU: S2-107ET-Z1W2P Firmware: LE11 B01 SIM7600M21-A
SKU: S2-107ET-Z1W4D Firmware: LE11 B02 SIM7600M21-A

SIM7600E LTE CAT 1 -mPCIE with Audio
SKU: S2-107EV-Z1W2P Firmware: LE11 B01 SIM7600M21-A
SKU: S2-107EV-Z1W4D Firmware: LE11 B02 SIM7600M21-A

10813 SIMCom SIM7600SA LTE CAT-1 mPCIe
SKU: S2-107KV-Z1W2P Firmware: LE11 B01 SIM7600M21-A
SKU: S2-107KV-Z1W4D Firmware: LE11 B02 SIM7600M21-A

SIM7600SA SMT type
SKU: S2-107BG-Z1W2P Firmware: LE11 B01 SIM7600M21-A
SKU: S2-107BG-Z1W4D Firmware: LE11 B02 SIM7600M21-A

SIM7600SA LTE CAT 1 -mPCIE with Audio
SKU: S2-107KW-Z1W2P Firmware: LE11 B01 SIM7600M21-A
SKU: S2-107KW-Z1W4D Firmware: LE11 B02 SIM7600M21-A

10305 SimCom SIM7100 LTE mPCIe US
SKU: S2-106EW-Z1L7X Firmware: 4534B03SIM7100A
SKU: S2-106EW-Z1L72 Firmware: 4534B03SIM7100A

Question

How to change USB mode from storage to cellular device for Huawei MS2372-series USB 4G/LTE cellular sticks in Linux systems?

Solution

The Huawei cellular 4G/LTE USB-Sticks will show up as USB mass storage devices when first loaded and enumerated in Linux systems.

lsusb
Bus 001 Device 004: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem (Mass Storage Mode)

lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 480M
|__ Port 4: Dev 6, If 0, Class=Mass Storage, Driver=usb-storage, 480M

This mode is not the operational mode to use the device in for cellular connectivity, therefore a USB mode switch is necessary to perform.
It can easily be done with the tool usb_modeswitch in Linux.

You can download and install it from:
http://www.draisberghof.de/usb_modeswitch/

Or install it e.g. through a package manager if your Linux distribution supports one:
apt-get install usb-modeswitch

Once you have it installed it, open the file 40-usb_modeswitch.rules with a text editor, e.g:
nano /lib/udev/rules.d/40-usb_modeswitch.rules

Ensure that you find:
# Generic entry for most Huawei devices, excluding Android phones
ATTRS{idVendor}=="12d1", ATTRS{manufacturer}!="Android", ATTR{bInterfaceNumber}=="00", ATTR{bInterfaceClass}=="08", RUN+="usb_modeswitch '/%k'"

If not, add the following entry bellow and save the file:
# Huawei MS2372
ATTR{idVendor}=="12d1", ATTR{idProduct}=="14fe", RUN+="usb_modeswitch '/%k'"


Create a new empty text file in the folder /etc/usb_modeswitch.d/ called 12d1:14fe e.g. as bellow:
nano /etc/usb_modeswitch.d/12d1:14fe

Paste in the following configuration lines in the file:
# Huawei MS2372 series
TargetVendor=0x12d1
TargetProductList="1506"
HuaweiNewMode=1
NoDriverLoading=1

Now save the file.

You can run the command bellow to update the udev rules for what system should do when a new device of this kind is detected:
udevadm control --reload-rules && udevadm trigger

If you restart the system or unplug and plug in the MS2372 series USB-stick again now, USB mode switching should be done automatically, and the device appear in the correct mode in the system as bellow:
lsusb
Bus 001 Device 004: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 480M
|__ Port 4: Dev 4, If 0, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 4, If 1, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 4, If 2, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 4, If 3, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M

If this is not occurring correctly, usb_modeswitch debug logging can be turned on by editing the usb_modeswitch.conf file located in /etc/:
nano /etc/usb_modeswitch.conf

The log file can be found in:
/var/log/usb_modeswitch.log

Please note that all Linux command line commands were executed with elevated / root privileges in this example.

Question

How can we integrate the Simcom SIM7500/SIM7600 Series Linux NDIS driver in Linux kernel without rebuilding it?

Solution

The Simcom SIM7500/SIM7600 series Linux NDIS network driver can be built and installed without rebuilding the complete Linux kernel your OS distribution uses. Please see steps and pre-requirements bellow and download the attached "Simcom SIM7500 and SIM7600 Series Linux Network NDIS driver installation files and guide (without kernel rebuild)" archive to get started.

Should you instead want to include the NDIS driver into your customized Linux kernel build, please relate to "SIMCom SIM7500 - SIM7600 series modules Linux NDIS driver and system integration guide V2.01" attached to the FAQ.

All commands are supposed to be executed with elevated system privileges/as root user.

Ensure that your original kernel was built with the following config options enabled, this will allow the option and usbnet driver pre-requirments to be included in kernel. (usually already included in larger distributions)
CONFIG_USB_SERIAL=y
CONFIG_USB_SERIAL_WWAN=y
CONFIG_USB_SERIAL_OPTION=y
CONFIG_USBNET=y

Build-tools and Linux header files for your kernel version are also required, these can be installed e.g. through your OS distributions package manager, on Debian/Ubuntu systems:
apt-get install build-essential make gcc
apt-get install linux-headers-`uname -r`

The in-kernel qmi_wwan driver should be blacklisted and prevented from loading as it will block the Simcom wwan driver, this is how it can be done e.g. in Ubuntu systems:
grep -q -F 'blacklist qmi_wwan' /etc/modprobe.d/blacklist-modem.conf || echo 'blacklist qmi_wwan' >> /etc/modprobe.d/blacklist-modem.conf

Build and install the driver:
Unzip the archive and copy the folder sim7600 to your selected working directory.
Navigate to it, e.g.:
cd /usr/src/sim7600/

Build and install the drivers:
make install

Some warnings might appear, but verify that no errors are reported.

Restarting the host system should now result in the correct network drivers being loaded for the cellular module once the USB device is detected in the system.

It can be verified by finding lsusb -t listing "Driver=simcom_wwan" for a USB endpoint:
lsusb
Bus 001 Device 005: ID 1e0e:9001 Qualcomm / Option

lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 480M
|__ Port 4: Dev 5, If 0, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 5, If 1, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 5, If 2, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 5, If 3, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 5, If 4, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 5, If 5, Class=Vendor Specific Class, Driver=simcom_wwan, 480M

dmesg | grep 'simcom_wwan'
simcom_wwan 1-4:1.5 wwan0: register 'simcom_wwan' at usb-0000:00:15.0-4, SIMCOM wwan/QMI device, 8a:d8:ff:c2:87:11

Additional make options and information:
If you've built the driver previously already, first clean out any old builds with:
make clean

If you only want to build the driver but not install it into /lib/modules/`uname -r`/kernel/drivers/net/usb/, use make without install parameter:
make

Testing of the cellular connection can easily be done by first performing the necessary initiation AT commands to the cellular module over Modem/AT commands serial interface normally located on /dev/ttyUSB2. Use e.g. minicom tool to communicate with it.
Can be installed e.g. through the distributions package manager:
apt-get install minicom

Access the serial interface:
minicom -D /dev/ttyUSB2

Please relate to AT commands guide for full details on what commands are supported.
Issue AT and check that you get OK as reply.
AT

Enable echo on characters sent to module:
ATE1

Request general info about module:
ATI

Enter the SIM pin code (if necessary for SIM card)
AT+CPIN=****

Enter your operators APN details:
AT+CGDCONT=1,"IP","my.operator.apn"

Enter APN authentication details (if necessary) further details found in the AT commands guide.
AT+CGAUTH=CID,auth_type,”password”,”username”

Check network registration:
AT+CREG?

Activate and connect the cellular data connection to the network interface installed in Linux system:
AT$QCRMCALL=1,1

When you get the reply $QCRMCALL: 1, V4 from cellular module it means that the data connection to your network operator is fully established and you can now exit the minicom tool (CTRL+A followed by Z key and Q key and select yes to exit).

Once here you can now perform a DHCP request on the cellular network interface in the Linux system by using your favorite DHCP client in Linux e.g. dhclient or udhc e.g.:
dhclient -v wwan0
udhcpc --interface=wwan0

The cellular network interfaces are normally named starting from wwan0 but might get renamed by some Linux distributions automatically. All available network interfaces can be listed with command:
ip link show

The network interface can be tested e.g. by sending ping requests to a remote server over the selected network interface:
ping -I wwan0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 10.163.183.209 wwan0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=120 time=191 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=120 time=46.1 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=120 time=52.8 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=120 time=43.3 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 43.350/83.407/191.281/62.376 ms

Question

How to activate the data connection for Huawei cellular USB-sticks (MS2372 series) using the NCM network interface exposed by module in Linux?

Solution

The first step is to assure that the Huawei cellular module is properly loaded in the Linux system. Huawei modules are most often automatically detected in recent Linux kernels, this can be verified in different ways, e.g. by commands bellow:

The lsusb command shows what physical USB devices are detected in the Linux operating system:
lsusb
Bus 001 Device 017: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard

The lsusb -t command shows the USB endpoints exposed by the detected USB devices and the related drivers loaded for them:
lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 480M
|__ Port 4: Dev 17, If 0, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 17, If 1, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 17, If 2, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 17, If 3, Class=Vendor Specific Class, Driver=huawei_cdc_ncm, 480M

If the device shows up as a USB mass storage device please see FAQ linked bellow on how to change USB mode:
lsusb
Bus 001 Device 004: ID 12d1:14fe Huawei Technologies Co., Ltd. Modem (Mass Storage Mode)

Techship.com: How to change USB mode from storage to cellular device for Huawei MS2372-series USB 4G/LTE cellular sticks in Linux systems?
https://techship.com/faq/how-to-change-usb-mode-from-storage-to-cellular-device-for-huawei-ms2372-series-usb-4g-lte-cellular-sticks-in-linux-systems/


The dmesg lists all the driver loading logs since system boot up:
dmesg
usb 1-4: new high-speed USB device number 16 using xhci_hcd
usb 1-4: New USB device found, idVendor=12d1, idProduct=14fe, bcdDevice= 1.02
usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-4: Product: HUAWEI_MOBILE
usb 1-4: Manufacturer: HUAWEI_MOBILE
usb 1-4: SerialNumber: 0123456789ABCDEF
usb-storage 1-4:1.0: USB Mass Storage device detected
scsi host2: usb-storage 1-4:1.0
scsi 2:0:0:0: CD-ROM HUAWEI Mass Storage 2.31 PQ: 0 ANSI: 2
sr 2:0:0:0: Power-on or device reset occurred
sr 2:0:0:0: [sr0] scsi-1 drive
sr 2:0:0:0: Attached scsi CD-ROM sr0
sr 2:0:0:0: Attached scsi generic sg0 type 5
usb 1-4: USB disconnect, device number 16
usb 1-4: new high-speed USB device number 17 using xhci_hcd
usb 1-4: New USB device found, idVendor=12d1, idProduct=1506, bcdDevice= 1.02
usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-4: Product: HUAWEI_MOBILE
usb 1-4: Manufacturer: HUAWEI_MOBILE
huawei_cdc_ncm 1-4:1.3: resetting NTB format to 16-bit
huawei_cdc_ncm 1-4:1.3: MAC-Address: 00:1e:10:1f:00:00
huawei_cdc_ncm 1-4:1.3: setting rx_max = 16384
huawei_cdc_ncm 1-4:1.3: NDP will be placed at end of frame for this device.
huawei_cdc_ncm 1-4:1.3: cdc-wdm0: USB WDM device
huawei_cdc_ncm 1-4:1.3 wwan0: register 'huawei_cdc_ncm' at usb-0000:00:15.0-4, Huawei CDC NCM device, 00:1e:10:1f:00:00
usbcore: registered new interface driver option
usbserial: USB Serial support registered for GSM modem (1-port)
option 1-4:1.0: GSM modem (1-port) converter detected
usb 1-4: GSM modem (1-port) converter now attached to ttyUSB0
option 1-4:1.1: GSM modem (1-port) converter detected
usb 1-4: GSM modem (1-port) converter now attached to ttyUSB1
option 1-4:1.2: GSM modem (1-port) converter detected
usb 1-4: GSM modem (1-port) converter now attached to ttyUSB2


The command ifconfig -a will list all network interfaces loaded in the Linux system, the cellular module interface can be named differently depending on the distribution used but generally named wwan0 initially.
ifconfig -a
wwan0: flags=4098 mtu 1500
ether 00:1e:10:1f:00:00 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0


the command ls can list the USB serial interfaces detected:
ls /dev/ttyUSB*
/dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2

Once this far we can now start communicate with the cellular module over AT commands. There are different applications available in Linux that enables manual communication with serial interfaces:

minicom -D /dev/ttyUSB2
socat - /dev/ttyUSB2,crnl
etc.

Basic AT commands for information and how to set up the data connection:

Print general information about cellular module and firmware versions, IMEI etc.
ATI

Enter the SIM PIN code:
AT+CPIN=1234

Set the operator APN name to use for the data connectivity
AT+CGDCONT=1,"IP","m2m.tele2.com"

Activate the data connection for the network interface exposed to host system with the APN profile previously created.
AT^NDISDUP=1,1,

Once: ^NDISSTAT:1,,,"IPV4" is received you now have a active data connection to the network operator.

Now you can use a DHCP client in your host system to request the IP address from the cellular network, e.g. by using any of the following one:
udhcpc --interface=wwan0 -q
dhclient -v wwan0

If successful you now have a working cellular network data connection in your Linux system.

ifconfig wwan0
wwan0: flags=4163 mtu 1500
inet 100.77.146.21 netmask 255.255.255.252 broadcast 100.77.146.23
inet6 fe80::21e:10ff:fe1f:0 prefixlen 64 scopeid 0x20
ether 00:1e:10:1f:00:00 txqueuelen 1000 (Ethernet)
RX packets 37 bytes 4286 (4.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 27 bytes 4474 (4.4 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

It can be verified e.g. by dong ping requests over the dedicated network interface:
ping -I wwan0 8.8.8.8

PING 8.8.8.8 (8.8.8.8) from 100.77.146.21 wwan0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=120 time=147 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=120 time=57.6 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=120 time=51.5 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=120 time=49.6 ms
^C
--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 49.656/76.500/147.083/40.859 ms

Additional details on how the AT commands can be used to enter APN credentials, initial LTE attach APN information etc. can be found in the AT commands manual

Question

How to access the serial AT command interfaces for Huawei HiSilicon chipset based modules in systems with Windows 8 and later?

Solution

Serial interfaces for cellular modules are recommended to be disabled by default by Microsoft for systems running Windows 8 and later.

The serial interfaces for AT commands etc. can however be exposed again by first using the tool in linked archive: "Huawei AT commands over MBIM interface tool for Windows 8-10 systems and usage guide" and send module the command bellow once (stored in module memory):
AT^SETMODE=1
(instead of the default value AT^SETMODE=0)
The module will now reboot and new end-points will be visible for the module once re-appearing.

By installing the linked drivers: "Huawei Debug Driver V.2.0.6.1 for HiSilicon" the correct end point drivers can also be loaded for the cellular module when used in this mode.

You should now be able to find AT commands accepting serial interface as following:
Huawei ME909s, and ME906s series:
HUAWEI Mobile Connect - PC UI Interface

Question

How can we acquire IMSI and ICCID using Libqmi's command line interface qmicli in Linux systems for Qualcomm QMI devices not supporting deprecated commands: "--dms-uim-get-iccid" and "--dms-uim-get-imsi"?

Solution

Cellular modules based on recent Qualcomm MSM Interface (QMI) (MDM9240 etc.) do not support the deprecated QMI commands for requesting the SIM cards related ICCID code and subscription related IMSI code.

They can instead be read directly from the module using the command option and addresses bellow. The result will be represented as sequences of bytes in hex format with most significant bit to the right as read from the SIM card according to 3GPP standard ETSI TS 131 102.

ICCID :
--uim-read-transparent=0x3F00,0x2FE2

Example:
qmicli -p -d /dev/cdc-wdm0 --uim-read-transparent=0x3F00,0x2FE2
[/dev/cdc-wdm0] Successfully read information from the UIM:
Card result:
SW1: '0x90'
SW2: '0x00'
Read result:

98:54:40:12:51:50:72:40:09:98

Resulting in ICC Identification ID:
89 45 04 21 15 05 27 04 90 89



IMSI :
--uim-read-transparent=0x3F00,0x7FFF,0x6F07
Example:
qmicli -p -d /dev/cdc-wdm0 --uim-read-transparent=0x3F00,0x7FFF,0x6F07
[/dev/cdc-wdm0] Successfully read information from the UIM:
Card result:
SW1: '0x90'
SW2: '0x00'
Read result:
08:29:83:02:78:00:21:28:87

Resulting in IMSI (15 digit long):
2 38 20 87 00 12 82 78

Question

How can we configure Telit LN94* series cellular modules to expose QMI mode which is used by qmi_wwan or GobiNet drivers in Linux based systems?

Solution

The Telit LN94* series cellular module requires a USB mode change in order to expose the QMI network interface used by GobiNet drivers or the qmi_wwan drivers.

This procedure can be done once by AT commands (see further down) and it get stored in the modules NV memory for future on. You can also setup the common usb_modeswitch tool in Linux to this change for the Telit LN940 series modules at every device detection instead.

You can download and install usb_modeswitch tool from:
http://www.draisberghof.de/usb_modeswitch/

Or install it e.g. through a package manager if your Linux distribution supports one:
apt-get install usb-modeswitch

For manually perform the mode changing, you can execute the command bellow which alters the bConfigurationValue to 1:
usb_modeswitch -v 1bc7 -p 1900 -u 1

This will set the module to expose the QMI/RMNET interface as well as the related serial interfaces for Qualcomm diagnostics, NMEA and AT interface.

It can also be automated on every module detection in host system:
Open the file 40-usb_modeswitch.rules with a text editor found in /lib/udev/rules.d/ , e.g as bellow:
nano /lib/udev/rules.d/40-usb_modeswitch.rules

Add the following entry bellow and save the file:
#Telit LN94x series (QMI mode)
ATTR{idVendor}=="1bc7", ATTR{idProduct}=="1900", RUN+="usb_modeswitch '/%k'", RUN+="/sbin/modprobe qmi_wwan"

(the additional RUN+="/sbin/modprobe qmi_wwan" can be used to trigger the loading of qmi_wwan driver so it get assigned after mode change)
Create a new text file in the folder /etc/usb_modeswitch.d/ called 1bc7:1900 e.g:
nano /etc/usb_modeswitch.d/1bc7:1900

Paste in the following configuration lines in the editor and save the file:
# Telit LN94x series (QMI mode)
TargetVendor=0x1bc7
TargetProduct=0x1900
Configuration=1
NoDriverLoading=1

You can run the command bellow to update the udev rules in the system:
udevadm control --reload-rules && udevadm trigger

If you restart the system now, the USB mode switching should be done automatically, and the correct USB mode endpoints and drivers loaded as bellow. (Provided that you have modified the option.c and qmi_wwan.c source files and rebuilt the option and qmi_wwan modules according to Telit instructions in "Telit LN94x series Linux Driver Source Package V.0.00.01" downloadable resource.

lsusb
Bus 002 Device 002: ID 1bc7:1900 Telit Wireless Solutions

lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/7p, 5000M
|__ Port 4: Dev 2, If 0, Class=Vendor Specific Class, Driver=option, 5000M
|__ Port 4: Dev 2, If 1, Class=Vendor Specific Class, Driver=qmi_wwan, 5000M
|__ Port 4: Dev 2, If 2, Class=Vendor Specific Class, Driver=option, 5000M
|__ Port 4: Dev 2, If 3, Class=Vendor Specific Class, Driver=option, 5000M
|__ Port 4: Dev 2, If 4, Class=Vendor Specific Class, Driver=option, 5000M

If this is not occurring correctly, usb_modeswitch debug logging can be turned on by editing the usb_modeswitch.conf file located in /etc/:
nano /etc/usb_modeswitch.conf

The log file can be found in:
/var/log/usb_modeswitch.log

Please note that all Linux command line commands were executed with elevated / root privileges in this example.

How to change the USB mode via AT commands:

By default configuration there is no serial interfaces available that can accept AT commands in Windows system, but a tool can be used to issue the AT commands over MBIM interface, enabling you to set the module in other configuration than the default one.

Download and install "Telit LN94x Series Microsoft Windows Driver Installer" in you Windows 10 system, now the module should be detected correctly, check e.g. in device manager.

Download and open the "Telit LN94x Series AT Commands over MBIM Interface Helper Tool" application.
In the application, open the Telit LN94x MBIM device and send the AT command according to desired mode:

AT^SETMODE=0
Default mode, MBIM interface only for Windows.
Supported in Windows 10 systems.
USB VID: 1bc7 PID: 1900

AT^SETMODE=1
MBIM mode with serial interfaces
Supported in Windows 10 systems
USB VID: 1bc7 PID: 1901

AT^SETMODE=2
QMI/RMNET and serial interfaces
Supported in Linux systems
USB VID: 1bc7 PID: 1900

Sending the AT command should result in the cellular module automatically restarting with the new usb endpoint configuration exposed.
Please note that the Windows system do not load correct drivers for the module any longer after the USB endpoint configuration is changed.

Question

How do we configure the Simcom SIM7100, SIM7500 and SIM7600 series cellular modules for usage in Windows 8 and 10 systems and support Windows built-in connection manager?

Solution

The Simcom modules comes default set in a USB configuration used by Linux and Windows 7 systems. If you want the module to be fully supported in Windows 8, 8.1, 10 systems and later and take advantage of the Windows integrated connection manager you have to do a one time configuration and set the module to expose Mobile Broadband Interface Model (MBIM) interface as bellow:

Start by installing the latest Simcom SIM7 series Windows drivers (instructions included in download package). They can be found on on our dedicated product web pages.

In Windows device manager you can now find a serial interface called "SimTech HS-USB AT Port 9001 (COM5)" Memorize the COM* interface number in your system.

Open a command prompt with admin rights (right click Windows icon in bottom left corner). Copy and paste the command bellow, edit port number to match the one in your system and hit enter. The command will then be sent to module overt the serial interface.
ECHO AT+CUSBPIDSWITCH=9004,1,1 >\\.\COM5

If the command is received successfully by module, a restart of the cellular module will be performed and it appears with the new USB endpoints supporting Windows 8 systems and later.

Make sure that all Simcom module end points are correctly loaded in Windows device manager, a system restart might be necessary also.

By clicking the Windows network connection symbol in the start bar or navigating to the "Cellular" topic in Windows system settings you can now activate the connection and configure APN details and enter PIN code if it is necessary for the cellular connection and subscription you have.