How to enable broadband connection with Huawei E3372h on Ubuntu Server
Important note: after entering this «question» I did some testing and realized I am able to enable the broadband connection with newer version of Ubuntu Server — 15.10. The procedure is described below. Anyway, the reason why it does not work in 14.04.04LTS is not known to me (maybe the functionality is not covered in its kernel version) I have Huawei E3372H which I set to «modem» mode, so it does not do NAT and behaves as a modem. It works with Ubuntu 15.10 (desktop). Network manager shows possibility for creating a broadband connection and I just fill APN «internet» and that’s it — after enabling this connection it works perfectly. But how to connect my Ubuntu Server 14.04 on to the internet using this USB stick when there is no NetworkManager installed? Here is some basic info about the stick: lsusb shows it as:
Bus 002 Device 009: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard
wwx001e101f0000 Link encap:Ethernet HWaddr 00:1e:10:1f:00:00 BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
I tried following this (https://johnlewis.ie/mobile-broadband-from-the-command-line-in-ubuntu/) procedure, but unfortunately I ended with no success:
Apr 9 16:32:32 test_server pppd[20296]: pppd 2.4.5 started by jim, uid 0 Apr 9 16:32:33 test_server chat[20298]: abort on (BUSY) Apr 9 16:32:33 test_server chat[20298]: abort on (VOICE) Apr 9 16:32:33 test_server chat[20298]: abort on (NO CARRIER) Apr 9 16:32:33 test_server chat[20298]: abort on (NO DIALTONE) Apr 9 16:32:33 test_server chat[20298]: abort on (NO DIAL TONE) Apr 9 16:32:33 test_server chat[20298]: send (ATZ^M) Apr 9 16:32:33 test_server chat[20298]: expect (OK) Apr 9 16:32:33 test_server chat[20298]: ^M Apr 9 16:32:33 test_server chat[20298]: OK Apr 9 16:32:33 test_server chat[20298]: -- got it Apr 9 16:32:33 test_server chat[20298]: send (AT+CGDCONT=1,"IP","internet"^M) Apr 9 16:32:34 test_server chat[20298]: expect (OK) Apr 9 16:32:34 test_server chat[20298]: ^M Apr 9 16:32:34 test_server chat[20298]: ^M Apr 9 16:32:34 test_server chat[20298]: OK Apr 9 16:32:34 test_server chat[20298]: -- got it Apr 9 16:32:34 test_server chat[20298]: send (ATDT*99#^M) Apr 9 16:32:34 test_server chat[20298]: expect (CONNECT) Apr 9 16:32:34 test_server chat[20298]: ^M Apr 9 16:32:34 test_server chat[20298]: ^M Apr 9 16:32:34 test_server chat[20298]: CONNECT Apr 9 16:32:34 test_server chat[20298]: -- got it Apr 9 16:32:34 test_server chat[20298]: send (^M) Apr 9 16:32:34 test_server pppd[20296]: Script /usr/sbin/chat -v -f /etc/chatscripts/pap -T *99# finished (pid 20297), status = 0x0 Apr 9 16:32:34 test_server pppd[20296]: Serial connection established. Apr 9 16:32:34 test_server pppd[20296]: using channel 10 Apr 9 16:32:34 test_server pppd[20296]: Using interface ppp0 Apr 9 16:32:34 test_server pppd[20296]: Connect: ppp0 /dev/ttyUSB0 Apr 9 16:32:35 test_server pppd[20296]: sent [LCP ConfReq ] Apr 9 16:33:02 test_server pppd[20296]: message repeated 9 times: [ sent [LCP ConfReq ]] Apr 9 16:33:05 test_server pppd[20296]: LCP: timeout sending Config-Requests Apr 9 16:33:05 test_server pppd[20296]: Connection terminated. Apr 9 16:33:06 test_server pppd[20296]: Modem hangup
Edit: I found out working procedure, but unfortunately it works just on my desktop with Ubuntu 15.10:
echo -e "AT^NDISDUP=1,1,\"internet\"\r" > /dev/ttyUSB0 dhclient -v wwx001e101f0000
—> Using the commands above will bring up working mobile broadband on wwx001e101f0000 ethernet interface. Unfortunately on my Ubuntu Server 14.04 via command dhclient -v wwan0 an ip address is not provided although the modem is connected to the LTE network (blue light on). It is very strange. Edit2: I found out the issue is most likely in Ubuntu 14.04 kernel version. I did a test — installed new «test» Ubuntu Server 14.04 just for this test — the behavior was exactly the same as on my «production» Ubuntu Server 14.04 — no IP acquired using dhclient wwan0 . Then I installed new «test» Ubuntu Server 15.10 and in this installation it works perfectly. So I assume from some reason this ncm interface does not work properly. I noticed this difference between the 2 servers: Ubuntu 14.04 Dmesg:
Apr 9 19:32:13 ubuntu kernel: [27410.720039] usb 1-4: new high-speed USB device number 18 using ehci-pci Apr 9 19:32:13 ubuntu kernel: [27410.861148] usb 1-4: New USB device found, idVendor=12d1, idProduct=1506 Apr 9 19:32:13 ubuntu kernel: [27410.861154] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Apr 9 19:32:13 ubuntu kernel: [27410.861159] usb 1-4: Product: HUAWEI_MOBILE Apr 9 19:32:13 ubuntu kernel: [27410.861163] usb 1-4: Manufacturer: HUAWEI_MOBILE Apr 9 19:32:13 ubuntu kernel: [27410.898395] option 1-4:1.0: GSM modem (1-port) converter detected Apr 9 19:32:13 ubuntu kernel: [27410.898552] usb 1-4: GSM modem (1-port) converter now attached to ttyUSB0 Apr 9 19:32:13 ubuntu kernel: [27410.943023] huawei_cdc_ncm 1-4:1.1: MAC-Address: 00:1e:10:1f:00:00 Apr 9 19:32:13 ubuntu kernel: [27410.943029] huawei_cdc_ncm 1-4:1.1: setting rx_max = 16384 Apr 9 19:32:13 ubuntu kernel: [27410.968250] huawei_cdc_ncm 1-4:1.1: cdc-wdm0: USB WDM device Apr 9 19:32:13 ubuntu kernel: [27410.968657] huawei_cdc_ncm 1-4:1.1 wwan0: register 'huawei_cdc_ncm' at usb-0000:00:1a.7-4, Huawei CDC NCM device, 00:1e:10:1f:00:00
Apr 9 22:29:20 ubuntu kernel: [ 64.269728] usb 2-1.2: new high-speed USB device number 7 using ehci-pci Apr 9 22:29:20 ubuntu kernel: [ 64.367373] usb 2-1.2: New USB device found, idVendor=12d1, idProduct=1506 Apr 9 22:29:20 ubuntu kernel: [ 64.367379] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Apr 9 22:29:20 ubuntu kernel: [ 64.367382] usb 2-1.2: Product: HUAWEI_MOBILE Apr 9 22:29:20 ubuntu kernel: [ 64.367384] usb 2-1.2: Manufacturer: HUAWEI_MOBILE Apr 9 22:29:21 ubuntu kernel: [ 64.459900] usbcore: registered new interface driver usbserial Apr 9 22:29:21 ubuntu kernel: [ 64.459910] usbcore: registered new interface driver usbserial_generic Apr 9 22:29:21 ubuntu kernel: [ 64.459918] usbserial: USB Serial support registered for generic Apr 9 22:29:21 ubuntu kernel: [ 64.507601] usbcore: registered new interface driver option Apr 9 22:29:21 ubuntu kernel: [ 64.507614] usbserial: USB Serial support registered for GSM modem (1-port) Apr 9 22:29:21 ubuntu kernel: [ 64.507691] option 2-1.2:1.0: GSM modem (1-port) converter detected Apr 9 22:29:21 ubuntu kernel: [ 64.507963] usb 2-1.2: GSM modem (1-port) converter now attached to ttyUSB0 Apr 9 22:29:21 ubuntu kernel: [ 64.535895] usbcore: registered new interface driver cdc_ncm Apr 9 22:29:21 ubuntu kernel: [ 64.542625] usbcore: registered new interface driver cdc_wdm Apr 9 22:29:21 ubuntu kernel: [ 64.579935] huawei_cdc_ncm 2-1.2:1.1: MAC-Address: 00:1e:10:1f:00:00 Apr 9 22:29:21 ubuntu kernel: [ 64.579940] huawei_cdc_ncm 2-1.2:1.1: setting rx_max = 16384 Apr 9 22:29:21 ubuntu kernel: [ 64.587318] huawei_cdc_ncm 2-1.2:1.1: NDP will be placed at end of frame for this device. Apr 9 22:29:21 ubuntu kernel: [ 64.587427] huawei_cdc_ncm 2-1.2:1.1: cdc-wdm1: USB WDM device Apr 9 22:29:21 ubuntu kernel: [ 64.587579] huawei_cdc_ncm 2-1.2:1.1 wwan0: register 'huawei_cdc_ncm' at usb-0000:00:1d.0-1.2, Huawei CDC NC M device, 00:1e:10:1f:00:00
So in Ubuntu 15.10 there are additional «usbcore» and «usbserial» entries logged and also eth interface wwan0 is being renamed to wwx001e101f0000. I will try to upgrade kernel of my Ubuntu 14.04 to the higher version and will check whether it will work there. Important note: When doing my tests I installed Ubuntu Server 14.04.2 iso image. This one had older 3.x kernel version. Now I downloaded 14.04.4 from Ubuntu website and after installation I can see it had kernel 4.2. Interesting is on my «production» server I have Ubuntu Server version 14.04.4, but the Kernel there is 3.16: Welcome to Ubuntu 14.04.4 LTS (GNU/Linux 3.16.0-53-generic x86_64) . I update the server on regular basis, but it looks from some reason linux-generci-lts-wily is included in the downloaded 14.04.4, but is not present in my 14.04.4 which had been several times updated. New installation of 14.04.4:
$ sudo dpkg -l linux-generic-lts-* Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-=============================-===================-===================-================================================================ ii linux-generic-lts-wily 4.2.0.27.21 amd64 Complete Generic Linux kernel and headers
So apt-get install linux-generic-lts-wily solved the problem on my Ubuntu Server — it installed 4.2 kernel and with this one it works properly.
Using Huawei E3372h with Lubuntu
I have set up my Orange Pi One board to work with LTE modem and described my steps here. Now I need to get it all to work.
This guide is not a quick recipe, but shows the road which leads to the goal.
LTE modem Huawei E3372h
In Lubuntu 14.04, the modem creates three devices: /dev/ttyUSB0-2. They all seem to work with AT commands. So what is the purpose?
As far as I understand, the intention may be:
- /dev/ttyUSB0 is for regular AT communication: send SMS, receive SMS, register etc
- /dev/ttyUSB1 is for LTE modem connection
- /dev/ttyUSB2 — yet unknown
Playing with the modem
orangepi$ minicom -D /dev/ttyUSBx # where x is device number
To get out of Minicom: ctrl+a, ctrl+q
Receiving text messages
at+cmgf=1 # sets sms format to plain text OK at+cmgl="all" # lists all saved text messages +CMGL: 0,"REC UNREAD","+48604166022",,"16/08/15,10:40:09+08" Test sms OK
Setting up LTE connection
LTE data connection works only with /dev/ttyUSB1 (in my case at least.) It took some experimenting to find that out. For me it had been obvious that it should have worked with /dev/ttyUSB0.
Setting up LTE connection comes in two steps:
- adding APN for internet; in my case (Polish Play network) the following AT command does the job:
Setting up WvDial
WvDial is a dialing tool. It can connect automatically and then setup a ppp connection. To get it working, a setup is needed. In file /etc/wvdial.conf add configuration for Play network:
[Dialer play] Modem = /dev/ttyUSB1 Baud = 115200 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 Init3 = AT+CGDCONT=1,"IP","internet" Stupid Mode = 1 ISDN = 0 Dial Command = ATD Modem Type = Analog Modem New PPPD = yes Phone = *99***1# Stupid mode = yes Username = "blank" Password = "blank"
This configuration is based on a collection of posts and experimenting. In one of the posts I found they connected to /dev/ttyUSB2.
- Init1: ATZ just sets default configuration
- Init2: ATQ0… jest some popular settings like echo etc
- Init3: defines the APN used later in the dial command
- Phone: *99***1# 99 dials internet, 1 at the end is the APN number defined in Init3
orangepi$ sudo wvdial play
and a new connection should be established. Following is a sample correct output of the command:
--> WvDial: Internet dialer version 1.61 --> Initializing modem. --> Sending: ATZ ATZ OK --> Sending: ATQ0 V1 E1 S0=0 ATQ0 V1 E1 S0=0 OK --> Sending: AT+CGDCONT=1,"IP","internet" AT+CGDCONT=1,"IP","internet" OK --> Modem initialized. --> Sending: ATD*99***1# --> Waiting for carrier. ATD*99***1# CONNECT 150000000 --> Carrier detected. Starting PPP immediately. --> Starting pppd at Mon Aug 15 17:21:13 2016 --> Pid of pppd: 2548 --> Using interface ppp0 --> pppd: [02] . --> local IP address 31.175.112.105 --> pppd: [02] --> remote IP address 10.64.64.64 --> pppd: [02] --> primary DNS address 89.108.202.20 --> pppd: [02] --> secondary DNS address 89.108.195.20 --> pppd: [02]