Activate USB support - USB modem

Thank you everybody who contributed! I appreciate all your help!

I noticed that I did not have any USB listed in /dev.
So I installed kmod-usb-uhci, kmod-usb-ohci and kmod-usb2.
Now I see ttyUSB0, 1 and 2 under /dev (cd /dev then ls).

I also noticed that cat /sys/kernel/debug/usb/devices lists the USB modem (ZTE Mobley).

T:  Bus=02 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=0117 Rev=50.33
S:  Manufacturer=ZTE,Incorporated
S:  Product=ZTE Technologies MSM
S:  SerialNumber=(removed)
C:* #Ifs= 3 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=83(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=85(I) Atr=03(Int.) MxPS=  10 Ivl=32ms
E:  Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms

I also installed usbutils, and lsusb gives me the following:

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 19d2:0117 ZTE WCDMA Technologies MSM
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Just a note: the modem is plugged in the "USB 1" port, not "USB 2" (label in the router). Shouldn't it list in Bus 001, or Bus 002 Device 001? Just out of curiosity.

Using lsusb -t, I get:

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Vendor Specific Class, Driver=option, 480M
    |__ Port 1: Dev 2, If 1, Class=Vendor Specific Class, Driver=option, 480M
    |__ Port 1: Dev 2, If 2, Class=Vendor Specific Class, Driver=option, 480M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=ehci-platform/1p, 480M

dmesg gives the following:

[   14.427664] usbcore: registered new interface driver option
[   14.433558] usbserial: USB Serial support registered for GSM modem (1-port)
[   14.441151] option 2-1:1.0: GSM modem (1-port) converter detected
[   14.447715] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
[   14.454989] option 2-1:1.1: GSM modem (1-port) converter detected
[   14.461507] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
[   14.468785] option 2-1:1.2: GSM modem (1-port) converter detected
[   14.475341] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2

I also installed comgt.

Now I think I need to create the interface pointing to this USB device, correct? I just don't know if it's "usb0", "usb1". Sorry, not really a linux user.

UPDATE:
I configured wan interface (file /etc/config/network using vi editor) to:

config interface 'wan'
        #option ifname 'eth0.2'
        #option proto 'dhcp'
        option proto '3g'
        option device /dev/ttyUSB2
        option service umts
        option apn broadband
        option delay 30

I also installed package luci-proto-3g so I can configure it via LuCI interface.

I see that wan interface is connected and there is tx and rx active, so looks like the modem is successfully connected.
In my computer (connected via ethernet cable) I have connection, but wireless (2.4 and 5 Ghz) there is no internet.

UPDATE:
I rebooted and I seem to have Internet now, wired and wireless.

I just would like help to know how separate things are. I understand that the connection between the router and USB modem (interface wan?) should be separate from the wired and wireless connections to the router (interface lan?). What about the IPs? The USB modem assigns a IP to the router (acting as a client), correct? The router assigns IPs to wired and wireless clients. Are these IP in the subnet? Is it possible for me to put them in the same subnet so I can access my USB modem admin page (192.168.1.1) from my computer?

Also, the LEDs for USBs are off. Is it possible to configure OpenWRT to use the leds to show the TX/RX of the USB Modem? That would be cool so I can see the activity of the usb modem.

Thanks again!

I am bit confused what you write...
3g dongle is runnning now.../?/ do you see ip address of it in luci?

If yes, the issue is solved

Update:
After reading your text i think you mean this:

  • usb modem gets ip from providet, firewall area is wan
    It is client

  • your wired and AP wireless must be bridged == it is the "same" thing
    Firewall area is lan, you must enable dhcp for this, define address and range
    Of ip provided to clients, normally something like 192.168.8.1 range from 100 limit 5 users....

I resume this thread for a similar problem: I would use a 3G USB dongle (ZTE MF667) with a DGN3500 router equipped with OpenWrt 18.06.1.
I followed this guide from the wiki: I installed the packages comgt kmod-usb-serial kmod-usb-serial-option kmod-usb-serial-wwan usb-modeswitch (also luci-proto-3g)and the modem seems to be recognized by the system.

lsusb

Bus 001 Device 002: ID 19d2:1268 ZTE WCDMA Technologies MSM
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

cat /sys/kernel/debug/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 4.09
S:  Manufacturer=Linux 4.9.120 dwc2_hsotg
S:  Product=DWC OTG Controller
S:  SerialNumber=1e101000.ifxhcd
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=19d2 ProdID=1268 Rev= 0.00
S:  Manufacturer=ZTE,Incorporated
S:  Product=ZTE WCDMA Technologies MSM
S:  SerialNumber=MF6670ZTED010000CP261718N5N0QU5OM7E8_35161H2D&&&&&&&&&&&&&&&&&&0
C:* #Ifs= 6 Cfg#= 1 Atr=c0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=84(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
E:  Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option
E:  Ad=86(I) Atr=03(Int.) MxPS=  64 Ivl=2ms
E:  Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
I:* If#= 5 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=(none)
E:  Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=88(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms

dmesg | grep usb

[    0.241168] usbcore: registered new interface driver hub
[    0.246534] usbcore: registered new device driver usb
[    4.689612] usb 1-1: new high-speed USB device number 2 using dwc2
[   13.723835] usbcore: registered new interface driver usbserial
[   13.728508] usbcore: registered new interface driver usbserial_generic
[   13.734974] usbserial: USB Serial support registered for generic
[   13.782814] usbcore: registered new interface driver cdc_ether
[   14.007041] usbcore: registered new interface driver rndis_host
[   14.058439] usbcore: registered new interface driver option
[   14.062870] usbserial: USB Serial support registered for GSM modem (1-port)
[   14.076167] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   14.088961] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   14.101728] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
[   14.114557] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB3
[   14.127405] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB4

This is my etc/config/network

config interface '3G'
        option proto '3g'
        option apn 'tre.it'
        option ipv6 'auto'
        option peerdns '0'
        option dns '208.67.222.222 8.8.8.8'
        option service 'umts'
        option delay '30'
        option device '/dev/ttyUSB2'
        option auto '0'

But this is the result...failed connection. I don't know how to debug further...

Thu Dec 20 22:27:23 2018 daemon.notice netifd: Interface '3G' is setting up now
Thu Dec 20 22:27:23 2018 kern.info kernel: [  132.507448] rtl8366rb rtl8366rb: applying initvals from DTS
Thu Dec 20 22:27:25 2018 daemon.notice pppd[1640]: pppd 2.4.7 started by root, uid 0
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: abort on (BUSY)
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: abort on (NO CARRIER)
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: abort on (ERROR)
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: report (CONNECT)
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: timeout set to 10 seconds
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: send (AT&F^M)
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: expect (OK)
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: AT&F^M^M
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: OK
Thu Dec 20 22:27:26 2018 local2.info chat[1641]:  -- got it
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: send (ATE1^M)
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: expect (OK)
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: ^M
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: ATE1^M^M
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: OK
Thu Dec 20 22:27:26 2018 local2.info chat[1641]:  -- got it
Thu Dec 20 22:27:26 2018 local2.info chat[1641]: send (AT+CGDCONT=1,"IP","tre.it"^M)
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: timeout set to 30 seconds
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: expect (OK)
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: ^M
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: AT+CGDCONT=1,"IP","tre.it"^M^M
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: OK
Thu Dec 20 22:27:27 2018 local2.info chat[1641]:  -- got it
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: send (ATD*99***1#^M)
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: expect (CONNECT)
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: ^M
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: ATD*99***1#^M^M
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: CONNECT
Thu Dec 20 22:27:27 2018 local2.info chat[1641]:  -- got it
Thu Dec 20 22:27:27 2018 local2.info chat[1641]: send ( ^M)
Thu Dec 20 22:27:27 2018 daemon.info pppd[1640]: Serial connection established.
Thu Dec 20 22:27:27 2018 kern.info kernel: [  136.115576] 3g-3G: renamed from ppp0
Thu Dec 20 22:27:27 2018 daemon.info pppd[1640]: Using interface 3g-3G
Thu Dec 20 22:27:27 2018 daemon.notice pppd[1640]: Connect: 3g-3G <--> /dev/ttyUSB2
Thu Dec 20 22:27:58 2018 daemon.warn pppd[1640]: LCP: timeout sending Config-Requests
Thu Dec 20 22:27:58 2018 daemon.notice pppd[1640]: Connection terminated.
Thu Dec 20 22:27:59 2018 daemon.notice pppd[1640]: Modem hangup
Thu Dec 20 22:27:59 2018 daemon.info pppd[1640]: Exit.

Could you help me?

That looks like it is good on your end, but the phone company is not sending any ppp data.

Are you using the correct APN? I don't know a lot about how GSM works.

My advice on these is always to get it working on a Linux desktop or laptop and examine the log to see which drivers are involved and what to expect when it connects.

1 Like

A bit late here but it might be worth.

I have C7 V2 that runs zte modens (MF79S), I needed to install the following packages:

kmod-usb-net-rndis
kmod-usb-net-cdc-ether

My modem monts on eth2 (you have ti check if your modem is rndis), so I also created eth2 and added to zone wan:

/etc/config/network
config interface 'wanzte'
        option proto 'dhcp'
        option ifname 'eth2'

/etc/config/firewall
config zone 'regra_003'
        option name 'wan'
        list network 'wan'
        list network 'wanzte'
        option input 'REJECT'
        option output 'ACCEPT'
        option forward 'REJECT'
        option masq '1'
        option mtu_fix '1'

You can check that running ifconfig -a maybe. I'm not that sure it will appear there.

This works fine but for some reason it's not working when the usb modem is connected at boot in version Openwrt 18. I have to disconnect the usb stick and connect again. In version 15 it was working fine at boot.