Hello following on my previews topic here is how to setup an USB 3G/UMTS/HSDPA modem on this router, in my case the ZTE MF622.

As I was saying, this tutorial is for a ZTE MF622 3G / UMTS / HSDPA USB Modem. With some modifications it can work with others.
It is assumed that the modem is already locked in USB Serial device or modem mode. By default it is not working like this, the AT commands AT+ZOPRT=5 and AT+ZCDRUN=8 enable this feature. AT+ZCDRUN=9 restores the default behaviour. Use hyperterminal or similar to enter this commands (115200 kbps, 8 data bits, parity none, stop bits 1, Flow control None).

Check the AT documentation for your modem for mor details, for example:
http://www.zte.com.au/downloads/USB_Mod … cedure.pdf

I also configured my APN directly in the modem, but that might not be needed, AT+CGDCONT=1,"IP","internet.ptprime.pt","",0,0. comgt (gcom) can also be used to check / set this stuff.

1 - Install needed packages for this modem.

kmod-usb-serial comgt

opkg update
opkg install kmod-usb-serial comgt

2 - Edit the /etc/modules.d/60-usb-serial :

usbserial vendor=0x19d2 product=0x0001 maxSize=4096

Vendor and product ids can be checked with, “cat /proc/bus/usb/devices”.

3 - Reboot or reload usbserial kernel module so that it is detected as a USB serial converter.

dmesg sould give something like this:

USB Serial support registered for generic
usbserial_generic 1-1.3:1.0: generic converter detected
usb 1-1.3: generic converter now attached to ttyUSB0
usbserial_generic 1-1.3:1.1: generic converter detected
usb 1-1.3: generic converter now attached to ttyUSB1
usbserial_generic 1-1.3:1.2: generic converter detected
usb 1-1.3: generic converter now attached to ttyUSB2
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core

4 - Use luci to configure the connection, or uci

Example:

network.wan=interface
network.wan.ifname=eth1
network.wan.proto=3g
network.wan.service=umts
network.wan.apn=internet.ptprime.pt
network.wan.username=username
network.wan.password=verysecretpassword
network.wan.device=/dev/ttyUSB0
network.wan.defaultroute=1
network.wan.peerdns=1
network.wan.pppd_options=-chap
system.wan_led=led
system.wan_led.trigger=netdev
system.wan_led.dev=ppp0
system.wan_led.mode=link tx rx
system.wan_led.name=WAN 3G LED (green)
system.wan_led.sysfs=wndr3700:green:wps

network.wan.pppd_options=-chap does this but you can get the same behaviour while editing /etc/ppp/options and adding:
-chap

My ISP only supports PAP so CHAP has to be disabled in my case.
I also choose to use wps green led to signal the connection status and traffic.

Optional:
Edit /etc/chatscripts/3g.chat, modify apn to:

OK      'AT+CGDCONT=1,"IP","$USE_APN","",0,0'

5 - At this point "ifup wan" and "ifdown wan" should bring your wan interface up and down respectively. Give it a try, if it doesn’t work verify your settings in previews topics
and check log messages.

6 - Enable toggle on ppp 3g / UMTS connection via WPS button

Create /etc/hotplug.d/button/02-wps-toggle_ppp as:

LED="/sys/devices/platform/leds-gpio/leds/`uci get system.wan_led.sysfs`"
LANDEV="`uci get network.wan.device`"

[ "$ACTION" = "released" -a "$BUTTON" = "BTN_1" ] && {
       HOTPLUG="$(cat /proc/sys/kernel/hotplug)"
       (echo /bin/true > /proc/sys/kernel/hotplug)

       [ `uci get network.wan.proto` = "3g" ] && {
                   [ `cat $LED/brightness` -eq 255 ] && STATE="on" || STATE="off"

               case "$STATE" in
                               "on")
                                        ifdown wan
                                        sleep 1
                                        logger `gcom -d $LANDEV -s /etc/gcom/poweroff.gcom`
                               ;;
                               "off")
                                        logger `gcom -d $LANDEV -s /etc/gcom/poweron.gcom`
                                        sleep 1
                                        ifup wan
                               ;;
                   esac
       }
       (echo $HOTPLUG > /proc/sys/kernel/hotplug)
}

/etc/gcom/poweroff.gcom as:

opengt
set com 115200n81
set senddelay 0.02
waitquiet 1 0.2
flash 0.1

:start
send "AT+ZOPRT=6"
send "^m"

waitfor 2 "OK","ERR","ERROR"
if % = 0 goto continue
if % = 1 goto retry
if % = 2 goto retry

:continue
print "Modem turned OFF!\n"
exit 0

:retry
send "AT+ZOPRT=6"
send "^m"

waitfor 2 "OK","ERR","ERROR"
if % = 0 goto continue
if % = 1 goto error
if % = 2 goto error

:error
print "ERROR: Unable to turn OFF Modem!\n"
exit 1

/etc/gcom/poweron.gcom as:

opengt
set com 115200n81
set senddelay 0.02
waitquiet 1 0.2
flash 0.1

:start
send "AT+ZOPRT=5"
send "^m"

waitfor 2 "OK","ERR","ERROR"
if % = 0 goto continue
if % = 1 goto retry
if % = 2 goto retry

:continue
print "Modem turned ON!\n"
exit 0

:retry
send "AT+ZOPRT=5"
send "^m"

waitfor 2 "OK","ERR","ERROR"
if % = 0 goto continue
if % = 1 goto error
if % = 2 goto error

:error
print "ERROR: Unable to turn ON Modem!\n"
exit 1

Good luck