R761's commentary

13 February 2011

3G USB internet

Filed under: Linux, Mobile Broadband, Ubuntu, Uncategorized — r761 @ 11:52 pm

I recently purchased a vodafone USB mobile broadband adaptor. While NetworkManager identified it as a mobile broadband device, it did not work consistently. After much experimentation I found that pppconfig was simple to configure, and the pon and poff worked reliably.


Run: sudo pppconfig
Connection name: provider
Phone number: *99#
Device: /dev/gsmmodem
Username and password: anything, they do not matter as they are not used

Once configured you can connect to the internet by running pon and disconnect by running poff.


For a while I’ve been looking for a mobile broadband solution for occasional use at limited cost. Recently Dick Smith Electronics had a pre-pay special of a USB wireless modem and 15 GB with 1 year expiry for half the normal price.  The long expiry gives me the flexibility to use several GB one month, and nothing during other months. Unfortunately there was no easy way to know if the modem would work before I had purchased it.

Once home I opened the package. The instructions included the APN which I thought was a good sign. (I later discovered that this APN didn’t work.)

On connecting the modem it appeared to be recognised. lsusb describes the device as:

Bus 001 Device 005: ID 19d2:1009 ONDA Communication S.p.A.

Syslog had a message about USB mass storage device, but I couldn’t find a drive to mount. I later discovered that the device initially presents its self a USB mass storage device with windows drivers in a .exe. Once these are installed they tell the device to go out of mass storage mode in become a modem. Under Linux this switch is handled automatically by usb-modeswitch – which explains why all I was able to see was the modem.


The modem presents 5 devices: /dev/ttyUSB0 to /dev/ttyUSB4 . NetworkManager appears to randomly pick one of these devices. I noticed that when it picked ttyUSB3 it worked, but picking anoher device it didn’t work. The driver appears to know which device to use as it creates a symbolic link from /dev/gsmmodem to ttyUSB3 . As far as I could tell there is no way to tell NetworkManager which device to use. This means that NetworkManager is useless for this device – so I needed a better way to connect.

When the automagic of Gnome or KDE makes things less reliable it is time to return to basics – pon, poff, and pppconfig. What parameters should I configure? /dev/gsmmodem is the obvious device. Some googling revealed that dialing *99# will connect using the previous APN

APNs and dailing numbers

With the help of the Gnome Mobile Broadband configuration tool I found out the the correct APN to use for pre-pay mobile broadband from vodafone in Australia is vfprepaymbb. The modem stores the recently used APNs. These can be viewed by using a serial terminal (such as screen /dev/gsmmodem) to type the command at+cgdcont. You don’t have to specify or know the APN to connect – dialing *99# will connect using the most recently used APN. Once you have successfully connected using the modem (with any operating system) you can then just dial *99# to connect.

Create a free website or blog at WordPress.com.