Simcom Sim8200 Linux Usb User Guide v1.00.00 20200509
Simcom Sim8200 Linux Usb User Guide v1.00.00 20200509
_V1.00.00
LTE Module
General Notes
SIMCom offers this information as a service to its customers, to support application and engineering efforts that use
the products designed by SIMCom. The information provided is based upon requirements specifically provided to
SIMCom by the customers. SIMCom has not undertaken any independent search for additional relevant information,
including any information that may be in the customer’s possession. Furthermore, system validation of this product
designed by SIMCom within a larger electronic system remains the responsibility of the customer or the customer’s
system integrator. All specifications supplied herein are subject to change.
Copyright
This document contains proprietary technical information which is the property of SIMCom Limited., copying of
this document and giving it to others and the using or communication of the contents thereof, are forbidden without
express authority. Offenders are liable to the payment of damages. All rights reserved in the event of grant of a
patent or the registration of a utility model or design. All specification supplied herein are subject to change without
notice at any time.
SIM8200_Linux_USB_User_Guide 1 / 23
Smart Machine Smart Decision
Version History
SIM8200_Linux_USB_User_Guide 2 / 23
Smart Machine Smart Decision
Contents
Contents .......................................................................................................................................... 3
1 Introduction.................................................................................................................................. 4
1.1. Scope ......................................................................................................................................... 4
1.2. Related Documents ..................................................................................................................... 4
4 Troubleshooting .......................................................................................................................... 20
4.1. How to check whether the correct USB serial driver exists in the kernel? ................................ 20
4.2. What can I do if the port number does not start from ttyUSB0?................................................ 20
4.3. How to check whether the correct QMI WWAN driver integration in the kernel?...................... 20
SIM8200_Linux_USB_User_Guide 3 / 23
Smart Machine Smart Decision
1 Introduction
1.1. Scope
Short introductions how to customize the USB driver for Simcom SIM8200 module in Linux OS
Describes how software developers can use Linux devices for typical use cases.
1: SIM8200 ATC.
SIM8200_Linux_USB_User_Guide 4 / 23
Smart Machine Smart Decision
In order to recognize the module, customers should add module VID and PID information as below:
1. If the Linux kernel version higher than 3.2 and lower than 4.4.131:
If the following macro definitions are not contained in the usb.h file under
linux-x.x.x/include/linux, add them
#define USB_DEVICE_INTERFACE_CLASS(vend, prod, cl) \
.match_flags = USB_DEVICE_ID_MATCH_DEVICE | \
USB_DEVICE_ID_MATCH_INT_CLASS, \
.idVendor = (vend), \
.idProduct = (prod), \
.bInterfaceClass = (cl)
};
SIM8200_Linux_USB_User_Guide 5 / 23
Smart Machine Smart Decision
.reserved = BIT(7),
};
{ USB_DEVICE(SIMCOM_VENDOR_ID, 0x9001),
.driver_info = (kernel_ulong_t)&simcom_pid9001_blacklist },
.driver_info = (kernel_ulong_t)&simcom_pid9011_blacklist },
NOTE
If the following statements are contained in the option.c file under linux-x.x.x/drivers/usb/serial/, remove
them,as they will conflict with SIM8200's USB driver.
{ USB_DEVICE(ALINK_VENDOR_ID, SIMCOM_PRODUCT_SIM7100E),
.driver_info = (kernel_ulong_t)&simcom_sim7100e_blacklist },
.....
{ USB_DEVICE(SIMCOM_VENDOR_ID, 0x9001),
.driver_info = RSVD(5) | RSVD(6) },
{ USB_DEVICE_INTERFACE_CLASS(SIMCOM_VENDOR_ID, 0x9011, 0xff), /* Simcom
SIM8200 RNDIS mode ,Reserved the interface for ADB */
.driver_info = RSVD(7) },
SIM8200_Linux_USB_User_Guide 6 / 23
Smart Machine Smart Decision
NOTE
If the following statements are contained in the option.c file under linux-x.x.x/drivers/usb/serial/, remove
them,as they will conflict with SIM8200's USB driver.
{ USB_DEVICE(ALINK_VENDOR_ID, SIMCOM_PRODUCT_SIM7100E),
.driver_info = RSVD(5) | RSVD(6) },
{ USB_DEVICE_INTERFACE_CLASS(0x1e0e, 0x9011, 0xff),
.driver_info = RSVD(7) },
How to compile and install a kernel module in Linux. follow the steps below will guide you along in compiling and
install your option driver On Ubuntu operating system.
Step 1: Enter to kernel directory.
cd <your kernel directory>
Step 2: Build the driver.
sudo make -C /lib/modules/`uname -r`/build M=`pwd`/drivers/usb/serial obj-
m=option.o modules
Step 3: Load the driver and reboot.
sudo cp drivers/usb/serial/option.ko /lib/modules/`uname -
r`/kernel/drivers/usb/serial
sudo depmod
sudo reboot
SIM8200_Linux_USB_User_Guide 7 / 23
Smart Machine Smart Decision
NOTE
If the following statements are contained in the qmi_wwan.c file under linux-x.x.x/drivers/net/usb/,
remove them,as they will conflict with SIM8200's QMI WWAN driver.
Simcom provides the source file qmi_wwan_simcom.c, which only be used for SIM8200. Contact
customer engineer of simcom to get the file.
Please add the following statements to build qmi_wwan_simcom.c and keep the following order.
File: linux-x.x.x/drivers/net/usb/Makefile.
obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan_simcom.o
obj-$(CONFIG_USB_NET_QMI_WWAN) += qmi_wwan.o
How to compile and install a kernel module in Linux, follow the steps below will guide you along in compiling and
install your option driver On Ubuntu operating system.
Step 1: Enter to kernel directory.
cd <your kernel directory>
Step 2: Build the driver.
sudo make -C /lib/modules/`uname -r`/build M=`pwd`/drivers/net/usb obj-
m=qmi_wwan.o modules
SIM8200_Linux_USB_User_Guide 8 / 23
Smart Machine Smart Decision
sudo depmod
sudo reboot
Configuration Configuration(N/Y)
CONFIG_USB_SERIAL Y
CONFIG_USB_SERIAL_WWAN Y
CONFIG_USB_SERIAL_OPTION Y
Configuration Configuration(N/Y)
CONFIG_USB_SERIAL Y
CONFIG_USB_SERIAL_WWAN Y
CONFIG_USB_SERIAL_OPTION Y
CONFIG_USB_USBNET Y
CONFIG_USB_WDM Y
Configuration Configuration(N/Y)
CONFIG_USB_SERIAL Y
CONFIG_USB_SERIAL_WWAN Y
CONFIG_USB_SERIAL_OPTION Y
SIM8200_Linux_USB_User_Guide 9 / 23
Smart Machine Smart Decision
CONFIG_USB_USBNET Y
CONFIG_USB_NET_CDCETHER Y
Configuration Configuration(N/Y)
CONFIG_USB_SERIAL Y
CONFIG_USB_SERIAL_WWAN Y
CONFIG_USB_SERIAL_OPTION Y
CONFIG_PPP Y
CONFIG_PPP_FILTER Y
CONFIG_PPP_MULTILINK Y
CONFIG_PPP_BSDCOMP Y
CONFIG_PPP_ASYNC Y
CONFIG_PPP_SYNC_TTY Y
CONFIG_PPP_DEFLATE Y
SIM8200_Linux_USB_User_Guide 10 / 23
Smart Machine Smart Decision
SIM8200_Linux_USB_User_Guide 11 / 23
Smart Machine Smart Decision
3 Modem Usage
This chapter mainly introduces several commonly used HSUSB tethering methods and their general
processes.
OK
NOTE
Check the driver to make sure that Simcom VID and PID information modification has been added.
You will need the right software and a couple of pieces of information before you start.First, check the
pppd. If the programs do not exist, you can download the source code from
https://ppp.samba.org/download.html and port them to your embedded development environment.
Next you must write configuration file for pppd.
SIM8200_Linux_USB_User_Guide 12 / 23
Smart Machine Smart Decision
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 30
"" AT
OK ATE0
OK ATI;+CSUB;+CSQ;+CPIN?;+COPS?;+CGREG?;&D2
# Insert the APN provided by your network operator, default apn is 3gnet
OK AT+CGDCONT=1,"IP","3gnet",,0,0
OK ATD*99#
CONNECT
"" +++
"" +++
"" +++
SAY "\nGoodbay\n"
hide-password
SIM8200_Linux_USB_User_Guide 13 / 23
Smart Machine Smart Decision
defaultroute
# pppd must not propose any IP address to the peer
noipdefault
# No ppp compression
novj
novjccomp
noccp
ipcp-accept-local
ipcp-accept-remote
local
# For sanity, keep a lock on the serial line
lock
modem
dump
nodetach
# Hardware flow control
nocrtscts
remotename 3gppp
ipparam 3gppp
ipcp-max-failure 30
# Ask the peer for up to 2 DNS server addresses
usepeerdns
When you see the output below,it shows that dial-up succeeded.
SIM8200_Linux_USB_User_Guide 14 / 23
Smart Machine Smart Decision
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns2 0.0.0.0>]
rcvd [IPCP ConfReq id=0x0]
SIM8200_Linux_USB_User_Guide 15 / 23
Smart Machine Smart Decision
Now PPP call is set up successfully. Please use following commands to check IP/DNS/Route.
# ifconfig ppp0
ppp0 Link encap:Point-to-Point Protocol
inet addr:10.216.159.39 P-t-P:10.64.64.64 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
collisions:0 txqueuelen:3
RX bytes:362 (362.0 B) TX bytes:316 (316.0 B)
# cat /etc/resolv.conf
nameserver 221.180.132.108
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
# ping baidu.com
PING baidu.com (220.181.57.216) 56(84) bytes of data.
# killall pppd
Please use the source code in the simcom-cm.rar package provided by our company. Adjust the Makefile
file on the target host, and then compile them into the executable file or the library file if needed.
1) The Makefile in the source code applies to the Linux OS enviroment. After decompressing it in one
Linux directory, enter the simcom-cm folder, and then execute the ‘make’ command to compile. If the
SIM8200_Linux_USB_User_Guide 16 / 23
Smart Machine Smart Decision
source code is compiled successfully, the simcom-cm execution program will be generated.
Connect the module to the Linux OS host through a USB cable. Please make sure the driver is installed
successfully. Enter the directory which locates the simcom-cm execution program under root authority,
and then execute ‘./simcom-cm’.
# sudo ./simcom-cm
[05-07_01:27:02:351] Find qmichannel = /dev/cdc-wdm0
[05-07_01:27:02:351] Find usbnet_adapter = wwan0
[05-07_01:27:02:362] cdc_wdm_fd = 7
SIM8200_Linux_USB_User_Guide 17 / 23
Smart Machine Smart Decision
# ping baidu.com
PING baidu.com (123.125.114.144) 56(84) bytes of data.
Wait for the system to reset to rndis mode, make sure the <PID> has been
switched to 9011.
# echo -e "AT+NETACT=1\r\n">/dev/ttyUSB2
# OK
SIM8200_Linux_USB_User_Guide 18 / 23
Smart Machine Smart Decision
collisions:0 txqueuelen:1000
RX bytes:4237 (4.2 KB) TX bytes:13148 (13.1 KB)
# ping baidu.com
PING baidu.com (220.181.38.148) 56(84) bytes of data.
SIM8200_Linux_USB_User_Guide 19 / 23
Smart Machine Smart Decision
4 Troubleshooting
4.1. How to check whether the correct USB serial driver exists in the kernel?
If Linux does not create devices, check for the kernel module:
# modprobe option
Check dmesg output to see that the radio was detected:
If this returns an error response, the kernel module is not on your system. You will need to build the
driver
4.2. What can I do if the port number does not start from ttyUSB0?
Check the ttyUSB port usage. Check whether the ttyUSB port is released when the module is
disconnected.
4.3. How to check whether the correct QMI WWAN driver integration in the kernel?
[88843.080671] usb 1-5: GSM modem (1-port) converter now attached to ttyUSB0
SIM8200_Linux_USB_User_Guide 20 / 23
Smart Machine Smart Decision
[88843.083213] usb 1-5: GSM modem (1-port) converter now attached to ttyUSB3
[88843.083445] option 1-5:1.4: GSM modem (1-port) converter detected
[88843.083541] usb 1-5: GSM modem (1-port) converter now attached to ttyUSB4
[88843.648962] usbcore: registered new interface driver cdc_wdm
[88843.650716] qmi_wwan_simcom 1-5:1.5: cdc-wdm0: USB WDM device
collisions:0 txqueuelen:1000
SIM8200_Linux_USB_User_Guide 21 / 23
Smart Machine Smart Decision
5 Appendix A Abbreviations
Abbreviation Description
USB Universal Serial Bus
VID Vendor ID
PID Product ID
PPP Point-to-Point Protocol
IPCP IP Control Protocol
IP Internet Protocol
NMEA National Marine Electronics Association
DNS Domain Name Server
NDIS Network Driver Interface Specification
RNDIS Remote Network Driver Interface Specification
SIM8200_Linux_USB_User_Guide 22 / 23