W-Link WL-R220 Series User manual

Quick Start
---Apply to WL-R220(MTK) Series OpenWrt Router
V1.1
http://www.wlink-tech.com
Oce, 2022

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
1
Copyright © Shenzhen WLINK Technology Company Limited 2012 ~2022
Without our written approval, Anyone can’t extract, copy whole or part of content of this file and
can’t spread out in any format.
Caution
Due to product updates or functional upgrading, we may renew the content of this file, and this
file only for reference. All statement, information, suggestion .etc in this file does not compose
any form of guarantee and we WLINK reserves the right of final explanation.
Shenzhen WLINK Technology Company Limited
Add:
2A, F5 Building, TCL International E City, No.1001 Zhongshanyuan
Rd., Nanshan Dist., Shenzhen, 518052, China
Web:
http://www.wlink-tech.com
Service Email:
support@wlink-tech.com
Tel:
86-755-86089513
Fax:
86-755-26059261

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
2
Contents
1Product Introduction ...........................................................................................................3
1.1 Product overview .....................................................................................................3
1.2 Model Introduction ...................................................................................................3
1.3 Typical Application Diagram ....................................................................................3
1.4 Hardware Features ..................................................................................................4
2Hardware Installation ......................................................................................................... 6
2.1 Panel ........................................................................................................................6
2.2 How to Install ........................................................................................................... 7
3OpenWrt Instruction ...........................................................................................................9
3.1 GPIO and LED Indicators ........................................................................................9
3.2 Interface(8PINs) indication .................................................................................... 11
3.3 OpenWrt Configuration ..........................................................................................12

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
3
1Product Introduction
1.1 Product overview
WL-WL-R220-M 4G/3G OpenWrt industrial router is the internet of thing mobile
broadband router and a machine to machine (M2M) industrial cellular router, which can
optional works on 4G/3G cellular network to provide reliable, secure and high speed
wireless connectivity. It is powerful and programmable industrial mobile router with high
performance and harden casing design for remote management, telemetry, condition
monitoring, CCTV, ATMs, vending machine and other M2M applications.
WLINK WL-WL-R220 4G/3G OpenWrt industrial router is based on the OpenWrt trunk
system, which is configured using a web interface (LuCI). Customers can be allowed to
customize WL-WL-R220 series router to fit any application from the selection and
configuration by WLINK provided . It’ll be used for anything that an embedded Linux
system can be used for, including functions as SNMP, SSH, VPN, traffic-shaping system,
and so on.
1.2 Model Introduction
WLINK industrial grade router OpenWrt Series have single module / single SIM card,
single module / double SIM card, double module / double SIM card design, support
multi-band frequency WCDMA, HSPA+,4G FDD/TDD etc., mobile wide-band, backward
compatibility with GPRS/EDGE/CDMA 1x, etc., mobile narrow-band, optional built-in Wi-Fi
module to build WLAN network, optional GPS module Expansion positioning function, to
suit different requirement and different network environment of different operators, our
OpenWrt Series router have many available models for option, please consult WLINK
sales manager for details.
1.3 Typical Application Diagram
WLINK 4G/3G Router are widely used in Telecom, economic, advertisement, traffic,

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
4
environment protection business area.
For example, in economic area, WL-WL-R220 OpenWrt Series Router connect server by
IPSec & GRE to ensure data security, tiny design makes it easily installed into ATM machine.
All these technology ensure safe and reliable data transmission, and minimize the probability
of network disconnection, and maximize the usability of economic business like ATM,
POS .etc.
Figure 1-1 Network Topology
1.4 Hardware Features
CPU: MT7628, 580MHz
Flash - 16MB
Storage 8GB
DDR2:16Bit 64MB
Mini PCIe Adapter USB2.0 3G/4G Module, 4G/HSPA+/WCDMA module
optional
2*USIM Slots
2*LAN,
RS232 as default
Reset Button

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
5
Wi-Fi:IEEE 802.11n 300Mbps
2*DI, 1*DO

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
6
2Hardware Installation
This chapter is mainly for installation introduction, there would be some difference
between the scheme and real object. But the difference won’t have any influence to
products performance.
2.1 Panel
Table 2-1 WL-WL-R220 Structure
WLINK Tech.
WL-WL-R220 OpenWrt Router
Front
Top
There are difference on Antenna interface and indicator light for the device with
extended GPS features.

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
7
Table 2-2 Router Interface
Port
Instruction
Remark
USIM
Plug type SIM Slot, support 1.8/3V/5V automatic
detection.
Main
3G/LTE antenna, SMA connector, 50Ω.
Aux/GPS
Optional for LTE MIMO antenna or GPS
antenna ,SMA connector, 50Ω.
Wi-Fi1
Wi-Fi antenna, SMA connector,
Wi-Fi2
Wi-Fi antenna, SMA connector,
Wi-Fi MIMO
LAN1
10/100Base-TX,MDI/MDIX self-adaption.
LAN2
10/100Base-TX,MDI/MDIX self-adaption.
Console
Reserved
Reset
Reset button,(press on button at least 5 seconds)
PWR
Power connector
7.5~32V DC
I/O
Reserved
2.2 How to Install
2.3.1 SIM/UIM card install
If use dual SIM/UIM card router, you need insert dual SIM before configure it. After
inserting, please follow below steps to connect the router.
Before connecting, please disconnect any power resource of router
2.3.2 Ethernet Cable Connection
Use an Ethernet cable to connect the cellular Router with computer directly, or transit by a
switch.
2.3.3 Serial Port Connection
If you want to connect the router via serial port to laptop or other devices, you should
prepare a serial port or RJ45 cable, this cable is optional available from WLINK. One end
connect to computer serial port, the other end connects to the console port of the router

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
8
Before connecting, please disconnect any power resource.
2.3.4 Power Supply
In order to get high reliability, WLINK OpenWrt Series Router power adapt supports wide
voltage input range from +7.5V to +32VDC, support hot plug and complex application
environment.
2.3.5 Review
After insert the SIM/UIM card and connect Ethernet cable and antenna, connect power
supply adaptor or power cable.
Please connect the antenna before power on, otherwise the signal maybe poor
because of impedance mismatching.
Notice:
Step 1 Check the antenna connection.
Step 2 Check SIM/UIM card, confirm SIM/UIM card is available.
Step 3 Power on the industrial Router
----END

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
9
3OpenWrt Instruction
3.1 GPIO and LED Indicators
GPIO List
GPIO45
ND-D0
Signal_1
Net1_Green
Signal LED1, light at high level
GPIO5
ND-D1
Signal_2
Net1_Green
Signal LED2, light at high level
GPIO4
ND-D2
Signal_3
Net2_Green
Signal LED3, light at high level
GPIO46
ND-D3
Error
Net2_Green
Error LED. light at low level
No 5G module or network for Red
GPIO2
Module_PWR
4G Module power control
High level for power on
Low level for power off
GPIO3
JTRST
SIM_Choose
Control SIM card
High level for SIM2
Low level for SIM1
Power OFF 4G module at first, then control GPIO to switch
SIM card. Then power on 4G module in 8sec.
GPIO38
Default Factory
GPIO44
WLAN
Function Description
GPIO2
GPIO2 for 4G module power control
cd /sys/class/gpio/usb0 (GPIO2 is exported from dts file)
echo 1 > value (Power on)

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
10
echo 0 > value (Power off)
GPIO 3
GPIO3 for SIM choose
cd /sys/class/gpio/sim (GPIO3 is exported from dts file)
echo 1 > value (High level for SIM2)
echo 0 > value (Low level for SIM1)
Power OFF 4G module at first, then control GPIO to switch SIM card. Then power on 4G module
in 8sec.
LED Control
cd /sys/class/gpio
echo N > export (N for GPIO value. Signal LED indicators for 4,5,45. Error LED indicator for
46. WLAN LED indicator for 44)
echo out > gpioN/direction (N for GPIO value. Signal LED indicators for 4,5,45. Error LED
indicator for 46. WLAN LED indicator for 44. Direction for output)
echo 1 > gpioN/value (N for GPIO value. Signal LED indicators for 4,5,45. Error LED indicator
for 46. WLAN LED indicator for 44. value 1 for WLAN LED Light on)
echo 0 > gpioN/value (N for GPIO value. Signal LED indicators for 4,5,45. Error LED
indicator for 46. WLAN LED indicator for 44. value 0 for WLAN LED Light off)
Extend GPIO to Control DI/DO
GPIO 0~1
cd /sys/class/gpio (PL2303 driver file patch exports gpiochip508)

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
11
echo 508 > export (508 for DI 1. gpio508/value for input signal. 1 for low level. 0 for high
level)
echo 509 > export (509 for DI 2. gpio509/value for input signal. 1 for low level. 0 for high
level)
GPIO2
echo 510 > export (510 for DO. gpio510/value for output signal. 1 for low level. 0 for high
level)
3.2 Interface(8PINs) indication
The RS232 port is used to debugging OpenWrt.
Pin
Indication
Note
1
V+
Vin+ (Nonpolar)
2
V-
Vin- (Nonpolar)
3
GND
GND

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
12
4
PC_RXD/485-B
RX
5
PC_TXD/485-A
TX
6
Digital_IN_1
Digital Input (I/O1)
7
Digital_IN_2
Digital Input (I/O2)
8
Digital_Output
Digital Output I/O
PINs DB9(Female)
Serial port properties
Properties
Note
Baud rate
115200bps
Data bits
8
Stop bits
1
Parity bits
none
Flow control
none
3.3 OpenWrt Configuration
3.3.1 OpenWrt Source Code Libraries
1)git clone https://github.com/openwrt/openwrt.git
2)cd openwrt; git bracn -a
3)git checkout -b openwrt-18.06 origin/openwrt-18.06
Especially, please download openwrt v18.06. The v19.07+Ethernet driver will cause system crash.
3.3.2 Feeds.conf.default to add modem management tool
src-git mobile_broadband
PINs
DB9(Female)
V+
V-
GND
----
5
RX
----
2
TX
----
3
DI-1
DI-2
DI-3

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
13
https://gitlab.freedesktop.org/mobile-broadband/mobile-broadband-openwrt.git
The embedded modem supports MBIM, QMI/ECM and PPP connection.
src-git luci_proto_modemmanager
https://github.com/nickberry17/luci-proto-modemmanager.git
This function is to add the Mobile Data function in the LUCI interface. The Makefile may report an
error because it does not conform to the rules. It needs to replace The leading spaces with TAB in
the new rule.
3.3.3 make menuconfig to choose ZBT-WE3526 version
1)Target System (MediaTek Ralink MIPS) --->
2)Subtarget (MT76x8 based boards) --->
3)Target Profile (MediaTek MT7628 EVB) --->
3.3.4 make menuconfig to choose modem management tool and
qmi/mbim driver
1) LUCI
Protocols --->
<*> luci-proto-modemmanager. Support for ModemManager
<*> luci-proto-qmi. Support for QMI
2) Network --->
WWAN --->
<*> comgt. Option/Vodafone 3G/GPRS control tool
<*> umbim. Control utility for mobile broadband modems
<*> uqmi. Control utility for mobile broadband modems
-*- modemmanager...... Control utility for any kind of mobile broadband modem
3.3.5 Custom Kernel
3.3.5.1 Modify firmware volume and partition size
1) <openwrt>/target/linux/ramips/image/mt76x8.mk
2) <openwrt>/target/linux/ramips/dts/MT7628.dts

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
14
3) <openwrt>/target/linux/ramips/dts/MT7628.dts
3.3.5.2 Modify debugging serial port baudrate
<openwrt>/target/linux/ramips/dts/mt7628an.dtsi
3.3.5.3 GPIO Control
Define GPIO and remove GPIO multiplex:
<openwrt>/target/linux/ramips/dts/MT7628.dts

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
15

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
16
3.3.5.4 PL2303 serial port HXD GPIOs DI/DO
1) Kernel patch file
pl2303-gpio-sysf
s.patch
2) Modify driver module Makefile
3.3.6 Enable 4G module
The SIM2 is available as default SIM in the original firmware. There are 3 types of 4G connection
as Mobile Data Connection, QMI Connection and PPP Connection. However, it’s alternative
between the Mobile Data connection and PPP connection.
3.3.6.1 Mobile Data Connection

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
17

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
18
3.3.6.2 QMI Cellular Connection

WL- R220(MTK) OpenWrt Router Quickstart
www.wlink-tech.com
19
3.3.6.3 PPP Connection
Other manuals for WL-R220 Series
1
This manual suits for next models
3
Table of contents
Other W-Link Network Router manuals

W-Link
W-Link WL-G500 Series User manual

W-Link
W-Link WL-G510 Series User manual

W-Link
W-Link R520 series User manual

W-Link
W-Link WL-R320 Series User manual

W-Link
W-Link WL-R100 Series User manual

W-Link
W-Link WL-R210 Series User manual

W-Link
W-Link WL-R210 Series User manual

W-Link
W-Link WL-R200 Series User manual

W-Link
W-Link WL-G520 Series User manual

W-Link
W-Link WL-G200 Series User manual