‘Mobile Broadband’ on the Pandora?

One of the little things I have been asked several times is can people use Mobile Broadband (GPRS/UMTS/HSDPA etc.) USB adaptors on the Pandora (in Europe we are lucky enough to have easy and fairly cheap access to cellular broadband tariffs).

While the real answer to this is ‘most probably’ with some caveats about Linux support for your chosen adaptor, USB 2 device support etc. etc. I decided to try and get my own adaptor working on my Pandora development board and this is a post about that exercise.

It is worth remembering that I am messing with the my own development images and this should not be considered anything ‘official’, it is just me having a hack about for the hell of it.

What adaptor am I using?

For this exercise I am using my Huawei E220. It has been upgraded with the 7.2Mbps firmware (version 11.117.09.04.00).

Under Windows this will appear as a USB CDROM (well CDFS on a USB Mass Storage device for the pedantic) and then prompt you to install the included software to drive the modem side of the adaptor. It is all actually quite tidy to be honest and makes use of the device pretty painless on Windows.

How is it connected?

Unfortunately my USB stick is a USB 1.1 full speed (USB OHCI) device so connecting it straight to the Pandora gets us nowhere. Remember the USB host socket on the Pandora is an EHCI (i.e. USB2 high speed) host so it needs a hub inline to step down to USB 1.1 speeds.

So out comes a USB hub and into a hub port goes the USB stick.

What happened?

Well, the first time I plugged it in (as you might imagine) not a lot happened other then the USB stack spitting out some info about the device and installing the mass storage side of things.

usb 1-2.4: new full speed USB device using ehci-omap and address 7
usb 1-2.4: configuration #1 chosen from 1 choice
scsi4 : SCSI emulation for USB Mass Storage devices
usb 1-2.4: New USB device found, idVendor=12d1, idProduct=1003
usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2.4: Product: HUAWEI Mobile
usb 1-2.4: Manufacturer: HUAWEI Technologies
usb-storage: device found at 7
usb-storage: waiting for device to settle before scanning
usb 1-2.4: USB disconnect, address 7
usb 1-2.4: new full speed USB device using ehci-omap and address 8
usb 1-2.4: configuration #1 chosen from 1 choice
usb-storage: probe of 1-2.4:1.0 failed with error -5
usb-storage: probe of 1-2.4:1.1 failed with error -5
scsi7 : SCSI emulation for USB Mass Storage devices
usb 1-2.4: New USB device found, idVendor=12d1, idProduct=1003
usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2.4: Product: HUAWEI Mobile
usb 1-2.4: Manufacturer: HUAWEI Technologies
usb-storage: device found at 8
usb-storage: waiting for device to settle before scanning
scsi 7:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
sr0: scsi-1 drive
sr 7:0:0:0: Attached scsi CD-ROM sr0
sr 7:0:0:0: Attached scsi generic sg0 type 5
usb-storage: device scan complete

After a little bit of quick research it became obvious that the device is supported by the default usbserial.ko kernel module in 2.6.20>.
 

Ok, a quick check of the shipped kernel modules shows that I forgot to build that into the image so off I trek back to my OpenEmbedded build system and after a quick edit to the defconfig for our kernel recipe and a bump of the kernel package revision I now have a nice usbserial.ko included in the image.

After deploying the new image I plugged it in and things got a whole lot more interesting. A couple of /dev/ttyUSB devices had been created, just what every modem connection needs.

usb 1-2.4: new full speed USB device using ehci-omap and address 4
usb 1-2.4: configuration #1 chosen from 1 choice
scsi1 : SCSI emulation for USB Mass Storage devices
usb 1-2.4: New USB device found, idVendor=12d1, idProduct=1003
usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2.4: Product: HUAWEI Mobile
usb 1-2.4: Manufacturer: HUAWEI Technologies
usb-storage: device found at 4
usb-storage: waiting for device to settle before scanning
usb 1-2.4: USB disconnect, address 4
usb 1-2.4: new full speed USB device using ehci-omap and address 5
usb 1-2.4: configuration #1 chosen from 1 choice
usb-storage: probe of 1-2.4:1.0 failed with error -5
usb-storage: probe of 1-2.4:1.1 failed with error -5
scsi4 : SCSI emulation for USB Mass Storage devices
usb 1-2.4: New USB device found, idVendor=12d1, idProduct=1003
usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-2.4: Product: HUAWEI Mobile
usb 1-2.4: Manufacturer: HUAWEI Technologies
usb-storage: device found at 5
usb-storage: waiting for device to settle before scanning
usbcore: registered new interface driver usbserial
usbserial: USB Serial support registered for generic
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial Driver core
usbserial: USB Serial support registered for GSM modem (1-port)
option 1-2.4:1.0: GSM modem (1-port) converter detected
usb 1-2.4: GSM modem (1-port) converter now attached to ttyUSB0
option 1-2.4:1.1: GSM modem (1-port) converter detected
usb 1-2.4: GSM modem (1-port) converter now attached to ttyUSB1
usbcore: registered new interface driver option
option: USB Driver for GSM modems: v0.7.2
scsi 4:0:0:0: CD-ROM            HUAWEI   Mass Storage     2.31 PQ: 0 ANSI: 2
scsi 4:0:0:0: Attached scsi generic sg1 type 5
usb-storage: device scan complete
Driver 'sr' needs updating - please use bus_type methods
sr0: scsi-1 drive
Uniform CD-ROM driver Revision: 3.20
sr 4:0:0:0: Attached scsi CD-ROM sr0
ISO 9660 Extensions: Microsoft Joliet Level 1
ISOFS: changing to secondary root

ls /dev/ttyUSB*

/dev/ttyUSB0  /dev/ttyUSB1

The first thing that jumps out at me is why the kernel has helpfully installed the Option driver when this it not an option card ‘option: USB Driver for GSM modems: v0.7.2’. That does not look right but lets give it a try anyway.

After a quick read it seems that if you don’t have any other USB serial devices connected the modem will be assigned to /dev/ttyUSB0 and the user interface device to /dev/ttyUSB1. So far so good.

Now to wrap all this up and see if we can connect to the Internet.

It is worth noting at this point that our images currently have NetworkManager 0.7.0 in them as I have been evaluating that for managing the WiFi connection (along with Connman) so my plan is to see just how good the NetworkManager integration with the underlying adaptor is using the command line tools (I do not have the nm-applet GUI working with 0.7.0 yet).

So I booted up the resulting image on the Pandora, plugged the USB stick in to the hub and waited a few seconds for that to settle and get connected then started to setup the connection.

netm-cli -l
GSM Devices:
ttyUSB0:
        Udi: /org/freedesktop/Hal/devices/usb_device_12d1_1003_noserial_if0_serial_usb_0
        Driver: option
        Capabilities:
                - Supported
        State: Disconnected
        Managed: True
        IP config:
                No IP settings found

Excellent, ok, NetworkManager sees that we have a ttyUSB0 GSM device. Now lets try connecting to the internet with it using my Vodafone SIM.

netm-cli --connect --gsm=ttyUSB0 --user=web --passwd=web --apn=internet --number=*99#
Device ttyUSB0: activating the connection
Device ttyUSB0: created connection '/org/freedesktop/NetworkManager/ActiveConnection/1'
/org/freedesktop/NetworkManager - State: Connecting
Device ttyUSB0: state - Prepare
Device ttyUSB0: state - Config
Device ttyUSB0: state - Need Auth
Device ttyUSB0: state - IP Config
/org/freedesktop/NetworkManager - State: Connected
Device ttyUSB0: state - Activated
/org/freedesktop/NetworkManager/ActiveConnection/1 - State: Activated

Wonderful, NetworkManager has talked to the modem and negotiated a connection to the internet.

Sparking up a Firefox session on the Pandora proves this and shows that it is working just fine. FTP and all the usual IP services are all working as expected. The connection has been up for a good few hours now and seems very stable.

So, what does this all prove. Well Mobile Broadband sticks (at least the Huawei E220) will work on the Pandora, NetworkManager is happy to configure the connection and as soon as I can get the NetworkManager 0.7.0 GUI going this whole process should be ‘plug and play’ just like it is on other major distributions like Ubuntu.

I am not 100% sure at this stage about choosing NetworkManager or Connman for the final images (it is rather dependent on some tweaks that need doing to our TI1251 Wireless driver to properly support Linux Wireless Extensions and further stability/signal tests) but either way NetworkManager will be available in the Pandora repositories and, as proven here, provides a perfectly viable and quick way to connect to Mobile Broadband if you have supported hardware.

John

4 Comments


  1. Very cool. Happen to have a Vodafone (Huawei) a which I’d been planning to use. Now why did you need a hub? USB 1.0/1.1 should work just fine in a USB 2.0 port – shouldn’t they?! Its going the other way around you need a hub -> e.g. USB 1.1 port->USB 2.0 hub->USB 2.0 device. Of course thats no quicker…


    1. Not quite, the Pandora USB 2 host PHY is EHCI only (i.e. USB2 high-speed) so to connect 1.0/1.1 (OHCI/UHCI) devices a hub is needed to deal with the step down side of things.
      Whilst what you say is normaly true in the case of the Pandora the USB2 host port only natively supports USB2 high-speed devices (hence the need for a hub to do the step down).

      That said, I have been testing a Huawei E160 I bought over the weekend and I am happy to report that it is all but identical to the E220 with one important difference, it is natively a USB2 high-speed device so no hub is needed, you just plug it into the Pandora and away you go.



Comments are closed.