TECHSHIP IS A GLOBAL SUPPLIER OF WIRELESS COMPONENTS

Register
FAQs /
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/)

Please relate to the FAQ bellow regarding how to set the cellular module into correct USB mode for usage with MBIM mode:
How to change USB composition mode to MBIM in cellular module, used by Windows 8 and 10 systems for data connectivity?

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

IPv6 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

Recently added

Question

How to collect initial diagnostics data for Sierra Wireless EM919x and EM7690 series cellular modules when requesting 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 module when creating a technical support ticket.

Please provide a problem description of what exact problem is and in what precise situations it is present.

Describe the host system:
-Hardware (system board, peripherals...)
-Operating system and detailed versions (E.g. Windows, Linux dist, 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 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 /dev/ttyUSB2 interface). Send the following commands to the module and capture the text output and include them when creating the the technical support ticket.

Sierra Wireless :
AT
ATE1
ATI
AT!ENTERCND="A710"
AT!PRIID?
AT!IMPREF?
AT!IMAGE?
AT+CFUN?
AT!UIMS?
AT+CPIN?
AT+CREG?
AT+CGREG?
AT+CEREG?
AT+COPS?
AT!GSTATUS?
AT+CGDCONT?
AT$QCPDPP?
AT+CGATT?
AT+CGACT?
AT+CGCONTRDP
AT+CGPADDR
AT!BAND?
AT!BAND=?
AT!LTEINFO?
AT!LTECA?
AT!RXDEN?
AT!PCINFO?
AT!USBCOMP?
AT!USBCOMP=?
AT!SELRAT?
AT!SELRAT=?
AT!USBSPEED?
AT!PCOFFEN?
AT!CUSTOM?
AT!CUSTOM=?
AT!PCTEMP?
AT!PCVOLT?
AT!PCVOLTLIMITS?
AT!HWID?
AT!ERR
AT!BCFWUPDATESTATUS
AT!TMSTATUS?
AT!RATCA?

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

Question

How do I set USB-interface modes on my Sierra Wireless module?

Solution

Sierra Wireless modules can expose different USB interfaces, like MBIM, MODEM, NMEA or RMNET. The different interfaces can be combined or used individually, depending on the specific need for your project.
Here is how to set the different USB interface configurations. (In this example we use a Sierra Wireless EM7421, but it will be similar for many other Sierra Wireless modules.)

Make sure you get an OK after every AT command sent.
We start by typing:
AT
To be able to view what we just sent to the module we type:
ATE1
Since this feature is password protected we need to type:
AT!ENTERCND=”A710”
To see what USB interface we are currently using, just type AT!USBCOMP? and you should receive something like this:

Config Index: 1
Config Type: 3 (Generic)
Interface bitmask: 0000010D (diag,nmea,modem,rmnet0)
OK

Config index is what the type applies to and should be set to 1.
The config type means what USB composition is used. For this module USBIF-MBIM (1), PCIE USBIF (2), Legacy Generic (3) or RNDIS (4) are available.
Interface bitmask is the part where we see what USB interface our module is set to.

Now, to see what our USB interface options are we need to type:
AT!USBCOMP=?
Here we can see that for this module we have the following options:
DIAG - 0x00000001
NMEA - 0x00000004
MODEM - 0x00000008
RMNET0 - 0x00000100
MBIM - 0x00001000
These values are hexadecimal. So, for an example, if we wanted to activate all the options (DIAG, NMEA, MODEM and MBIM) we just add these values together.
If we open the Windows Calculator in Programmer mode (and make sure you have “HEX” selected!) and add all the values together like this 1 + 4+ 8 +1000, we will get 100D. (Please note, RMNET0 and MBIM cannot be used simultaneous for this module. Refer to the manual of your specific module to when setting up the USB interface.)
If we then send the following AT command to the module, we will set it to DIAG, NMEA, MODEM and MBIM:
AT!USBCOMP=1,3,100D

Again, type AT!USBCOMP? to confirm we have the new settings selected, it should look like this:

Config Index: 1
Config Type: 3 (Generic)
Interface bitmask: 0000100D (diag,nmea,modem,mbim)
OK

For further information please take a look at the AT command user guide available on the product's specific page under "technical documentation", which is available for download once logged in.

Question


How do I select specific bands on my Sierra Wireless module?

Solution

The AT command AT!BAND can be used to select what specific GSM and LTE bands that you want to be active on your module.

If you are experiencing poor DL or UL speeds, one solution may be to only select the bands that you know are available, which can increase the transfer speeds.

(Please note that the following examples are when using a Sierra Wireless EM7421)

First, see that you get an “OK” with command:
AT
Then, to make sure you can see what command has been sent, type:
ATE1

Since what we are about to do is password protected, we need to type:
AT!ENTERCND="A710"

When entering AT!BAND? it will return a reply looking like (for example):
AT!BAND?
Index, Name, GW Band Mask L Band Mask 1 TDS Band Mask L Band Mask 2 L Band Mask 3 L Band Mask 4
00, All Bands 000200000C400000 000007A0880800C5 0000000000000000 0000000000000000 0000000000000000 0000000000000000
OK


The "00" is referring to the selected preset, "All Bands" to the preset name, "000200000C400000" to GSM bands and "000007A0880800C5" to selected LTE bands in hexadecimal.

To get information on all available bands, we need to type:
AT!BAND=?

Starting at the GSM band (at chapter "AT!BAND - Select/return frequency band set" in the AT command reference manual) we can see that 000200000C400000 corresponds to “0002000000000000 - B8 (900) + 0000000008000000 - B6 (800) + 0000000004000000 - B5 (850) + 0000000000400000 - B1 (2100) = 000200000C400000 (All GSM Bands)”

Now for LTE, which is probably what is a little tricky to understand. Let’s start the Windows Calculator and change it to Programmer mode. If you copy the "000007A0880800C5" into the calculator window it should convert it to binary.
HEX: 0000 07A0 8808 00C5
BIN: 0111 1010 0000 1000 1000 0000 1000 0000 0000 1100 0101

If you look at the line of BIN above you can see what bands are active (1) and which are not (0). Looking from right to left, the first bit corresponds to B1, second bit to B2, third bit B3, and so on…

HEX: 0000 07A0 8808 00C5
BIN: 0111 1010 0000 1000 1000 0000 1000 0000 0000 1100 0101
Selected bands: B1+B3+B7+B8+B20+B28+B32+B38+B40+B41+B42+B43

So if I, for example, only want the GSM bands "GSM 900MHz + GSM 850MHz", and LTE bands "B3, B4, B7, B28" we enter the following:
AT!BAND= 11,"Custom User Preset",0002000004000000,000000000800004C

Now we have created a new preset slot “11”, a name for the preset “Custom User Preset” and selected bands for GSM “GSM 900MHz + GSM 850MHz” and also selected bands for LTE "B3, B4, B7, B28", see explanation below:

Bands: B3, B4, B7, B28
Binary: 1000 0000 0000 0000 0000 0100 1100
Hexadecimal: 800 004C

Now we want to make sure our newly created preset is selected, so we type:
AT!BAND=11

And finally to check that we have selected the preset we again type AT!BAND? and should get the following response:
Index, Name, GW Band Mask L Band Mask 1 TDS Band Mask L Band Mask 2 L Band Mask 3 L Band Mask 4
11, Custom User Preset 0002000004000000 000000000800004C 0000000000000000 0000000000000000 0000000000000000 000000000000000
OK

For further information please take a look at the AT command user guide available on the product's specific page under "technical documentation", which is available for download once logged in.

Question

How do we detect an inserted SIM card using the FN980 module?

Solution

Please note that we do not recommend generic adapters for 5G modules as there might be pin conflicts. This can, in a worst case scenario, damage the module and/or the connected USB port. Therefore, always ensure that the adapter is pin compatible with the 5G module.

Firstly, determine which SIM slot you are using. The FN980 is equipped with 2 SIM slots, one active and one standby. The SIM slot that you want to detect the SIM card on is selected by the following command:

AT#SIMDET=y

Where y is either 0 or 1. Here, 0 represents SIM slot 1 and 1 represents SIM slot 2. Please note that further configuration is needed in order to use SIM slot 2. Therefore, it is recommended to use SIM slot 1. To use SIM slot 2, please refer to the necessary commands in the AT Command reference guide.

One common issue when trying to detect an inserted SIM card is that the adapter with the SIM card holder doesn't support the SIM Hot-Swap feature. This feature can be turned off in order to detect the SIM, if this is the underlaying issue. The Hot-Swap feature can be disabled by using the following command:

AT#HSEN=0,y

Where y is either 0 or 1. Here, 0 represents SIM slot 1 and 1 represents SIM slot 2.

Another common issue is the polarity of the SIMIN pin. The polarity of this pin is dependent on the SIM slot manufacturer and sometimes differ depending on the SIM card size the slot is designed for. Usually, an inserted SIM card sets the SIMIN pin LOW when the SIM card size is normal. Similarly, an inserted SIM card usually sets the SIMIN pin HIGH when the SIM card size is micro. However, there are some exceptions so is is usually best to test both. The polarity of the SIMIN pin can be changed with the following command:

AT#SIMINCFG=x,y

Where y is either 1 or 2. Here, 1 represents SIM slot 1 and 2 represents SIM slot 2.
Similarly, x is either 0 or 1. 0 means that the SIMIN pin should be LOW when a SIM card is inserted and 1 means that the SIMIN pin should be HIGH when a SIM card is inserted.

A good way to determine if the module correctly detect the SIM card it to request f the (I)nternational (M)obile (S)ubscriber (I)dentity stored in the SIM card. The IMSI will only be reported if the module can read the SIM card which makes it a great method to determine if the module can read the SIM card. The IMSI can be requested by the following command:

AT+CIMI

Here, an error means that the SIM card can't be accessed and a string of numbers means that the SIM card is correctly read by the module.

Make sure that the module is power cycled between the different attempts and check if SIM card is detected by requesting the IMSI for each attempt!

Please refer to the FN980 AT Command Reference Guide for more information about these commands. This document can be found on the product's page, under the Technical Documentation tab, or by accessing the following link: https://techship.com/downloads/telit-fn980-family-at-commands-guide

Question

How to collect initial diagnostics data and logs for Alcatel USB dongles, 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 host system and logs from the related Alcatel USB dongles when creating a technical support ticket.

Detailed problem description and in what situations it present or can be reproduced.

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
Verbose error reporting:
AT+CMEE=2
Last error report:
AT+CEER
Firmware version:
AT+GMR
IMEI Code:
AT+CGSN
USB endpoint configuration:
AT+USBMODE?
List current configuration:
AT&V
Operational mode:
AT+CFUN?
Pin status:
AT+CPIN?
Request extended system info:
AT^SYSINFOEX
AT^SYSCFGEX?
Preferred PLMN list:
AT+CPOL?
Request resident Band:
AT+CNBP?
List network operator info:
AT+COPS?
Network registration status:
AT+CREG?
Network EPS registration status:
AT+CEREG?
Signal strength:
AT+CSQ
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?

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

Question

How to establish a data connection with Sierra Wireless EM9190, EM9191 and EM7690 in Linux using MBIM network interface over USB

Solution

5G technology introduces new requirements on the interface links between the host systems and cellular modules.
The Linux community continuously commit necessary changes to the kernel drivers and interface management tools to improve the compatibility and performance.
Because of this, it is important that you base your Linux system builds on up-to-date kernel versions, avoiding many problems already solved.

Ensure that you have up-to-date firmware version in the cellular module. Check the dedicated product page here at Techship and the firmware downloads tab or open a technical support ticket.

Early devices and engineering samples came with a older baseline firmware version and typically need to be updated in a Windows system.

This guide describes how to establish a MBIM data connection in Linux using libmbim library and mbimcli command line interface for Sierra Wireless EM919x series modules when connected over USB to the host system.
The cdc_mbim kernel driver module and libmbim library is used.

Ensure that the cdc_mbim network kernel driver and qcserial usb-serial driver is properly loaded to the module interfaces, refer to Sierra Wireless Mobile broadband package for Linux for more details. Binary version and guide linked below.
It can be checked e.g. through dmesg, usb-devices or lsusb -t commands.

usb-devices
T: Bus=02 Lev=01 Prnt=01 Port=03 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0
D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1
P: Vendor=1199 ProdID=90d3 Rev=00.06
S: Manufacturer=Sierra Wireless, Incorporated
S: Product=Sierra Wireless EM9190
S: SerialNumber=
C: #Ifs= 5 Cfg#= 1 Atr=a0 MxPwr=896mA
I: If#=0x0 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
I: If#=0x1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=techship_serial
I: If#=0x4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=techship_serial
I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=(none)

Should you not have the qcserial drivers loaded correctly, you can try compile our modified option usb-serial kernel driver module techship_serial from git link below and load them into your system build, it is however always recommended that you use the vendor provided or recommended drivers.

See the git readme files for details on pre-requirements, how to clone, compile and use the make file options to install the drivers.

They are available in the following git repository:
https://bitbucket.org/storjor/techship_linux_drivers/

Refer to the mbimcli manual pages for details on the control commands that can be supported by the libmbim library and mbimcli command line interface. Note however that not all mbim commands are supported by all cellular module vendors and might be dependant on chipset families, firmware versions and additional vendor specific command etc.
https://www.freedesktop.org/wiki/Software/libmbim/

Example of how to set up a cellular data connection:
Note! A working MBIM network interface data connection requires that the MBIM control message tunnel is kept open at all time also.
To keep it open, start a new session with a mbimcli command, and keep the session open after the command execution by the --no-close attribute.
The Session ID / Transaction ID number (TRID) that is opened with the mbimcli command will be given back in the reply, save it for use in the next mbimcli command.
If the session ID linked to the network data connection is closed, then the data connection on the network interface will also be closed.

Check cellular module device version and capability details:
mbimcli -p -d /dev/cdc-wdm0 --query-device-caps --no-close

Check cellular RF radio status:
mbimcli -p -d /dev/cdc-wdm0 --query-radio-state --no-close
If not enabled, set it active:
mbimcli -p -d /dev/cdc-wdm0 --set-radio-state=on --no-close --no-open=##

Check SIM card subscriber state:
mbimcli -p -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close --no-open=##
If pin is needed, enter it using --enter-pin command:
mbimcli -p -d /dev/cdc-wdm0 --enter-pin=#### --no-close --no-open=##

Check cellular network registration state:
mbimcli -p -d /dev/cdc-wdm0 --query-registration-state --no-close --no-open=##

If not registered already, try using register automatic:
mbimcli -p -d /dev/cdc-wdm0 --register-automatic --no-close --no-open=##

Check the packet data service state:
mbimcli -p -d /dev/cdc-wdm0 --query-packet-service-state --no-close --no-open=##

If packet service state is not attached, use attach command:
mbimcli -p -d /dev/cdc-wdm0 --attach-packet-service --no-close --no-open=##

To to start a data connection use the connect command, with the desired parameters for PDP APN, IP type, auth details, etc.
mbimcli -p -d /dev/cdc-wdm0 --connect=apn='data.tre.se',ip-type='ipv4v6' --no-close --no-open=##

Bring down the MBIM network interface:
ip link set dev wwan0 down

Clear any existing IP address and routes:
ip -4 -6 address flush dev wwan0
ip -4 -6 route flush dev wwan0

The mbimcli connect command returns the IP, gateway, DNS, and MTU details for the data connection if established successfully.
Enter the IPv4 details to the network interface in the Linux host system, e.g.:
ip address add 2.67.32.120/28 dev wwan0
ip link set mtu 1500 dev wwan0

Enter the IPv6 details to the network interface in the Linux host system, e.g.:
ip -6 addr add 2a02:aa1:1019:50b6:a5b0:ade:8531:b178/64 dev wwan0
ip -6 link set mtu 1500 dev wwan0

Enable the network interface:
ip link set dev wwan0 up

Apply appropriate network interface routing suitable for your use-case, e.g:
ip route add default dev
ip -6 route add default dev wwan0

You should now have a working cellular network data connection.

Test it e.g. by sending ping requests over the interface:
ping -I wwan0 8.8.8.8 -c 4
PING 8.8.8.8 (8.8.8.8) from 2.67.32.120 wwan0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=38.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=36.4 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=43.5 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=41.5 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 36.374/39.975/43.500/2.728 ms

ping -6 -I wwan0 2600:: -c 4
PING 2600::(2600::) from 2a02:aa1:1019:50b6:e59e:4d4a:e778:f24e wwan0: 56 data bytes
64 bytes from 2600::: icmp_seq=1 ttl=52 time=156 ms
64 bytes from 2600::: icmp_seq=2 ttl=52 time=171 ms
64 bytes from 2600::: icmp_seq=3 ttl=52 time=169 ms
64 bytes from 2600::: icmp_seq=4 ttl=52 time=167 ms

--- 2600:: ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 156.153/165.508/170.577/5.576 ms

To stop the cellular data network connection use mbimcli disconnect command.
Use the Session ID from the previous mbimcli command reply in --no-open=## attribute, but do not include the --no-close attribute, doing so closes the session afterwards.
mbimcli -p -d /dev/cdc-wdm0 --disconnect --no-open=##

Bring down the interface:
ip link set dev wwan0 down

Clear any remaining IP address and routes:
ip -4 -6 address flush dev wwan0
ip -4 -6 route flush dev wwan0

It is up to the host application to manage and poll the connection state of the cellular module.
E.g. if the connection is lost temporarily due to no network coverage in the current location, the host application should tear down and re-establish the data connection when cellular module is registered in network again.

If the data connection fails for some reason several times, ensure that the connect retry attempts do not take place continuously without some extended delays in-between.
Depending on the cellular network operator, they can enforce lock-out on your subscription/device for certain time periods in order to protect the network from being flooded by requests.

Question

Example on how to establish a data connection with Telit FN980 series in Linux using MBIM mode over USB interface

Solution

Example on how to establish a data connection with Telit FN980 series in Linux using MBIM network interface over USB

5G technology introduces new requirements on the interface links between the host systems and cellular modules.
The Linux community continuously commit necessary changes to the kernel drivers and interface management tools to improve the compatibility and performance.
Because of this, it is important that you base your Linux system builds on up-to-date kernel versions, avoiding many problems already solved.

Ensure that you have up-to-date firmware version in the cellular module. Check the dedicated product page here at Techship and the firmware downloads tab or open a technical support ticket.

Early devices and engineering samples came with a older baseline firmware version and typically need to be updated in a Windows system.

This guide describes how to establish a MBIM data connection in Linux using libmbim library and mbimcli command line interface for Telit FN980 series modules when connected over USB to the host system.
The cdc_mbim kernel driver module and libmbim library is used.

Ensure that you have the Telit module in MBIM usb mode and cdc_mbim network kernel driver and option usb-serial driver properly loaded to the module interfaces.
It can be checked e.g. through dmesg, usb-devices or lsusb -t commands.

usb-devices
T: Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 10 Spd=5000 MxCh= 0
D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1
P: Vendor=1bc7 ProdID=1051 Rev=04.14
S: Manufacturer=Telit Wireless Solutions
S: Product=FN980m
S: SerialNumber=
C: #Ifs= 8 Cfg#= 1 Atr=a0 MxPwr=896mA
I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=techship_serial
I: If#=0x1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs
I: If#=0x2 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
I: If#=0x3 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=techship_serial
I: If#=0x5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=techship_serial
I: If#=0x6 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=techship_serial
I: If#=0x7 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00 Driver=techship_serial

If the option serial drivers are not correctly loaded in your current system build and kernel version, please refer to Telit Linux integration guide for details on the integration.
You can try compile our modified option kernel driver module techship_serial from git link below and load them into your system build instead also.
See the git readme files for details on pre-requirements, how to clone, compile and use the make file options to install the drivers.

They are available in the following git repository: https://bitbucket.org/storjor/techship_linux_drivers/

Refer to the mbimcli manual pages for details on the control commands that can be supported by the libmbim library and mbimcli command line interface. Note however that not all mbim commands are supported by all cellular module vendors and might be dependant on chipset families, firmware versions and additional vendor specific command etc.
https://www.freedesktop.org/wiki/Software/libmbim/

Example of how to set up a cellular data connection:
Note! A working MBIM network interface data connection requires that the MBIM control message tunnel is kept open at all time also.
To keep it open, start a new session with a mbimcli command, and keep the session open after the command execution by the --no-close attribute.
The Session ID / Transaction ID number (TRID) that is opened with the mbimcli command will be given back in the reply, save it for use in the next mbimcli command.
If the session ID linked to the network data connection is closed, then the data connection on the network interface will also be closed.

Check device details and capabilities:
mbimcli -p -d /dev/cdc-wdm0 --query-device-caps --no-close

Check cellular RF radio status:
mbimcli -p -d /dev/cdc-wdm0 --query-radio-state --no-close --no-open=##
If not enabled, set it active:
mbimcli -p -d /dev/cdc-wdm0 --set-radio-state=on --no-close --no-open=##

Check SIM card subscriber state:
mbimcli -p -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close --no-open=##
If pin is needed, enter it using --enter-pin command:
mbimcli -p -d /dev/cdc-wdm0 --enter-pin=#### --no-close --no-open=##

Check cellular network registration state:
mbimcli -p -d /dev/cdc-wdm0 --query-registration-state --no-close --no-open=##

If not registered already, try using register automatic:
mbimcli -p -d /dev/cdc-wdm0 --register-automatic --no-close --no-open=##

Check the packet data service state:
mbimcli -p -d /dev/cdc-wdm0 --query-packet-service-state --no-close --no-open=##

If packet service state is not attached, use attach command:
mbimcli -p -d /dev/cdc-wdm0 --attach-packet-service --no-close --no-open=##

To to start a data connection use the connect command, with the desired parameters for PDP APN, IP type, auth details, etc.
mbimcli -p -d /dev/cdc-wdm0 --connect=apn='data.tre.se',ip-type='ipv4v6' --no-close --no-open=##

Bring down the MBIM network interface:
ip link set dev wwan0 down

Clear any existing IP address and routes:
ip -4 -6 address flush dev wwan0
ip -4 -6 route flush dev wwan0

The mbimcli connect command returns the IP, gateway, DNS, and MTU details for the data connection if established successfully.
Enter the IPv4 details to the network interface in the Linux host system, e.g.:
ip address add 2.68.254.241/30 dev wwan0
ip link set mtu 1500 dev wwan0

Enter the IPv6 details to the network interface in the Linux host system, e.g.:
ip -6 addr add 2a02:aa1:1011:b001:5fc:6a67:296c:8852/64 dev wwan0
ip -6 link set mtu 1500 dev wwan0

Enable the network interface:
ip link set dev wwan0 up

Apply appropriate network interface routing suitable for your use-case, e.g:
ip route add default dev
ip -6 route add default dev wwan0

You should now have a working cellular network data connection.

Test it e.g. by sending ping requests over the interface:
ping -I wwan0 8.8.8.8 -c 4
PING 8.8.8.8 (8.8.8.8) from 2.70.103.209 wwan0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=224 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=42.7 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=119 time=30.7 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=119 time=38.4 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 30.657/84.031/224.373/81.140 ms

ping -6 -I wwan0 2600:: -c 4
PING 2600::(2600::) from 2a02:aa1:1021:b9d1:8847:afd4:e35a:aa29 wwan0: 56 data bytes
64 bytes from 2600::: icmp_seq=1 ttl=52 time=173 ms
64 bytes from 2600::: icmp_seq=2 ttl=52 time=153 ms
64 bytes from 2600::: icmp_seq=3 ttl=52 time=152 ms
64 bytes from 2600::: icmp_seq=4 ttl=52 time=208 ms

--- 2600:: ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 152.108/171.523/208.073/22.623 ms

To stop the cellular data network connection use mbimcli disconnect command.
Use the Session ID from the previous mbimcli command reply in --no-open=## attribute, but do not include the --no-close attribute, doing so closes the session afterwards.
mbimcli -p -d /dev/cdc-wdm0 --disconnect --no-open=##

Bring down the interface:
ip link set dev wwan0 down

Clear any remaining IP address and routes:
ip -4 -6 address flush dev wwan0
ip -4 -6 route flush dev wwan0

It is up to the host application to manage and poll the connection state of the cellular module.
E.g. if the connection is lost temporarily due to no network coverage in the current location, the host application should tear down and re-establish the data connection when cellular module is registered in network again.

If the data connection fails for some reason several times, ensure that the connect retry attempts do not take place continuously without some extended delays in-between.
Depending on the cellular network operator, they can enforce lock-out on your subscription/device for certain time periods in order to protect the network from being flooded by requests.

Question

Example on how to establish a data connection with Simcom SIM8202x-M2 series in Linux using MBIM network interface over USB

Solution

Example on how to establish a data connection with Simcom SIM8202x-M2 series in Linux using MBIM network interface over USB

5G technology introduces new requirements on the interface links between the host systems and cellular modules.
The Linux community continuously commit necessary changes to the kernel drivers and interface management tools to improve the compatibility and performance.
Because of this, it is important that you base your Linux system builds on up-to-date kernel versions, avoiding many problems already solved.

Ensure that you have up-to-date firmware version in the cellular module. Check the dedicated product page here at Techship and the firmware downloads tab or open a technical support ticket.

Early devices and engineering samples came with a older baseline firmware version and typically need to be updated in a Windows system.

This guide describes how to establish a MBIM data connection in Linux using libmbim library and mbimcli command line interface for SIM8202x-M2 series modules when connected over USB to the host system.
The cdc_mbim kernel driver module and libmbim library is used.

Ensure that you have the Simcom module in MBIM usb mode and cdc_mbim network kernel driver and option usb-serial driver properly loaded to the module interfaces.
It can be checked e.g. through dmesg, usb-devices or lsusb -t commands.

usb-devices
T: Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 3 Spd=5000 MxCh= 0
D: Ver= 3.20 Cls=ef(misc ) Sub=02 Prot=01 MxPS= 9 #Cfgs= 1
P: Vendor=1e0e ProdID=901e Rev=04.14
S: Manufacturer=QCOM
S: Product=SDXPRAIRIE-MTP _SN:
S: SerialNumber=
C: #Ifs= 6 Cfg#= 1 Atr=a0 MxPwr=896mA
I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=techship_serial
I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=techship_serial
I: If#=0x2 Alt= 0 #EPs= 1 Cls=02(commc) Sub=0e Prot=00 Driver=cdc_mbim
I: If#=0x3 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=02 Driver=cdc_mbim
I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=techship_serial
I: If#=0x5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs

If the option serial drivers are not correctly loaded in your current system build and kernel version, you can try compile our modified option kernel driver module techship_serial from git link below and load them into your system build.
See the git readme files for details on pre-requirements, how to clone, compile and use the make file options to install the drivers.

They are available in the following git repository: https://bitbucket.org/storjor/techship_linux_drivers/

Refer to the mbimcli manual pages for details on the control commands that can be supported by the libmbim library and mbimcli command line interface. Note however that not all mbim commands are supported by all cellular module vendors and might be dependant on chipset families, firmware versions and additional vendor specific command etc.
https://www.freedesktop.org/wiki/Software/libmbim/

Example of how to set up a cellular data connection:
Note! A working MBIM network interface data connection requires that the MBIM control message tunnel is kept open at all time also.
To keep it open, start a new session with a mbimcli command, and keep the session open after the command execution by the --no-close attribute.
The Session ID / Transaction ID number (TRID) that is opened with the mbimcli command will be given back in the reply, save it for use in the next mbimcli command.
If the session ID linked to the network data connection is closed, then the data connection on the network interface will also be closed.

Check cellular RF radio status:
mbimcli -p -d /dev/cdc-wdm0 --query-radio-state --no-close
If not enabled, set it active:
mbimcli -p -d /dev/cdc-wdm0 --set-radio-state=on --no-close --no-open=##

Check SIM card subscriber state:
mbimcli -p -d /dev/cdc-wdm0 --query-subscriber-ready-status --no-close --no-open=##
If pin is needed, enter it using --enter-pin command:
mbimcli -p -d /dev/cdc-wdm0 --enter-pin=#### --no-close --no-open=##

Check cellular network registration state:
mbimcli -p -d /dev/cdc-wdm0 --query-registration-state --no-close --no-open=##

If not registered already, try using register automatic:
mbimcli -p -d /dev/cdc-wdm0 --register-automatic --no-close --no-open=##

Check the packet data service state:
mbimcli -p -d /dev/cdc-wdm0 --query-packet-service-state --no-close --no-open=##

If packet service state is not attached, use attach command:
mbimcli -p -d /dev/cdc-wdm0 --attach-packet-service --no-close --no-open=##

To to start a data connection use the connect command, with the desired parameters for PDP APN, IP type, auth details, etc.
mbimcli -p -d /dev/cdc-wdm0 --connect=apn='data.tre.se',ip-type='ipv4v6' --no-close --no-open=##

Bring down the MBIM network interface:
ip link set dev wwan0 down

Clear any existing IP address and routes:
ip -4 -6 address flush dev wwan0
ip -4 -6 route flush dev wwan0

The mbimcli connect command returns the IP, gateway, DNS, and MTU details for the data connection if established successfully.
Enter the IPv4 details to the network interface in the Linux host system, e.g.:
ip address add 2.70.103.209/30 dev wwan0
ip link set mtu 1500 dev wwan0

Enter the IPv6 details to the network interface in the Linux host system, e.g.:
ip -6 addr add 2a02:aa1:1021:b9d1:4fb:e1c9:589c:d53f/64 dev wwan0
ip -6 link set mtu 1500 dev wwan0

Enable the network interface:
ip link set dev wwan0 up

Apply appropriate network interface routing suitable for your use-case, e.g:
ip route add default dev
ip -6 route add default dev wwan0

You should now have a working cellular network data connection.

Test it e.g. by sending ping requests over the interface:
ping -I wwan0 8.8.8.8 -c 4
PING 8.8.8.8 (8.8.8.8) from 2.70.103.209 wwan0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=119 time=224 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=119 time=42.7 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=119 time=30.7 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=119 time=38.4 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3006ms
rtt min/avg/max/mdev = 30.657/84.031/224.373/81.140 ms

ping -6 -I wwan0 2600:: -c 4
PING 2600::(2600::) from 2a02:aa1:1021:b9d1:8847:afd4:e35a:aa29 wwan0: 56 data bytes
64 bytes from 2600::: icmp_seq=1 ttl=52 time=173 ms
64 bytes from 2600::: icmp_seq=2 ttl=52 time=153 ms
64 bytes from 2600::: icmp_seq=3 ttl=52 time=152 ms
64 bytes from 2600::: icmp_seq=4 ttl=52 time=208 ms

--- 2600:: ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 152.108/171.523/208.073/22.623 ms

To stop the cellular data network connection use mbimcli disconnect command.
Use the Session ID from the previous mbimcli command reply in --no-open=## attribute, but do not include the --no-close attribute, doing so closes the session afterwards.
mbimcli -p -d /dev/cdc-wdm0 --disconnect --no-open=##


Bring down the interface:
ip link set dev wwan0 down

Clear any remaining IP address and routes:
ip -4 -6 address flush dev wwan0
ip -4 -6 route flush dev wwan0

It is up to the host application to manage and poll the connection state of the cellular module.
E.g. if the connection is lost temporarily due to no network coverage in the current location, the host application should tear down and re-establish the data connection when cellular module is registered in network again.

If the data connection fails for some reason several times, ensure that the connect retry attempts do not take place continuously without some extended delays in-between.
Depending on the cellular network operator, they can enforce lock-out on your subscription/device for certain time periods in order to protect the network from being flooded by requests.

Question

Example on how to establish a data connection with Simcom SIM8202x-M2 series in Linux using QMI Rmnet over USB interface

Solution

Example on how to establish a data connection with Simcom SIM8202x-M2 series in Linux using QMI Rmnet over USB interface

5G technology introduces new requirements on the interface links between the host systems and cellular modules.
The Linux community continuously commit necessary changes to the kernel drivers and interface management tools to improve the compatibility and performance.
Because of this, it is important that you base your Linux system builds on up-to-date kernel versions, avoiding many problems already solved.

Ensure that you have up-to-date firmware version in the cellular module. Check the dedicated product page here at Techship and the firmware downloads tab or open a technical support ticket.

Early devices and engineering samples came with a older baseline firmware version and need to be update in Windows systems.

This guide specifically only describes how to establish the QMUX data connection part of the QMI rmnet USB interface for the SIM8202x-M2 series modules.
The qmi_wwan kernel driver module and libqmi library is used.

Ensure that you have the module in QMI Rmnet usb mode and qmi_wwan network kernel driver and option usb-serial driver properly loaded to the module interfaces.
Can be checked e.g. through dmesg, usb-devices or lsusb -t commands.

usb-devices
T: Bus=02 Lev=01 Prnt=01 Port=02 Cnt=01 Dev#= 2 Spd=5000 MxCh= 0
D: Ver= 3.20 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs= 1
P: Vendor=1e0e ProdID=9001 Rev=04.14
S: Manufacturer=QCOM
S: Product=SDXPRAIRIE-MTP _SN:
S: SerialNumber=
C: #Ifs= 7 Cfg#= 1 Atr=a0 MxPwr=896mA
I: If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=30 Driver=techship_serial
I: If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=60 Driver=techship_serial
I: If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=techship_serial
I: If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=techship_serial
I: If#=0x4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=40 Driver=techship_serial
I: If#=0x5 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=50 Driver=qmi_wwan
I: If#=0x6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs

If the qmi_wwan and option drivers do not get correctly loaded in your current system build and kernel version, please refer to the manufacturer Linux integration guide.

Alternatively you can try compile our modified out-of-kernel driver module variants: techship_qmi_wwan and techship_serial and load them in your system.
See the git readme files for details on pre-requirements, how to clone, compile and use the make file options to install the drivers.

They are available in the following git repository: https://bitbucket.org/storjor/techship_linux_drivers/

Once you have drivers correctly loaded, start by disabling the related qmi_wwan network interface name:
ip link set dev wwan0 down

Ensure RAW IP configuration is enabled:
sh -c "echo 'Y' > /sys/class/net/wwan0/qmi/raw_ip"
(observe the path name including the network interface name, update to match the interface name used in your system)

Create a virtual mux interface for the qmi network interface:
sh -c "echo '1' > /sys/class/net/wwan0/qmi/add_mux"
(observe the path name including the network interface name, update to match the interface name used in your system)

Configure the data format on module side:
qmicli -p -d /dev/cdc-wdm0 --device-open-qmi --wda-set-data-format=link-layer-protocol=raw-ip,ul-protocol=qmap,dl-protocol=qmap,dl-max-datagrams=32,dl-datagram-max-size=31744,ep-type=hsusb,ep-iface-number=5

Here in-between you should perform necessary operations to the module prior to having the cellular network data connection established.
Things like SIM state and PIN code entry, module device registration in the cellular network, APN profile management etc.

Refer to the qmicli manual pages for details on the control commands that can be supported by the libqmi library and qmicli command line interface. Note however that not all qmi commands are supported by all cellular module vendors and might be dependant on chipset families, firmware versions and additional vendor specific command etc.
https://www.freedesktop.org/wiki/Software/libqmi/

Once module is ready and registered in cellular network we can proceed to configure and set up the data connection.

Bind the virtual mux network interface we created earlier to the client ID (CID) that gets opened, the CID id is given back in the reply:
qmicli -p -d /dev/cdc-wdm0 --device-open-qmi --wds-bind-mux-data-port=mux-id=1,ep-iface-number=5 --client-no-release-cid

It is important to use the --client-no-release-cid attribute here to keep the tunnel open at all time while the data connection is established.
If the client id CID linked to the network connection is closed, then the data connection on the qmux virtual network interface will also be closed.

Start the cellular network data connection in the normal way now, include the --client-no-release-cid attribute and use the already open CID ID you got back from previous command reply. E.g. like this:
qmicli -p -d /dev/cdc-wdm0 --device-open-qmi --wds-start-network=apn=data.tre.se,ip-type=4 --client-no-release-cid --client-cid=##
Store the packet data handle id from the command reply, to re-use when stopping the network data connection.

Request the cellular data connection IP details from the module and network with command:
qmicli -p -d /dev/cdc-wdm0 --device-open-qmi --wds-get-current-settings --client-no-release-cid --client-cid=##

Bring up the main QMI RMNET network interface:
ip link set dev wwan0 up

Apply the IP address to the qmux interface that you acquired through qmicli --wds-get-current-settings above, e.g.:
ip addr add 2.64.116.145 dev qmimux0

Apply the given MTU size to the qmux interface that you acquired through qmicli --wds-get-current-settings above, e.g.:
ip link set mtu 1500 dev qmimux0

Bring up the QMUX virtual network interface:
ip link set dev qmimux0 up

You should now have a working cellular network data connection.

Test it e.g. by sending a ping over the qmux interface:
ping -I qmimux0 8.8.8.8 -c 4
PING 8.8.8.8 (8.8.8.8) from 2.68.152.91 qmimux0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=57 time=31.5 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=57 time=29.8 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=57 time=36.7 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=57 time=36.0 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 8ms
rtt min/avg/max/mdev = 29.821/33.494/36.690/2.911 ms

Apply appropriate network interface routing suitable for your use-case, e.g:
ip route add default dev qmimux0

the qmicli --wds-get-current-settings give back DNS server addresses also if they are defined by the cellular network.
Depending on how your Linux distribution handle DNS servers you can add them or instead use a public DNS server.

To stop the cellular data network connection:
Bring down the virtual mux interface:
ip link set qmimux0 down

Flush the ip addresses:
ip -4 -6 address flush dev qmimux0

Use the --wds-stop-network attribute to stop the data connection in module, include the packet data handle and the client ID from when establishing the connection.
qmicli -p -d /dev/cdc-wdm0 --device-open-qmi --wds-stop-network=########## --client-cid=##
Note: by not adding the --client-no-release-cid attribute this client ID will be closed after command execution.

It is up to the host application to manage and poll the connection state of the cellular module.
E.g. it the connection is lost temporarily due to no network coverage in the current location, the host application should tear down and re-establish the data connection when cellular module is registered in network again.

If the data connection fails for some reason several times, ensure that the connect retry attempts do not take place continuously without some extended delays in-between. Depending on the cellular network operator, they can enforce lock-out on your subscription/device for certain time periods in order to protect the network.

Question

How do we use an external SIM card on Telit module with onboard SIM card holder

Solution

Some Telit mPCIe modules have SIM card holders mounted onto the board itself. The data lines running to this SIM card holder are in parallell with those going out to the edge connector pins, which in turn connect to the data lines of an external SIM card holder.

However on some Telit modules the SIM Detection line is not routed out to the mPCIe pins, which means that the module cannot detect if or when a SIM card is inserted in the external SIM card holder. To get around this we use the AT commands:
AT+SIMDET=1
This command will simulate the "SIM Inserted" state and the module will then check if it is able to connect to the SIM card.