TECHSHIP IS A GLOBAL SUPPLIER OF WIRELESS COMPONENTS

Register
FAQs /

Recently added

Question

How can we use Sierra Wireless MC/EM74 and EM75 series cellular modules in Linux with the MBIM control and data interface?

Solution

The Sierra Wireless MC/EM74 and EM75 series cellular modules can expose the Mobile Broadband Interface Model (MBIM) Interface.

There is a open source Linux in-kernel driver supporting MBIM interface and it is called cdc_mbim. The library libmbim 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.

First install the libmbim and libmbim-utils Linux library using your system package manager like apt etc. (more details about libmbim here: https://www.freedesktop.org/wiki/Software/libmbim/)

Check with lsusb that you have the Sierra wireless module loaded, vid:pid value 1199:9091 or 1199:9071 should be present.
lsusb
Bus 002 Device 003: ID 1199:9091 Sierra Wireless, Inc.
or:
Bus 002 Device 003: ID 1199:9071 Sierra Wireless, Inc.

Verify with lsusb -t that the Linux in-kernel cdc_mbim driver is correctly loaded for the cellular module. It can look e.g. like this:
lsusb -t
...
|__ Port 3: Dev 3, If 0, Class=Vendor Specific Class, Driver=qcserial, 5000M
|__ Port 3: Dev 3, If 2, Class=Vendor Specific Class, Driver=qcserial, 5000M
|__ Port 3: Dev 3, If 3, Class=Vendor Specific Class, Driver=qcserial, 5000M
|__ Port 3: Dev 3, If 12, Class=Communications, Driver=cdc_mbim, 5000M
|__ Port 3: Dev 3, If 13, Class=CDC Data, Driver=cdc_mbim, 5000M
...

If this is not the case, you will have to change USB end points the cellular module exposes. This can be done through AT commands sent to the modules serial interfaces accepting AT commands. Usually located at dev/ttyUSB2 if the qcserial drivers are correctly loaded.

MC74xx/EM74xx series:
AT!ENTERCND="A710"
AT#USBCOMP=1,1,100D
AT!RESET

EM75xx series:
AT!ENTERCND="A710"
AT#USBCOMP=1,3,100D
AT!RESET

(Applications like Minicom or Picocom can be used to send AT commands over the serial interfaces)

Should you have no serial interface loaded, it is because the driver has not been loaded for the USB serial endpoints due to missing vid:pid values in the qcserial driver. You can then use the commands bellow to temporarily load the driver for new vid:pid combinations.
modprobe qcserial
EM75 series:
echo 1199 9091 > /sys/bus/usb-serial/drivers/qcserial/new_id
MC74xx/EM74xx series:
echo 1199 9071 > /sys/bus/usb-serial/drivers/qcserial/new_id

When you have changed the cellular modules USB endpoint configuration to expose MBIM interface and module have restarted, then you can use libmbim's command line interface to control the cellular module.

Using libmbim with the command line interface mbimcli:
List all available options for mbimcli:
mbimcli --help-all

Check version
mbimcli --version

The cellular modules mbim interface is usually named cdc-wdm* among the devices. For mbimcli this is defined by --device=/dev/cdc-wdm0 parameter. You should also use the proxy function to enable parallel commands to be sent to module even if the interface already is in use by a data connection. This is done by including --device-open-proxy or -p in every mbimcli requst to module.
Command example to query device capabilities and information (firmware & IMEI code etc.):
mbimcli --device=/dev/cdc-wdm0 --device-open-proxy --query-device-caps

The libmbim tool: mbim-network can be used to establish a simple data connection.
First create a config file containing your network operators APN details. Save it in the default location where mbim-network searches for the file: /etc/mbim-network.conf .
The parameter --profile=[PATH] can be used to alter this path when executing mbim-network.

Save the APN details, (and username, password and authentication type if necessary) into the configuration file:
APN=
APN_USER=
APN_PASS=
APN_AUTH=
PROXY=yes

How to start a data connection after configuration file is in place:
Enter SIM PIN (if necessary for SIM card):
mbimcli -d /dev/cdc-wdm0 -p --enter-pin=1234

Start the mbim data connection with command bellow, if successful it will print "Network started successfully"
mbim-network /dev/cdc-wdm0 start

You can now execute the mbim-set-ip script (download found bellow related to this FAQ) with sufficient system privileges:
./mbim-set-ip /dev/cdc-wdm0 wwan0

This script will collect the network interface IP configurations from the cellular module over MBIM interface using mbimcli, parse them and apply them to the network interface in Linux, this because DHCP requests are generally not supported over MBIM interfaces.

Once you have started the data connection and set the details with the mbim-set-ip script you should be able to ping the data connection:
IPv4 ping: (only supported if IPv4 address was acquired from cellular module)
ping -4 -I wwan0 8.8.8.8
ping -4 -I wwan0 google.com

IP v6 ping: (only supported if IPv6 address was acquired from cellular module)
ping -6 -I wwan0 2001:4860:4860::8888
ping -6 -I wwan0 google.com

The cellular data connection can be disconnected by commands:
Stop mbim data connection:
mbim-network /dev/cdc-wdm0 stop

Set network interface down:
ip link set wwan0 down

Other useful commands:
Query device capabilities and information (firmware & IMEI code etc.):
mbimcli -d /dev/cdc-wdm0 -p --query-device-caps

Query SIM card information:
mbimcli -d /dev/cdc-wdm0 -p --query-subscriber-ready-status

Query network registration state:
mbimcli -d /dev/cdc-wdm0 -p --query-registration-state

Query connection ip information:
mbimcli -d /dev/cdc-wdm0 -p --query-ip-configuration=0

Test setup:
Software: Ubuntu server 18.04 LTS with kernel 4.15.0-23-generic and mbimcli 1.14.2
Hardware: Sierra Wireless EM7565 with firmware SWI9X50C_01.07.00.00 on Aaeon UP Squared host board with 10703 M.2 to USB 3.0 Adapter.

Question

How can we use Simcom SIM7500 and SIM7600 series in Linux with the MBIM control and data interface over USB connectivity?

Solution

The Simcom SIM7500 and SIM7600 series cellular module can expose the Mobile Broadband Interface Model (MBIM) Interface.

There is a open source Linux in-kernel driver supporting MBIM interface and it is called cdc_mbim. The library libmbim 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.

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

First check with lsusb that you have the Simcom module set to expose MBIM interface, this can be verified with command lsusb and you should the vid:pid value 1e0e:9003.
lsusb
Bus 001 Device 003: ID 1e0e:9003 Qualcomm / Option

If this is not the case, you will have to change what USB end points the cellular module exposes and the vid:pid values. This can be done through AT commands sent to one of the modules serial interfaces accepting AT commands. dev/ttyUSB2 is often the correct one. AT+CUSBPIDSWITCH=9001,1,1
AT+CRESET
(Applications like Minicom or Picocom can be used to send AT commands over the serial interfaces)

Should you have no serial interface loaded, it is because the driver has not been loaded for the USB serial endpoints due to missing vid:pid values in the option driver, you can then use the commands bellow to temporarily load the driver for new vid:pid combinations.
modprobe option
echo 1e0e 9001 > /sys/bus/usb-serial/drivers/option1/new_id

After you have changed the cellular modules USB endpoint configuration to expose MBIM interface, you can verify with lsusb -t that the Linux in-kernel cdc_mbim driver is correctly loaded for the cellular module. It can look e.g. like this:
lsusb -t
...
|__ Port 4: Dev 3, If 1, Class=Vendor Specific Class, Driver=, 480M
|__ Port 4: Dev 3, If 6, Class=CDC Data, Driver=cdc_mbim, 480M
|__ Port 4: Dev 3, If 4, Class=Vendor Specific Class, Driver=, 480M
|__ Port 4: Dev 3, If 2, Class=Vendor Specific Class, Driver=, 480M
|__ Port 4: Dev 3, If 0, Class=Vendor Specific Class, Driver=, 480M
|__ Port 4: Dev 3, If 5, Class=Communications, Driver=cdc_mbim, 480M
|__ Port 4: Dev 3, If 3, Class=Vendor Specific Class, Driver=, 480M

if you have no option drivers loaded for the serial interfaces, these can be loaded temporarilwith commands:
modprobe option
echo 1e0e 9003 > /sys/bus/usb-serial/drivers/option1/new_id

Using libmbim with the command line interface mbimcli:
List all available options for mbimcli:
mbimcli --help-all

Check version
mbimcli --version

The cellular modules mbim interface is usually named cdc-wdm* among the devices. For mbimcli this is defined by --device=/dev/cdc-wdm0 parameter. You should also use the proxy function to enable parallel commands to be sent to module even if the interface already is in use by a data connection. This is done by including --device-open-proxy or -p in every mbimcli requst to module.
Command example to query device capabilities and information (firmware & IMEI code etc.):
mbimcli --device=/dev/cdc-wdm0 --device-open-proxy --query-device-caps

The libmbim tool: mbim-network can be used to establish a simple data connection.
First create a config file containing your network operators APN details. Save it in the default location where mbim-network searches for the file: /etc/mbim-network.conf .
The parameter --profile=[PATH] can be used to alter this path when executing mbim-network.

Save the APN details, (and username, password and authentication type if necessary) into the configuration file:
APN=
APN_USER=
APN_PASS=
APN_AUTH=
PROXY=yes

How to start a data connection after configuration file is in place:
Enter SIM PIN (if necessary for SIM card):
mbimcli -d /dev/cdc-wdm0 -p --enter-pin=1234

Start the mbim data connection with command bellow, if successful it will print "Network started successfully"
mbim-network /dev/cdc-wdm0 start

You can now execute the mbim-set-ip script (download found bellow related to this FAQ) with sufficient system privileges:
./mbim-set-ip /dev/cdc-wdm0 wwan0

This script will collect the network interface IP configurations from the cellular module over MBIM interface using mbimcli, parse them and apply them to the network interface in Linux, this because DHCP requests are generally not supported over MBIM interfaces.

Once you have started the data connection and set the details with the mbim-set-ip script you should be able to ping the data connection:
IPv4 ping: (only supported if IPv4 address was acquired from cellular module)
ping -4 -I wwan0 8.8.8.8
ping -4 -I wwan0 google.com

IP v6 ping: (only supported if IPv6 address was acquired from cellular module)
ping -6 -I wwan0 2001:4860:4860::8888
ping -6 -I wwan0 google.com

The cellular data connection can be disconnected by commands:
Stop mbim data connection:
mbim-network /dev/cdc-wdm0 stop
Set network interface down:
ip link set wwan0 down

Other useful commands:
Query device capabilities and information (firmware & IMEI code etc.):
mbimcli -d /dev/cdc-wdm0 -p --query-device-caps

Query SIM card information:
mbimcli -d /dev/cdc-wdm0 -p --query-subscriber-ready-status

Query network registration state:
mbimcli -d /dev/cdc-wdm0 -p --query-registration-state

Query connection ip information:
mbimcli -d /dev/cdc-wdm0 -p --query-ip-configuration=0

Test setup:
Software: Ubuntu server 18.04 LTS with kernel 4.15.0-23-generic and mbimcli 1.14.2
Hardware: SIM7600E-h miniPCIe firmware LE11B08SIM7600M22 on Aaeon UP Squared host board

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.

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.

Question

How do we enable basic standalone GPS tracking with the SIMcom cellular modules that include GNSS tracking feature?

Solution

The SIM7100 series, SIM7500 series SIM7600 series and SIM7600 -H series cellular modules that include a GNSS tracker can be used to acquire current accurate location data with and active or passive GNSS antenna connected to the module.

Details of the available AT commands related to GNSS functionality are described in the AT command reference manuals under GPS section. The AT command reference manuals can be found under our product web pages under technical documentation tab.

Depending on if an GNSS antenna with or without low noise amplifier (active/passive antenna) are used, the AT+CVAUXV and AT+CVAUXS command can be used to adjust if the antenna power supply of 3 VDC should be enabled or disabled on the GNSS antenna connector.

Module configured for active GNSS antenna with 3VDC power supply enabled directly from module:
AT+CVAUXV=3050
AT+CVAUXS=1

Module configured for passive GNSS antenna and antenna voltage supply from cellular module is disabled:
AT+CVAUXS=0

A basic standalone GNSS tracking session outputting the location data on the dedicated NMEA virtual serial interface can be started with the following AT command:
AT+CGPS=1,1

Other useful commands:
(Please note that GNSS configuration parameters can only be changed when tracking is not active)

Stop ongoing GNSS tracking:
AT+CGPS=0

Clear GNSS fix related data stored in module:
AT+CGPSDEL

Set minimum accuracy threshold in meters for location fix (default value 50 meters):
AT+CGPSHOR=50

Enable autostart of GNSS tracking at module start up:
AT+CGPSAUTO=1

The latest GNSS fix can also be requested by AT command:
AT+CGPSINFO
And the output is in the form:
+CGPSINFO: [lat],[N/S],[log],[E/W],[date],[UTC time],[alt],[speed],[course]

For details on how to configure the GPS for different application and scenarios, such as using Assisted GPS, or changing output formats etc. please relate to the AT commands reference manuals for the specific SIMcom module.

Question

How to collect initial diagnostics data for Gosuncn ZTE WeLink cellular modules when requesting technical support?

Solution

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 cellular module when creating a technical support ticket via Techship.com.

Include a problem description of what exact problem is and in what precise situations it is present/occurring.

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 the cellular module found on product label:
-Model
-SKU/BOM or P/N code
(For RMA returns the IMEI number is also required)

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 log output requested from the commands bellow, can be acquired from the module by accessing one of the USB enumerated serial (COM) interfaces accepting AT commands. (In Windows this is generally found listed as a Modem interface or AT commands serial interface in the device manager and in Linux it is usually found on some of the /dev/ttyUSB* interfaces). Send the following commands to module and capture the text output and include them when creating the the technical support ticket.

Enable input command echo:
ATE1
Request general vendor, type and unique ID about module:
ATI
Enable verbose error reporting:
AT+CMEE=2
Firmware version:
AT+CGMR
Sub firmware version:
AT+ZVN
IMEI Code:
AT+CGSN
USB endpoint configuration:
AT+ZSWITCH?
AT+ZADSET?
Operational mode:
AT+CFUN?
Allowed network bands:
AT+ZBAND?
List network operator info:
AT+COPS?
Network registration status:
AT+CREG=2
AT+CREG?
AT+CEREG=2
AT+CEREG?
Signal strength:
AT+CSQ
AT+ZSRSP?
Serving network & cell information:
AT+ZCELLINFO
AT+ZCDS?

Network Selection configuration and order:
AT+ZSNT?
AT+ZSNTE?
Service domains status:
AT+ZPAS?
System info:
AT^SYSINFO

List APN details:
AT+CGDCONT?
Show APN authentication details:
AT$QCPDPP?
Attach UE to default PDP Context:
AT+CGATT=1
List PDP profiles status:
AT+CGACT?
List default bearer and data connection details:
AT+CGCONTRDP
List IP addresses:
AT+CGPADDR
Show data call and host data ECM interface status:
AT+ZECMCALL?
Show chipset temperature:
AT+ZCHIPTEMP?
List configured temperature limit:
AT+ZTEMPCTRL?

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

Question

How can we use the Linux NetworkManager and ModemManager applications that are built into many recent Linux desktop distributions (such as Ubuntu) with Sierra Wireless MC/EM74 and EM75 series cellular module to establish and set up a data connection?

Solution

When using NetworkManager and ModemManager that are pre-installed in many common Linux distributions, best compatibility can be reached when the cellular module is set to expose the MBIM interface endpoints to the host system over the USB interface. The MBIM interface driver is often automatically detected and loaded without the need to configure and add additional drivers to the kernel via rebuild.

In factory default configuration the Sierra Wireless modules do expose the QMI interfaces as well as a set of serial interfaces, this is the correct USB endpoints if the modules are used with the Sierra Wireless recommended GobiNet and GobiSerial drivers.

However if you want to use the module with MBIM interface instead, you can change the exposed USB endpoint configuration by sending the module the following AT command on the Modem serial interface (usually dev/ttyUSB2 in Linux systems):

MC74xx/EM74xx series:
AT!ENTERCND="A710"
AT#USBCOMP=1,1,100D
AT!RESET

EM75xx series:
AT!ENTERCND="A710"
AT#USBCOMP=1,3,100D
AT!RESET

(please note ModemManager can occupy and interfere on the Modem/AT serial interface so it is recommended to stop its process first)
This will configure and reset the module and when module is re-detected in the host system again, the endpoints exposed have changed and the cdc_mbim driver should have been automatically loaded for the cellular module, this can be verified with the command:
lsusb -t

By restarting ModemManager and NetworkManager or the complete host system, the Sierra Wireless cellular module should be automatically detected by both ModemManager as well as NetworkManager.

The graphical user interface in the Linux operating system can now be used to configure the PIN code and your network operators APN connection details and establish the data connection.

If you want to control NetworkManager by Linux command line, a guide and example is well documented in the following guides:

ModemManager:
https://docs.ubuntu.com/core/en/stacks/network/modem-manager/docs/configuring-cellular-connections

NetworkManager:
https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/configure-cellular-connections

Please note that DHCP clients are most often not supported for the cellular modules when MBIM interface is used, therefore this IP connection information should be collected via the ModemManager from the modules data bearer details. NetworkManager will do this automatically for you, so it is recommended to use NetworkManager together with ModemManager also when possible.

Question

How can we use the Linux NetworkManager and ModemManager applications that are built into many recent Linux desktop distributions (such as Ubuntu) with Telit LM940 cellular module?

Solution

When using NetworkManager and ModemManager that are pre-installed in many common Linux distributions, best compatibility can be reached when the Telit module is set to expose MBIM interface endpoints to the host system over the USB interface. The MBIM interface is often automatically detected and loaded without the need to configure and add additional drivers to the kernel via rebuild.

By default the Telit LM940 module is set to expose the QMI interface as well as a set of serial interfaces.
You can change this by sending the module the following AT command on the Modem serial interface:
AT#USBCFG=2
(please note ModemManager can occupy and interfere on the Modem/AT serial interface so it is recommended to stop its process first)
This will reset the module and when module is re-detected in the host system again, the endpoints exposed have changed and the cdc_mbim driver should have been automatically loaded for the cellular module, this can be verified with the command:
lsusb -t

By restarting ModemManager and NetworkManager or the complete host system, the LM940 cellular module should be automatically detected by both ModemManager as well as NetworkManager.

The graphical user interface in the Linux operating system can now be used to configure the PIN code and your network operators APN connection details and establish the data connection.

If you want to control NetworkManager by Linux command line, a guide and example is well documented in the following guides:

ModemManager:
https://docs.ubuntu.com/core/en/stacks/network/modem-manager/docs/configuring-cellular-connections

NetworkManager:
https://docs.ubuntu.com/core/en/stacks/network/network-manager/docs/configure-cellular-connections

Please note that DHCP clients are most often not supported for the cellular modules when MBIM interface is used, therefore this IP connection information should be collected via the ModemManager from the modules data bearer details. NetworkManager will do this automatically for you, so it is recommended to use NetworkManager together with ModemManager also.

Question

How to set up a simple data connection over the MBIM interface using libmbim and driver cdc_mbim in Linux?

Solution

Most 4G/LTE cellular modules implements the USB Implementers Forums Mobile Broadband Interface Model (MBIM) Interface. This because Microsoft request cellular module vendors to include the MBIM interface for good compatibility with Windows 8, 8.1, 10 and later systems. The Windows built-in connection manager also rely on MBIM interface for control of the cellular modules.

There is a open source Linux in-kernel driver supporting MBIM interface and it is called cdc_mbim. The library libmbim 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.

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

Verify that you have the Linux in-kernel cdc_mbim driver installed for the cellular modules exposed MBIM interface endpoint over USB:
lsusb -t
Can look e.g. like this:
...
|__ Port 1: Dev 12, If 12, Class=Communications, Driver=cdc_mbim, 480M
...
|__ Port 1: Dev 12, If 13, Class=CDC Data, Driver=cdc_mbim, 480M
...

Using libmbim with the command line interface mbimcli:
List all available options for mbimcli:
mbimcli --help-all

Check version
mbimcli --version

The cellular modules mbim interface is usually named cdc-wdm* among the devices. For mbimcli this is defined by --device=/dev/cdc-wdm0 parameter. You should also use the proxy function to enable parallel commands to be sent to module even if the interface already is in use by a data connection. This is done by including --device-open-proxy or -p in every mbimcli requst to module.
Command example to query device capabilities and information (firmware & IMEI code etc.):
mbimcli --device=/dev/cdc-wdm0 --device-open-proxy --query-device-caps

The libmbim tool: mbim-network can be used to establish a simple data connection.
First create a config file containing your network operators APN details. Save it in the default location where mbim-network searches for the file: /etc/mbim-network.conf . The parameter --profile=[PATH] can be used to alter this path when executing mbim-network.

Save the APN details, (and username, password and authentication type if necessary) into the configuration file /etc/mbim-network.conf:
APN=internet
APN_USER=
APN_PASS=
APN_AUTH=
PROXY=yes

If the APN requires a username and password then it is also required to fill in the APN_AUTH protocol type with either PAP, CHAP or MSCHAPV2.

How to start a data connection after configuration file is in place:
Enter SIM PIN (if necessary for SIM card):
mbimcli -d /dev/cdc-wdm0 -p --enter-pin=1234

Start the mbim data connection with command bellow, if successful it will print "Network started successfully"
mbim-network /dev/cdc-wdm0 start

You can now execute the mbim-set-ip script (download found bellow related to this FAQ) with sufficient system privileges:
./mbim-set-ip /dev/cdc-wdm0 wwan0

This script will collect the network interface IP configurations from the cellular module over MBIM interface using mbimcli, parse them and apply them to the network interface in Linux, this because DHCP requests are generally not supported over MBIM interfaces.

Once you have started the data connection and set the details with the mbim-set-ip script you should be able to ping the data connection:
IPv4 ping: (only supported if IPv4 address was acquired from cellular module)
ping -4 -I wwan0 8.8.8.8
ping -4 -I wwan0 google.com

IP v6 ping: (only supported if IPv6 address was acquired from cellular module)
ping -6 -I wwan0 2001:4860:4860::8888
ping -6 -I wwan0 google.com

The cellular data connection can be disconnected by commands:
Stop mbim data connection:
mbim-network /dev/cdc-wdm0 stop
Set network interface down:
ip link set wwan0 down

Other useful commands:
Query device capabilities and information (firmware & IMEI code etc.):
mbimcli -d /dev/cdc-wdm0 -p --query-device-caps

Query SIM card information:
mbimcli -d /dev/cdc-wdm0 -p --query-subscriber-ready-status

Query network registration state:
mbimcli -d /dev/cdc-wdm0 -p --query-registration-state

Query connection ip information:
mbimcli -d /dev/cdc-wdm0 -p --query-ip-configuration=0

Question

How to set up a simple data connection over Qualcomm QMI interface using libqmi and 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.

First install the libqmi Linux library 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 device interface are usually named cdc-wdm* e.g.:
qmicli --device=/dev/cdc-wdm0

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

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

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

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

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

The libqmi tool: qmi-network can be used to establish a simple connection, it will automatically also verify that the IP framing data mode is correctly matched between host and module (Raw-IP vs. 802.3 IP framing).

First create a config file containing your network operators APN detail and its username and password. Save it e.g. in the default location where qmi-network searches for the file: /etc/qmi-network.conf .
The parameter --profile=[PATH] can be used to alter this path when executing qmi-network.

Save the APN details, (and username and password if necessary) into the configuration file e.g. like bellow:
APN=internet
APN_USER=username APN_PASS=password

Once the APN information is set up, you can now start the network connection with the command:
qmi-network /dev/cdc-wdm0 start

The name of the related network interface in the Linux system can be acquired with the command:
qmicli --device=/dev/cdc-wdm0 --get-wwan-iface

Once "Network started successfully" 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, used by most recent cellular modules, udhcpc however support this.
udhcpc -q -f -i wwan0

The IP information from cellular network can also be set manually by user, the correct addresses can then be acquired from cellular module with the command:
qmicli --device=/dev/cdc-wdm0 --wds-get-current-settings

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

To bring down and stop the cellular network connection, please use the stop command bellow:
qmi-network /dev/cdc-wdm0 stop

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.

Question

How to collect initial diagnostics data and logs for Telit LN940 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 Telit 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 required also)

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 module firmware can be acquired by accessing one of the USB enumerated serial (COM) interfaces accepting AT commands. (In Windows this is generally modem devices or AT commands serial interfaces). Send the following commands to module and capture the text output and include them when creating the the technical support ticket.

Test AT command:
AT
Enable command echo:
ATE1
Module make, type, ID and revision:
ATI
Verbose error reporting:
AT+CMEE=2
Module model:
AT+CGMM
Firmware version:
AT+CGMR
AT+SKUID
IMEI Code:
AT+CGSN
USB PID/endpoint configuration:
AT+USBSWITCH?
USB type:
AT^USBTYPE?
Operational mode:
AT+CFUN?
Check SIM card status:
AT$QCSIMSTAT?
Check SIM PIN status:
AT+CPIN?
Access techniques and configuration:
AT+WS46?
AT$QCBANDPREF?
AT^SYSCONFIG?
AT^SYSINFO
AT$QCNSP?
AT^SLMODE?
AT^SLBAND?
AT^CA_ENABLE?
AT^BAND_PRI?
List network operator info:
AT+COPS?
Network registration status:
AT+CREG=2
AT+CREG?
AT+CGREG?
AT+CEREG?
Signal strength:
AT+CSQ
AT$QCSQ
AT$QCRPW
SIM app status:
AT$QCSIMAPP=?
Last serving cell network information:
AT$QCRSRP?
AT$QCRSRQ?
Debug information:
AT^DEBUG?
AT^RFSTS?
AT^ABAND?
AT^CA_INFO?
List APN details:
AT+CGDCONT?
AT$QCPDPP?
AT$QCAPNE?
AT$QCPDPCFGEXT?
AT$QCPRFCRT?
Attach UE to default PDP Context:
AT+CGATT=1
List default data connection details:
AT+CGCONTRDP
List IP addresses:
AT+CGPADDR

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