Zte Welink MW3820 User manual

Wireless Module Driver User Guide
for EmbeddedLinux
Welink Your Smart
Version 1.1, 2014-08-04
MW3820

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink I
MW3820
Legal Information
By receiving the document from Shenzhen ZTEWelink Technology Co., Ltd (shortly referred to as
ZTEWelink), you are deemed to have agreed to the following terms. If you don‟t agree to the
following terms, please stop using the document.
Copyright © 2013 Shenzhen ZTEWelink Technology Co., Ltd. All rights reserved. The document
contains ZTEWelink‟s proprietary information. Without the prior written permission of ZTEWelink,
no entity or individual is allowed to reproduce, transfer, distribute, use and disclose this document or
any image, table, data or other information contained in this document.
As the wholly-owned subsidiaries of ZTE, ZTEWelink is the professional company engaging in R&D,
manufacture and sales of wireless module product. is the registered trademark of
ZTEWelink. The name and logo of ZTEWelink are ZTEWelink‟s trademark or registered trademark.
Meanwhile, ZTEWelink is granted to use ZTE Corporation‟s registered trademark. The other products
or company names mentioned in this document are the trademark or registered trademark of their
respective owner. Without the prior written permission of ZTEWelink or the third-party oblige, no one
is allowed to read this document.
The product meets the design requirements of environmental protection and personal security. The
storage, use or disposal of products should abide by the product manual, relevant contract or the laws
and regulations of relevant country.
ZTEWelink reserves the right to make modifications on the product described in this document
without prior notice, and keeps the right to revise or retrieve the document any time.
If you have any question about the manual, please consult the company or its distributors promptly.

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink II
MW3820
Revision History
Version
Date
Description
1.0
2014-01-24
1st version
1.1
2014-08-04
Update the template and format of this document
Update the Table 2-1

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink III
MW3820
Contact Information
Post
9/F, Tower A, Hans Innovation Mansion,
North Ring Rd., No.9018, Hi-Tech Industrial Park,
Nanshan District, Shenzhen. P.R.China
Web
www.ztewelink.com
Phone
+86-755-86360200-8679
E-Mail
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.

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink IV
MW3820
Contents
Legal Information...............................................................................................................................I
1Introduction....................................................................................................................5
1.1 Purpose ..........................................................................................................................................5
1.2 Scope .............................................................................................................................................5
1.3 Conventions...................................................................................................................................5
2Driver Integration..........................................................................................................6
2.1 Enable USB-modem driver from kernel........................................................................................6
2.2 Add VID/PID to USB-modem driver ............................................................................................6
2.3 Enable PPP feature from kernel.....................................................................................................6
2.4 Build the kernel .............................................................................................................................7
2.5 Verify whether modem driver is loaded ........................................................................................7
3Make Data Connection Using PPPD and CHAT........................................................8
3.1 Sample script for data connect using WCDMA modem................................................................8
3.2 Start to dial and connect ................................................................................................................9
3.3 Disconnect .....................................................................................................................................9
4TROUBLESHOOTING..............................................................................................10
4.1 Dropped connection.....................................................................................................................10
4.2 DNS issues...................................................................................................................................10

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink 5
MW3820
1Introduction
1.1 Purpose
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 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 Scope
The readers of this document are assumed to software developers generally familiar with
EmbeddedLinux development.
1.3 Conventions
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

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink 6
MW3820
2Driver Integration
2.1 Enable USB-modem driver from kernel
USB-modem driver may be not enabled in the kernel, so please go to kernel, do make menuconfig and
select Device Drivers -> USB -> USB serial -> GSM modem, then enable it to be built-in:
-CONFIG_USB_SERIAL=y
-CONFIG_USB_SERIAL_GENERIC=y
-CONFIG_USB_SERIAL_OPTION=y
2.2 Add VID/PID to USB-modem driver
Modify driver file option.c which locates in \linux-source-2.6.XX\drivers\usb\serial. Add modem PID
and VID in driver id_table:
static struct usb_device_id option_ids[] = {
{ USB_DEVICE(0x19d2, 0xFFEB },
0x19d2 is ZTE VID, it is appropriate for all ZTEWelink wireless modems. 0xFFEB modem PID which
may vary with the modem you use, you can use `lsusb` to get it.
2.3 Enable PPP feature from kernel
PPP may not enable in the kernel. Managed to fix the issue by go to kernel, do make menuconfig and
select Device Drivers -> Network Device Support -> and then enable following to be built-in:
- CONFIG_PPP=y
-CONFIG_PPP_ MULTILINK=y
-CONFIG_PPP_FILTER=y
-CONFIG_PPP_ASYNC=y
-CONFIG_PPP_SYNC_TTY=y

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink 7
MW3820
2.4 Build the kernel
Build kernel, and flash this kernel file to target board, reboot target board.
2.5 Verify whether modem driver is loaded
After reboot target system, Plug in the modem, then driver can be loaded successfully now. Although
it is not necessary to verify the result of the driver integration step above, if you want to be sure that the
driver is now associated with your modem. Attach the modem to the target board and run the following on
the command-line:
“dmesg|grep -i ttyUSB”
You should see something like:
usb 2-1.3: generic converter now attached to ttyUSB0
usb 2-1.3: generic converter now attached to ttyUSB1
usb 2-1.3: generic converter now attached to ttyUSB2
This LOG indicates the usb serial driver has been loaded. In general, each ZTE modem has multi interface.
Table 2-1
PID:0xFFEB
(MW3820)
0
Diag interface
/dev/ttyUSB0
1
Modem interface
/dev/ttyUSB1
2
AT interface
/dev/ttyUSB2

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink 8
MW3820
3Make Data Connection Using PPPD and
CHAT
This section gives an example for how to setup a data connection using pppd and chat program. You
should have done Section 2, so that your device can be recognized by the system. This also assumes you
have already downloaded pppd and install on your current Linux distribution.
3.1 Sample script for data connect using WCDMA
modem
File 1: ppp-on
#!/bin/sh
clear
OPTION_FILE="zte_options"
DIALER_SCRIPT=$(pwd)/zte_ppp_dialer
exec /usr/sbin/pppd file $OPTION_FILE connect "/usr/sbin/chat -v -f ${DIALER_SCRIPT}"
This file is the main script using option file “zte_options” and “zte_ppp_dialer”
File 2: zte_options
/dev/ttyUSB2
115200
crtscts
modem
persist
lock
noauth
noipdefault
debug
nodetach
user Anyname
password Anypassword
ipcp-accept-local
ipcp-accept-remote
replacedefaultroute
defaultroute
usepeerdns

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink 9
MW3820
noccp
nobsdcomp
novj
dump
Note: /dev/ttyUSB2 is the modem interface of your device, please ref table 2-1 to use proper modem
interface.
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: the number *99# may vary with your mobile operator; *99# is valid in CHINA UNICOM.
CMNET is the APN may vary with your mobile operator; 3GNET is valid in CHINA UNICOM.
File4: disconnect
#!/bin/sh
killall pppd
3.2 Start to dial and connect
Open a terminal window and run the Main script “ppp-on” start to dial and connect
3.3 Disconnect
The way 1: entry “ctrl+c” at a terminal window;
The way 2: run the disconnect script.

Wireless Module Driver User Guide For EmbeddedLinux
All Rights reserved, No Spreading abroad without Permission of ZTEWelink 10
MW3820
4TROUBLESHOOTING
4.1 Dropped connection
In the event that the connection is lost due to any reason, a manual reconnect is required. You can configure
your connection to automatically redial on disconnect.
4.2 DNS issues
For DNS-related issues, please verify entries in /etc/resolv.conf file. Please refer to your Linux
distribution„s user manual for more information about fixing this problem.
Table of contents
Popular Wireless Module manuals by other brands

Neoway
Neoway N58 Hardware user's guide

Sierra Wireless
Sierra Wireless AirPrime MC7350 Hardware integration guide

Wacom
Wacom INF-A068 Important product information

Aventics
Aventics G3 Series Quick start manual

Ebyte
Ebyte E72-2G4M05S1G user manual

Telit Wireless Solutions
Telit Wireless Solutions ME310G1 HW Design Guide