BandLuxe C120 3G Modem, from Oi Velox Plug
Sunday, December 28, 2008 4:34:54 PM
Supposedly, this modem was supported on Linux. At least this is what the box said. The truth... well... I bet you can imagine.
Introduction
(If you are in a hurry and just want to know a quick solution that works, scroll down to Solution 4: using "Quick startup".)
Let me start by showing you a picture of the modem:

And scanned images from the box itself:


Pay attention to the supported systems! It says it is Designed for Linux, and also has Mac and its Universal binary logo. So, anyone would think this device is supported on all major platforms! Right? Not quite.
I asked a friend to plug this on his MacBook. What happens? A new drive, with Windows-only installation executables and documents... nothing else.
Does it work out of the box in Mac? Nope.
Let me try it on my pretty recent Gentoo/Linux. What do I get? A new USB CD-ROM (over scsi emulation) with Windows-only files... Pretty much the same as in Mac.
Does it work out of the box in Linux? Nope.
So, by know I already know that box has misleading advertisement.
CD contents
Let's take a look at the CD contents:

As you can see, there are drivers for most Windows versions. There are also 3 PDFs: one English manual, one Brazillian Portuguese manual, and a Quick Start Guide. The total of data is about 24MB. There is a section of these manuals that is worth reading:

Note how this table contrasts with the one at the box cover. This one only cites Windows, while the box cover says that both Linux and Mac are also supported. (the text above the table is related to Solution 4: using "Quick startup")
The version.txt file contains the following string: "103017". This string is, actually, the Connection Manager version: "1.03.017". And Connection Manager is the Windows-only software that gets installed with this device.
Exploring this device under Linux
Upon connecting BandLuxe C120 modem, this is what I get on syslog (/var/log/messages as well as dmesg):
hub 7-0:1.0: unable to enumerate USB device on port 4 usb 4-2: new full speed USB device using uhci_hcd and address 4 usb 4-2: configuration #1 chosen from 1 choice scsi5 : SCSI emulation for USB Mass Storage devices usb-storage: device found at 4 usb-storage: waiting for device to settle before scanning usb 4-2: New USB device found, idVendor=1a8d, idProduct=1000 usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 usb 4-2: Product: USB Mass Storage usb 4-2: Manufacturer: BandRich, Inc. usb 4-2: SerialNumber: 000000000002 usb 4-2: reset full speed USB device using uhci_hcd and address 4 scsi 5:0:0:0: CD-ROM BandLuxe CDROM 1.01 PQ: 0 ANSI: 4 scsi 5:0:0:0: Attached scsi generic sg1 type 5 usb-storage: device scan completeAnd after this I get /dev/sg1 on my system.
For some reason I don't understand well (and right now I don't care), I can't mount /dev/sg1:
root# mount /dev/sg1 /mnt/cdrom mount: /dev/sg1 is not a block deviceBut I'm pretty sure it is possible to mount this USB/SCSI/CD-ROM under Linux.
This is the relevant lsusb line:
Bus 004 Device 007: ID 1a8d:1000
Looking for Linux driver
At BandRich's website, I can find the download page for BandLuxe C120. It contains four downloads: a driver for Eee PC (Linux edition); a driver for Linux Fedora 8 (Kernel 2.6.22 or above); a driver for Windows XP(SP2), 2000(SP4), Vista; and a driver for Mac OS X.
Let's take a look at those Linux drivers. First, the Fedora 8 one.
I've downloaded the supposed driver for Fedora 8. The file is Fedora 8.zip. Its contents? Only two files: Fedora 8.pdf and ttyUSBX.pdf. Nice drivers, don't you think so?
Let's hope we have a better luck at the Eee PC driver. The file is EeePC patch.zip. It contains two PDFs and a promising bandluxe-eeepc.tar.bz2 file. Inside this tarball we have 6 files:
10-bandluxe.rules eeepc3g.sh README bandluxe.fdi option-bandluxe.ko vidpid.sed
Basically, that script will patch modules.alias (inside /lib/modules/`uname -r`) using vidpid.sed, replace the kernel/drivers/usb/serial/option.ko with an updated version, add a udev rule at /etc/udev/rules.d/10-bandluxe.rules, and add a hal file at /usr/share/hal/fdi/preprobe/20thirdparty/bandluxe.fdi.
The added udev rule seems interesting and promising:
ACTION!="add", GOTO="hso_end"
# send eject command via usb_storage driver for all BandLuxe Installation CDROM devices
SYSFS{idVendor}=="1a8d", SYSFS{idProduct}=="1000", RUN="/usr/bin/eject /dev/%k"
LABEL="hso_end"
Understanding how this device works
This device, when plugged in, identifies itself as 1a8d:1000 (vendor_id:product_id), which is just a USB Mass Storage. Upon installing the (Windows) drivers and so on, the driver will send a command to the device, which will then change its identification to 1a8d:1002, which is the actual HSDPA modem. This happens because of... can you guess it? Yes, because of Windows!
A USB device can act as many things at the same time. It could, for example, act as both USB Mass Storage and HSDPA modem at the same time. But why it doesn't? Because, in Windows, if one of its "interfaces" does not have a driver, then the entire device is disabled. So... manufacturers came up with this kinda ugly solution: a device that switches between two modes. One mode does not require special drivers (USB Mass Storage) and contains the required drivers for the other mode; and another mode which is the actual device.
One big problem with this is that non-Windows systems are left at their own luck, because the device will be recognized as a USB Mass Storage with useless files. The hope ain't lost, however! There is a tool called usb_modeswitch that will try to send the required command to force the device switch to the desired mode. In fact, it is basically a hack. It uses libusb to connect to the device and sends a hard-coded message. Nothing more. Yeah, a hack. But, yeah, it usually works.
So, my challenge now is finding a way to make BandLuxe C120 switch from product id 0x1000 to 0x1002.
Solution 1: ejecting the CD-ROM
I've contacted Leon Leong, which was the person who sent BandRich-related patches to the main Linux kernel. He explained many things, and I'm going to document those here, in order to help other people who also have this device.
First of all, he said that ejecting the CD-ROM would trigger a mode switch on the device. This explains that udev rule from Eee PC patch above. Unfortunately for me, it didn't work. Murphy seems to be by my side. eject /dev/sg1 did nothing. Leon Leong also told me to try sdparm --command=unlock /dev/sg1 ; sdparm --command=eject /dev/sg1, but no success either.
He then told me that firmware versions 052 or later would support this kind of switch. To see the firmware version I can use the Connection Manager at Windows, or I can send ATI command to the serial port using a program like minicom (after the modem has switched).
According to Connection Manager, my firmware version is 405070_001_014 Sep 05 2007, which seems quite old.
Solution 2: ignoring the device
For firmware version older than 041, you can simply ignore the CDROM.
After 5 seconds, it will automatically switch to the Modem mode.
Please patch the below code to drivers/usb/storage/unusual_devs.h
+UNUSUAL_DEV( 0x1A8D, 0x1002, 0x0000, 0x0000, + "BandRich", + "BandLuxe CDROM USB Device", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_IGNORE_DEVICE ), +
If you use this method, you don't need to modify udev rules.
the old [firmware] version (prior to 041) would kick a timer for 5 seconds, if no SCSI command is received, it will switch automatically.
Guess what? It didn't work for me either...
Upgrading the firmware?
Well, probably a firmware upgrade would be a nice solution. However, to do so, you need to contact support@bandrich.com asking for the new firmware and so on... Why isn't a firmware upgrade available at BandRich download page?
Well, I've decided to not upgrade the firmware (at least not yet), so I can't give you more information.
Solution 3: using usb_modeswitch
Some guy found a quite long sequence of USB commands to trigger a mode-switch for his device. He posted his "solution" to a topic at usb_modeswitch forum. On the other hand, I found a much shorter sequence and posted it to the same forum topic.
Basically, I used SniffUsb 2.0 under Windows to get a copy of all data between Windows and the device. Then, I looked at that huge log and found two messages that did work for me.
usb_modeswitch -v 0x1a8d -p 0x1000 -V 0x1a8d -P 0x1002 -m 0x05 -r 0x82 -M 55534243109298820000000000000600000000000000000000000000000000 usb_modeswitch -v 0x1a8d -p 0x1000 -V 0x1a8d -P 0x1002 -m 0x05 -r 0x82 -M 555342439034a0820000000000000600000000000000000000000000000000Note, however, that these messages only work after usb_storage has detected the device. If, for example, I blacklist usb_storage, or prevent it from attaching itself to the device, then these two USB messages don't work.
Solution 4: using "Quick startup"
This is the easiest solution! It requires a Windows system, but you can use Windows inside a virtual machine with USB support.
Go to Connection Manager.

Click the middle icon, called Menu.

Click on Setting.

Check Quick startup and click Save.

That's it!
This Quick startup thing is a setting saved on the device itself. It will make the device identify itself always as a modem, so no switching will be required! The only drawback is that the device won't be recognized on other Windows machines until the driver is installed, or Quick startup is disabled.
Exploring this device under Linux (now as HSDPA modem)
Now that this device has switched to the modem mode, here are the relevant lines from syslog (/var/log/messages as well as dmesg):
hub 7-0:1.0: unable to enumerate USB device on port 4 usb 4-2: new full speed USB device using uhci_hcd and address 8 usb 4-2: configuration #1 chosen from 1 choice option 4-2:1.0: GSM modem (1-port) converter detected usb 4-2: GSM modem (1-port) converter now attached to ttyUSB0 option 4-2:1.1: GSM modem (1-port) converter detected usb 4-2: GSM modem (1-port) converter now attached to ttyUSB1 option 4-2:1.2: GSM modem (1-port) converter detected usb 4-2: GSM modem (1-port) converter now attached to ttyUSB2 usb 4-2: New USB device found, idVendor=1a8d, idProduct=1002 usb 4-2: New USB device strings: Mfr=1, Product=2, SerialNumber=20 usb 4-2: Product: BandLuxe 3.5G HSDPA Adapter usb 4-2: Manufacturer: BandRich, Inc. usb 4-2: SerialNumber: 0359074010287391And the relevant line from lsusb:
Bus 004 Device 008: ID 1a8d:1002
And now I have three new devices: /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2
For connection, I should configure PPP to use one of the ttyUSB devices (usually, the first one) and dial to *99# number, with empty username and password. If for some reason you can't get sane DNS servers from PPP, you can use the ones from OpenDNS: 208.67.222.222 and 208.67.220.220








Mad Scientist (عادل)qlue # Tuesday, December 30, 2008 1:56:51 PM
Unregistered user # Wednesday, December 31, 2008 10:57:54 AM
Denilson Figueiredo de SáCrazyTerabyte # Wednesday, December 31, 2008 11:14:09 AM
Mad Scientist (عادل)qlue # Wednesday, December 31, 2008 11:48:28 AM
Denilson Figueiredo de SáCrazyTerabyte # Wednesday, December 31, 2008 12:26:32 PM
Of course there is unlocking of 3G modems (and there are some online services that unlock them for a fee), but... things might be a bit more difficult than just asking the mobile operators.
Mad Scientist (عادل)qlue # Wednesday, December 31, 2008 3:36:16 PM
Bare in mind that things may be different in other countries.
Denilson Figueiredo de SáCrazyTerabyte # Wednesday, December 31, 2008 3:54:49 PM
I guess that what they are saying is that "we have no training on how to unlock modems, and we don't even know if it is possible to unlock them".
Yeah, things can be different in different countries.
Unregistered user # Thursday, January 1, 2009 11:56:16 AM
Unregistered user # Thursday, January 15, 2009 11:21:54 PM
Unregistered user # Monday, January 19, 2009 12:32:37 PM
Denilson Figueiredo de SáCrazyTerabyte # Monday, January 19, 2009 3:49:41 PM
Unregistered user # Tuesday, January 20, 2009 8:47:05 AM
Unregistered user # Saturday, February 14, 2009 9:53:25 PM
Unregistered user # Friday, March 20, 2009 4:38:45 PM
Unregistered user # Tuesday, May 19, 2009 4:30:21 AM
Unregistered user # Sunday, May 31, 2009 3:54:37 AM
Denilson Figueiredo de SáCrazyTerabyte # Monday, June 1, 2009 12:04:08 AM
Unregistered user # Monday, June 8, 2009 5:56:33 AM
Unregistered user # Thursday, July 9, 2009 3:31:48 AM
Unregistered user # Friday, August 21, 2009 5:17:41 AM
Unregistered user # Sunday, August 23, 2009 6:49:36 AM
Unregistered user # Monday, November 30, 2009 8:06:35 AM
Denilson Figueiredo de SáCrazyTerabyte # Monday, November 30, 2009 2:23:09 PM
Sorry, I can't. I don't own this device anymore, and all I knew about it is already described in this blog post.
Unregistered user # Monday, March 22, 2010 7:00:11 AM
Denilson Figueiredo de SáCrazyTerabyte # Monday, March 22, 2010 10:22:05 AM
Unregistered user # Monday, April 5, 2010 3:44:48 AM
Unregistered user # Monday, June 14, 2010 5:00:02 AM
Unregistered user # Tuesday, December 28, 2010 8:13:51 AM
Unregistered user # Tuesday, June 21, 2011 9:42:42 AM
Unregistered user # Saturday, December 10, 2011 7:59:56 AM