TECHSHIP IS A GLOBAL SUPPLIER OF WIRELESS COMPONENTS

Register
FAQs /
Question

How to collect initial diagnostics data for Sierra Wireless EM/MC74xx and EM75xx 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?

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

Recently added

Question

How-to use automated connection establishment with SIM7600E-h when using RNDIS USB mode

Solution

Both Windows and Linux systems can support RNDIS host drivers for the SIM7600 series modules, this example is done in Linux. There is a open source Linux in-kernel driver supporting rndis host USB endpoints called rndis_host.

By default the Simcom modules are delivered with QMI/RMNET interface enabled, so you will have to change the default USB mode with AT command on the Modem/AT serial ports available over USB.
lsusb
Bus 001 Device 006: ID 1e0e:9001 Qualcomm / Option

Switch from 9001 to mode 9011 for RNDIS:
AT+CUSBPIDSWITCH=9011,1,1
The module should restart automatically and re-enumerate with the new USB IDs
Check with lsusb that you have the Simcom SIM7600 module loaded, VID PID value: 1e0e 9011
lsusb
Bus 001 Device 006: ID 1e0e:9011 Qualcomm / Option

Verify with lsusb -t that the Linux in-kernel driver rndis_host or cdc-ecm drivers are loaded correctly for interface 0 and 1.
It can look e.g. like this:
lsusb -t

/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 480M
|__ Port 4: Dev 6, If 3, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 6, If 1, Class=CDC Data, Driver=rndis_host, 480M
|__ Port 4: Dev 6, If 6, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 6, If 4, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 6, If 2, Class=Vendor Specific Class, Driver=option, 480M
|__ Port 4: Dev 6, If 0, Class=Communications, Driver=rndis_host, 480M
|__ Port 4: Dev 6, If 5, Class=Vendor Specific Class, Driver=option, 480M

If your system don't load the option serial interfaces correctly, then they can be forcefully loaded as bellow:
modprobe option
echo 1e0e 9011 > /sys/bus/usb-serial/drivers/option1/new_id

For the modules network connection and interface to automatically activate you should have the SIM PIN deactivated or script it so host system provides it to module at every startup.
AT+CPIN=xxxx

A APN name provided by the network carrier which is used to establish a packet data connection to the cellular network is required. If you define a empty string as its default value, will make the module try to subscribe for correct APN name from network, however this works in many cases but not always. If so it has to be configured with commands as bellow:

Check configured APN profiles:
AT+CGDCONT?
You should have minimum the following defined to have module try request details from cellular network:
AT+CGDCONT: 1,"IPV4V6",""
AT+CGDCONT=6,"IPV4V6",""
+CGDCONT Profile 1 is used for cellular network registration and profile 6 for the RNDIS network interface data connection.

Define both APN profiles according to the details you have obtained with your cellular subscription. Most often the APN details are same for both registration and data connection, define them to profile 1 and 6.
AT+CGDCONT=1,"IPV4V6","MY-SUBSCRIPTION-APN"
AT+CGDCONT=6,"IPV4V6","MY-SUBSCRIPTION-APN"

Some APN names require additional authentication also, please refer to the AT command: AT+CGAUTH in the AT commands guide on how to define it correctly. Current auth configurations can be checked with command:
AT+CGAUTH?
Most often no auth details are needed for the profiles and they should be empty, profile 1 can be cleared with command:
AT+CGAUTH=1,0
AT+CGAUTH=6,0

If you have modified the APN information, username and passwords it is needed to re-attach to the packet switched network or re-register in the cellular network to activate the new settings. It can be done e.g. with AT+CFUN=0 command followed by AT+CFUN=1 to switch module operation mode (SIM card will be re-initialized also so PIN code have to be given again if PIN check activated).

The module will now establish the data connection according to the new settings.

If everything is working correctly and connection established you can now run a dhcp client on the network interface.
dhclient -v usb0
Listening on LPF/usb0/4a:de:a7:7e:46:07
Sending on LPF/usb0/4a:de:a7:7e:46:07
Sending on Socket/fallback
DHCPREQUEST of 192.168.225.46 on usb0 to 255.255.255.255 port 67 (xid=0xaabce35)
DHCPACK of 192.168.225.46 from 192.168.225.1
RTNETLINK answers: File exists
bound to 192.168.225.46 -- renewal in 21475 seconds.

ping -I usb0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.225.46 usb0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=52 time=167 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=52 time=37.6 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=52 time=44.4 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=52 time=33.6 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 8ms
rtt min/avg/max/mdev = 33.600/70.635/166.972/55.753 ms

Tested on firmware release LE11B12SIM7600M22

Question

Useful Linux kernel configs to have enableb when integrating cellular modules in the Linux kernel

Solution

Most cellular modules can be supported in Linux by using som of the in-kernel drivers. The physical data interface to the host Linux system is usually done over USB which enumerates a set of different endpoints/interfaces. A set of serial interfaces for Modem/PPP, AT commands, NMEA location data and chipset debug information are almost always available in all configurations.

In addition some type of network endpoint/interface are also available and exposed. This can vary between manufacturers and chipset vendors and can also commonly be configurable by using USB configuration mode switching or through vendor specific AT commands.

Recommended kernel configurations to enable either as part of kernel or modules are listed bellow. Many cellular modules base their Linux support on these, either supported out-of-the-box or by applying source code modifications to them.

Configs for USB serial drivers:
CONFIG_USB_SERIAL
CONFIG_USB_SERIAL_GENERIC
CONFIG_USB_SERIAL_WWAN
CONFIG_USB_SERIAL_OPTION
CONFIG_USB_SERIAL_QUALCOMM
CONFIG_USB_ACM

Configs for Modem/PPP support:
CONFIG_PPP
CONFIG_PPP_BSDCOMP
CONFIG_PPP_DEFLATE
CONFIG_PPP_FILTER
CONFIG_PPP_MPPE
CONFIG_PPP_MULTILINK
CONFIG_PPPOE
CONFIG_PPP_ASYNC
CONFIG_PPP_SYNC_TTY

Configs for USB network drivers:
CONFIG_USB_USBNET
CONFIG_USB_NET_QMI_WWAN
CONFIG_USB_NET_CDCETHER
CONFIG_USB_NET_RNDIS_HOST
CONFIG_USB_NET_CDC_NCM
CONFIG_USB_NET_HUAWEI_CDC_NCM
CONFIG_USB_NET_CDC_MBIM

Please relate to our product specific web pages for vendor details on Linux integration.

Question

The importance of using multiple antennas on LTE and 3G cellular modules

Solution

When designing in an LTE or 3G cellular module, using two antennas always offer the best possible signal reception and module performance. For LTE modules, usage of two antennas are mandatory if you want to take full potential in terms of signal quality and downlink data throughput.

Using just one antenna will disable the advance signal processing benefits you can achieve with MIMO antenna technology and approximately decrease downlink throughput by half on a LTE Cat-4 capable device. As we move onwards to even higher data throughputs, even more antenna channels will be required. For example, the new LTE Cat-18 Telit LM960 module need four antennas to utilize its full data throughput capabilities with 4x4 MIMO.

Although MIMO is not available on 3G modules, a second diversity antenna will allow the modules signal processors to improve the received signal quality especially in areas with poor reception. To further maximize the antenna performances and get proper isolation between the antennas, you should also preferably position them as far apart as possible and in different polarization.

A preferred alternative is to use a combined antenna instead of including several antenna elements. These antennas can combine different MIMO/diversity configurations with other RF elements, e.g. GNSS and Wi-Fi and are also available in different forms and mounting options.

Having everything combined in a single antenna unit also eases the installation and decreases the mounting space as well as passthrough holes required, essential for example when installed on a vehicle roof.

Question

Our cellular module, Huawei ME909s series miniPCIe, is not detected in the MikroTik RouterBoard embedded board running RouterOs, what can we do?

Solution

Many host systems running e.g. operating systems like Linux have a very short detection time for peripheral USB devices on the internal miniPCIe sockets before the host system continues to load.

This can result in the cellular module not being detected at all in the host system due to the cellular modules internal boot-up procedure have not yet finished. The D+ signal will be pulled high first after the modules internal boot-up process have completed and then signal its device presence on the USB interface to host system.

When you intend to use a cellular module in these systems and the cellular module cannot be detected, please try to add in a delay to the host systems boot-up procedure in the earliest possible stage, this to allow the cellular module to boot-up correctly first and show its presence to host system before it have passed the peripheral devices detection phase.

The boot-up times for the cellular module can commonly be found in the products hardware guide.
For Huawei ME909s series it is approximately 9 seconds.

For example in Mikrotik RouterOS, this often can be the reason for the cellular module not being detected. Then you can try to adjusting the "boot-delay" parameter from its default 1 second.

Please refer to the RouterOS Wiki for further details on boot-up delays and other useful parameters.

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
SKU: 55010946 Firmware: 11.617.14.00.00
SKU: 55010983 Firmware: 11.617.15.00.00

10279 Huawei ME909s-120 LGA EU:
SKU: 55010781 Firmware: 11.617.09.00.00
SKU: 55010782 Firmware: 11.617.15.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