ZTEWelink Wireless Module Driver User Guide For EmbeddedLinux - V2.3
ZTEWelink Wireless Module Driver User Guide For EmbeddedLinux - V2.3
Version: V2.3
Date: 2017-12-22
Driver Series
Website: www.ztewelink.com
E-mail: [email protected]
Wireless Module Driver Guide for EmbeddedLinux
REVISION HISTORY
Version Date Description
V1.0 2012-07-18 Initial version of document.
Increase reversion, Legal Information.
V1.1 2013-03-11
Update version, modify some mistake
Modify the logo of cover and page footer
V1.2 2013-04-02 Modify Legal Information
Increase the revision history
V1.3 2013-05-28 Add the support for ZM8510 modem.
Add the support for ZM8620 modem
V1.4 2013-11-08
Add the contact information
V1.5 2013-12-09 Fix some information for LTE modem.
1. Add the Applicability Table
2. Update the format of this document
3. Update the Legal Information
4. Add the Contact Information of ZTEWelink
V1.6 2014-03-07
5. Add the detail information in Chapter 2.1 of Enable drivers and PPP feature from kernel
6. Update the content in Chapter 2 of Driver Integration
7. Add figures in Chapter 4 of Setup data call via ECM
8. Add Chapter 6 of Appendix: Ports of ZTEWelink modems
V1.7 2015-08-18 Update the Applicability Table
V1.8 2015-08-26 Add the PID of all the modules in Chapter 6
In Chapter 6:
Modify the PID information of ME3620, ZM5202, ZM8620.
V1.9 2016-01-06
Add the PID information of MC2716, MC8332, ME3610 and MC8618
Add some notices.
V2.0 2016-07-06 Add PID of ME3630
V2.1 2016-07-29 Modify the PID information of ME3630
Add chapter 5 of USB power management Guide
V2.2 2016-08-31 Modify the PID information of ME3630
Update the information in chapter 2.2 about how to add PID/VID to module.
Update the port of MW3650,ME3610_V2,MC5635,ME3612
V2.3 2017-12-22
Update the document format
ProductModel
ZM5202
ZM5202E
ZM2210
ZM8620
ZM5330
MF226
MF206A
MG3732_V2
ME3620
MW3650
MC8635
ME3630
ME3610_V2
MC5635
ME3612
B. Reading Note
The symbols below are the reading notes you should pay attention on:
: Warning or Attention
: Note or Remark
NOTE: Note: Consult our website for up-to-date product descriptions, documentation, application notes, firmware upgrades,
troubleshooting tips, and press releases
SAFETY INFORMATION
The following safety precautions must be observed during all phases of the operation, such as usage, service or repair of any
cellular terminal or mobile incorporating ZTEWelink module. Manufacturers of the cellular terminal should send the following safety
information to users and operating personnel and to incorporate these guidelines into all manuals supplied with the product. If not so,
ZTEWelink does not take on any liability for customer failure to comply with these precautions.
Full attention must be given to driving at all times in order to reduce the risk of an accident. Using a mobile while driving
(even with a hands free kit) cause distraction and can lead to an accident. You must comply with laws and regulations restricting the
use of wireless devices while driving.
Switch off the cellular terminal or mobile before boarding an aircraft. Make sure it switched off. The operation of wireless
appliances in an aircraft is forbidden to prevent interference with communication systems. Consult the airline staff about the use of
wireless devices on boarding the aircraft, if your device offers a Airplane Mode which must be enabled prior to boarding an aircraft.
Switch off your wireless device when in hospitals or clinics or other health care facilities. These requests are designed to
prevent possible interference with sensitive medical equipment.
GSM cellular terminals or mobiles operate over radio frequency signal and cellular network and cannot be guaranteed to
connect in all conditions, for example no mobile fee or an invalid SIM card. While you are in this condition and need emergent
help, please remember using emergency call. In order to make or receive call, the cellular terminal or mobile must be switched on
and in a service area with adequate cellular signal strength.
Your cellular terminal or mobile contains a transmitter and receiver. When it is on, it receives and transmits radio frequency
energy. RF interference can occur if it is used close to TV set, radio, computer or other electric equipment.
In locations with potentially explosive atmospheres, obey all posted signs to turn off wireless devices such as your phone or
other cellular terminals. Areas with potentially explosive atmospheres including fuelling areas, below decks on boats, fuel or
chemical transfer or storage facilities, areas where the air contains chemicals or particles such as grain, dust or metal powders.
CONTACT INFORMATION
9/F, Tower A, Hans Innovation Mansion,
Post North Ring Rd., No.9018, Hi-Tech Industrial Park,
Nanshan District, Shenzhen.
Web www.ztewelink.com
Phone +86-755-26902600
E-Mail [email protected]
Note: Consult our website for up-to-date product descriptions, documentation, application notes, firmware upgrades, troubleshooting tips,
and press releases
Besides, ZTEWelink provides various technical support ways to the customers, such as support by phone, website, instant
messaging, E-mail and on-site.
CONTENTS
6 TROUBLESHOOTING ....................................................................................... 20
6.1 Dropped connection ..................................................................................................................................................... 20
6.2 DNS issues 20
6.3 How to get log .............................................................................................................................................................. 20
1 INTRODUCTION
1.1 P URPOSE
This document is intended as a guide to describe how to set up and connect to the Internet using ZTEWelink Wireless Modem
on the EmbeddedLinux platform using open source software packages. Although this document is provided to guide current Linux
users to use ZTEWelink Wireless Modems on any EmbeddedLinux distribution, however, the setup instructions in this document has
only been tested with uCLinux. For setup on other Linux distributions, you should still be able to follow the instructions after you
download and install the necessary software packages outlined below.
1.2 S COPE
The readers of this document are assumed to software developers generally familiar with EmbeddedLinux development.
1.3 C ONVENTIONS
Function declarations, function names, type declarations, and code samples appear in a different font. For example: #include
Red font means the information should be notes, if ignore this may cause some failures. For example: /dev/ttyUSB
2 D RIVER I NTEGRATION
{ USB_DEVICE(0x19d2, 0x1476) },
Figure 2-1
“0x19d2” is the VID of ZTE corporation, it is appropriate for all ZTEWelink wireless modems. “0x0117” is the PID of the modem,
it may vary with the modem you are using, and you can use Linux command “lsusb” to get it. You can also get the PID of module in
chapter 7 Appendix. Figure 2-2 shows an example on a virtual machine.
Figure 2-2
As the PID/VID is add to the linux kernel and there is not any additional port information, the USB network port(ECM) is
loaded as USB serial port. For modems which have ECM interface, such as ZM5330/ZM8620/ME3620/ME3630, users need to
modify the function of option_probe to add the ports corresponding to ECM to blacklist. Only in this way, we can prevent the USB
network card is loaded as USB serial port.
For modems which have ECM interface, such as ME3630/ME3620(common firmware with PID 0x1476), the ports
corresponding to ECM are port 3&4, ME3630 tower firmware with PID 0x1509,you need to add the following code to function
option_probe
printk("idVendor=%x, idProduct=%x, bInterfaceNumber =%d\r\n",
serial->dev->descriptor.idVendor,
serial->dev->descriptor.idProduct,
serial->interface->cur_altsetting->desc. bInterfaceNumber);
Note:
“0x1509/0x1476” is the PID of the modem, it may vary with the modem you are using, you can use Linux command “lsusb” to get
it.
The first line of “printk” is used for debugging. ” if” conditional judgment is used to add the ECM ports to blacklist, you need to
modify the idProduct and bInterfaceNumber parameters according to the module you used. For the detail information of
idProduct and bInterfaceNumber, you can refer to chapter 7 Appendix.
Figure 2-3
Note: For LTE modems such as ZM5330/ZM8620/ME3620/ME3630, it also can use pppd and chat to setup a data connection,
but the speed may be limited, we recommend to uses ECM to setup data connection on ZM5330/ZM8620/ME3620 modem,
reference to chapter 4.
Note 1: /dev/ttyUSB2 in the first line is the modem interface of your device, please refer Chapter 6 to use proper modem
interface.
Note 2: User and password may be different due to mobile operator. If operator do not " provide username and password,
please use Anyname and Anypassword.
File 3: zte_ppp_dialer
ABORT "NO CARRIER"
ABORT "ERROR"
TIMEOUT 120
"" ATE
SAY "ATE"
ECHO ON
OK ATH
OK ATP
OK AT+CGDCONT=1, \”IP\",\"3GNET\"
OK ATD*99#
CONNECT
Note 1: The number “*99#” may vary with your mobile operator, “*99#” is valid if your mobile operator is CHINA UNICOM.
Note 2: The string “3GNET” is the APN, it may vary with your mobile operator, “3GNET” is valid if your mobile operator is
CHINA UNICOM.
File4: disconnect
#!/bin/sh
killall pppd
crtscts
modem
persist
lock
noauth
noipdefault
debug
nodetach
user card
password card
ipcp-accept-local
ipcp-accept-remote
replacedefaultroute
defaultroute
usepeerdns
noccp
nobsdcomp
novj
dump
Note 1: /dev/ttyUSB0 in the first line is the modem interface of your device, please refer Chapter 6 to use proper modem
interface.
Note 2: User and password may be different due to mobile operator. If an operator do not provide username and password,
please use Anyname and Anypassword. The username and password “card” is valid in CHINA TELECOM.
File 3: zte_ppp_dialer
ABORT "NO CARRIER"
ABORT "ERROR"
TIMEOUT 120
"" ATE
SAY "ATE"
ECHO ON
OK ATH
OK ATP
OK "AT+ZCAPN=card,card"
OK ATD#777
CONNECT
Note 1: The number “#777” may vary with your mobile operator, “#777” is valid if your mobile operator is CHINA TELECOM.
Note 2: The command "AT+ZCAPN=card,card" sets the username and password, it may be different due to mobile operator.
For example, if a mobile operator’s username is “user_a” and password is “1234”, then the command should be
“AT+ZCAPN=user_a, 1234”. If an mobile operator do not provide username and password, please do not add this command.
File4: disconnect
#!/bin/sh
killall pppd
3.4 D ISCONNECT
1. Enter “ctrl+c” at the terminal window;
2. Run the “disconnect” script.
Note: In the following example, we assume the name of the new network card is “usb0”, refer to chapter 2.4 for how to get
the name of the new network card after the driver had been installed.
Step0: Switch modem to ECM mode using AT command: AT+ZSWITCH=L, then reboot the modem.
Note: If your modem has already been set to ECM mode, then this step is not needed
Figure 4-1
Step1: Setup data call parameter using AT command +CGDCONT. For example, can configure APN “CMNET” using command:
AT+CGDCONT=1,”IP”,”CMNET”
Figure 4-2
Figure 4-3
Step3: Start DHCP to get IP and DNS. Enter “sudo dhcpcd usb0” in the command-line window:
Figure 4-4
Step4: Using “ifconfig usb0” check whether network card get IP address. As shown in Figure 4-5, in this example, the IP address
has been assigned, so if there were no other errors, users were able to access the internet now.
Figure 4-5
Figure 4-6
Figure 1
From the figure above, you can see the 3 USB ports are bound with option driver, ecm network card is bound with cdc_ether
driver. Because of the variety of kernel versions, some Linux kernel may not bind the option driver for USB port correctly. For this
situation, driver can be bound in a manual way.
# lsusb -t
/: Bus 05.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-pci/8p, 480M
|__ Port 2: Dev 6, If 0, Class=Vendor Specific Class, Driver=, 480M
|__ Port 2: Dev 6, If 1, Class=Vendor Specific Class, Driver=, 480M
|__ Port 2: Dev 6, If 2, Class=Vendor Specific Class, Driver=, 480M
|__ Port 2: Dev 6, If 3, Class=Communications, Driver=cdc_ether, 480M
|__ Port 2: Dev 6, If 4, Class=CDC Data, Driver=cdc_ether, 480M
Figure 2
The figure above shows that no driver for USB port, which means driver bind must be done manually. The precondition is that
right option driver module is existed for Linux driver, if not, it can be loaded by modprobe or insmod command.
Input the command below to bind driver after correct option module loaded:
See the catalog of /sys/bus/usb-serial/drivers/option1, if ttyUSB0, ttyUSB1 and ttyUSB2 are generated successfully, it means the
success of USB driver bind.
/sys/bus/usb/devices/Bus-Port/
The bus and port can be identified by lsusb command. In figure1, the module is at Bus 1 and Port 2, therefore the device sysfs
path is:
/sys/bus/usb/devices/1-2/
Input the following command to enable selective suspend and remote wakeup function:
cat /sys/bus/usb/devices/1-2/power/control
cat /sys/bus/usb/devices/1-2/power/level
If the return is “auto” for both commands, selective suspend function and remote wakeup function are ON now.
cat /sys/bus/usb/devices/1-2/power/wakeup
/sys/bus/usb/devices/1-2/power/autosuspend
/sys/bus/usb/devices/1-2/power/autosuspend_delay_ms
The unit of autosuspend setup is second, the unit of autosuspend_delay_ms is millisecond. In factory value, the delay period is
echo 2 >/sys/bus/usb/devices/1-2/power/autosuspend
or
6 T ROUBLESHOOTING
0 Diag
1 AT
0x1432(NDIS)
ZM5330 2 Modem
0x1433(ECM) for Linux
3 NDIS(ECM)
4 ADB
0 Diag
1 GPS
0x0144 2 NMEA
3 NMEAext
ZM5202
4 Modem
0 Diag
0x0117 1 NMEA
2 Modem
0 Modem
1 Diag
ZM2210 0x0152 2 AT
3 Vousb
4 NMEA
0 Diag
1 AT
3 NDIS(ECM)
4 ADB
MW3650 0 Service/AT
0xFFEB
MG3732_V2/A 1 VoUSB
2 Diag
3 Modem
0 Modem
MC8635 1 Service/AT
0xFFEE
MC8630 2 Vousb
3 Diag
0 Modem
1 Service/AT
MC2716 0xFFED
2 Vousb
3 Diag
MC8332 0 Diag
0xFFEA
MC8618 1 Modem
0 Diag
0x1432(NDIS) 1 AT
0x1476(ECM) 3 NDIS(ECM)
4 ADB
0 Diag
1 GPS
0x0144(PRC, Japan) 2 AT
3 ATExt
4 Modem
MF226 0 Diag
0x0117(South Korea)
1 NMEA
2 Modem
0 Diag
1 NMEA
0x2003(Malaysia)
2 VoUSB
3 Modem
0 DIAG
ME3630 1 AT
ME3612 3 NDIS
4 ADB
ME3610_V2 1 AT
ME3612 2 MODEM
3 ECM
4 ECM
0 DIAG
1 AT
Customization 3 ADB
4 ECM
5 ECM
0 DIAG
0x0016 (Download
1 AT
mode)
2 MODEM
0 RNDIS
1 RNDIS
2 DIAG
0x0601 (RNDIS)
3 AT
4 MODEM
5 ADB
0 DIAG
1 AT
2 MODEM
0x0602 (Win8)
3 MBIM
4 MBIM
5 ADB
Note:
ZM5202:
- PID 0x0144 is the one for common use.
- PID 0x0117 is aimed at South Korea.
ME3620_CIA:
- PID 0x1432 is compatible with NDIS port, but this format is only used in windows system.
- PID 0x1433 is specific to China Tower.
- PID 0x1476 is compatible with ECM port, this format is only used in Linux/Android system. it is the general availability
under Linux system, or used for SGCC(State Grid Cooperation of China), Japan and South Korea.
ME3630:
- PID 0x1432 is compatible with NDIS port, but this format is only used in windows system.
- PID 0x1509 is specific to China Tower.
- PID 0x1476 is compatible with ECM port, this format is only used in Linux/Android system.
Please pay attention on these points above and choose the correct PID.