I was recently in Sweden where we are doing a large project that I one day hope to tell every one of my three readers about in detail, but for now suffice it to say that they will have lots and lots of bandwidth in the coming months. However, in the apartment where I stay when I am there, there is no broadband network access, so they loaned me a mobile broadband modem.
Since Ubuntu is my distro of choice and the modem, the Hauwei E173, is fairly old, I figured it would just be “plug and play”. Jeff, who also visits the client, uses Fedora and said he had no problems.
However, when I inserted the device, nothing happened, or at least nothing appeared to happen.
I did manage to get it working, somewhat, so I thought I’d share my experience in case it helps someone else.
Now, what is supposed to happen, I believe, is that the device should show up in Network Manager as a Mobile Broadband device. I could never get this to work. During my investigation I found out that when you initially plug in the device it is mounted as a USB hard drive, and a program called “usb_modeswitch” is supposed to change it to a modem. Most of the information I found on the web was on getting that to work, but after a lot of trial and error it appears that it is working – Network Manager is just not picking up the change.
The device appears like this:
Bus 003 Device 002: ID 12d1:1446 Huawei Technologies Co., Ltd. E1552/E1800 (HSPA modem)
and dmesg shows the following output:
[ 4374.333592] usb 3-2: new high-speed USB device number 2 using xhci_hcd
[ 4374.354876] usbserial_generic 3-2:1.0: generic converter detected
[ 4374.355374] usb 3-2: generic converter now attached to ttyUSB0
[ 4374.355636] usbserial_generic 3-2:1.1: generic converter detected
[ 4374.355875] usb 3-2: generic converter now attached to ttyUSB1
[ 4374.362284] Initializing USB Mass Storage driver...
[ 4374.362498] usbcore: registered new interface driver usb-storage
[ 4374.362505] USB Mass Storage support registered.
[ 4375.436354] generic ttyUSB0: generic converter now disconnected from ttyUSB0
[ 4375.436478] usbserial_generic 3-2:1.0: device disconnected
So it looks like the device is attached as a usb-storage device and then disconnected.
How I managed to get it to work, somewhat, was to install the “wvdial” program. First, I created a file called /etc/wvdial.conf:
[Dialer defaults]
Modem = /dev/ttyUSB0
[Dialer telia]
Modem = /dev/ttyUSB0
Baud = 115200
Init2 = AT+CGDCONT=1,"IP","online.telia.se"
Phone = *99#
Username = *
Password = *
New PPPD = yes
Auto DNS = 1
[Dialer pin]
Modem = /dev/ttyUSB0
Baud = 115200
Init1 = AT+CPIN=xxxx
where “xxxx” is replaced with the PIN for the device, and now when I run “wvdial telia” I get the following output:
# wvdial telia
--> WvDial: Internet dialer version 1.61
--> Initializing modem.
--> Sending: ATZ
ATZ
OK
--> Sending: AT+CGDCONT=1,"IP","online.telia.se"
AT+CGDCONT=1,"IP","online.telia.se"
OK
--> Modem initialized.
--> Sending: ATDT*99#
--> Waiting for carrier.
ATDT*99#
CONNECT
--> Carrier detected. Waiting for prompt.
--> Don't know what to do! Starting pppd and hoping for the best.
--> Starting pppd at Fri May 10 07:43:25 2013
--> Pid of pppd: 887
--> Using interface ppp0
--> local IP address 90.x.x.x
--> remote IP address 10.64.64.64
--> primary DNS address 195.67.199.27
--> secondary DNS address 195.67.199.28
At this point, I can use Thunderbird for mail and Chrome/Firefox to browse the web. To stop the session I just hit ctrl-C in that window:
^CCaught signal 2: Attempting to exit gracefully...
--> Terminating on signal 15
--> Connect time 42.0 minutes.
--> Disconnecting at Fri May 10 08:25:29 2013
Now certain programs, such as Empathy, that seem to check with Network Manager on whether or not there is a network connection, don’t work. But for the small amount of time I find myself in the apartment and in need of network access, it will do.
Hope this helps, and if anyone has suggestions on what I’ve done wrong with Network Manager, let me know. Note that I am running Ubuntu 12.04 LTS on my laptop – perhaps it works better with later versions.