Monthly Archives: July 2009

Ubuntu, SkyLink, AnyData ADU-510A and other troubles

Today we bought an AnyData ADU-510A modem and SkyLink contract. Works in Windows perfectly, but why not to try Linux as well?

Okay, so I boot into Ubuntu 9.04 after successfully connecting from Windows and find some “broadband something connection” in Network Manager. Great. Trying to connect – it fails, and worse, disappears from Network Manager. Then it does not appear anymore no matter what I do. Time for some research.

OK, so this “flip flop” thing actually is not a modem, but a… CD-ROM drive! At least when you connect it. Then on Windows autorun launches something from this “CD”, which magically transforms it into modem and even installs drivers if they are not installed. Nice thing, but I don’t really need a CD-ROM drive in Ubuntu, what I need is modem. OK, I can boot into Windows, do this “transformation”, and then boot into Linux, but that’s somewhat cumbersome. But it works this way. The reason why it couldn’t connect first time was just because I didn’t specify phone number, login and password before connecting. Now, after I did that, it works. But when you turn the PC off or replug the modem for whatever reason, it turns into “CD” again.

So, I need either modem-modeswitch or usb_modeswitch. Both of them are supposed to do that “magical transformation” in Linux. The problem is that they don’t. At least for me. Time for some more research.

OK, so I have to enable option_zero_cd=2 option for usb_storage module. Creating /etc/modprobe.d/usb-storage.conf didn’t seem to work for whatever reason, so I just booted Linux with no device attached, and then did
modprobe usb_storage option_zero_cd=2
Hmm… now it usb_modeswitch just hangs the entire system. “CD-ROM” now detects, but with errors. Not that I have any use for it anyway. Seems like a dead end, but then I found this thread:
http://kerneltrap.org/mailarchive/linux-usb/2009/5/21/5776813/thread
Not that I understood even a half of what it says, but this seemed interesting:

- Option uses the REZERO command (0x01)
- AnyData uses the START/STOP command (eject, 0x1b)
- Samsung uses a command with number 0x16 (not found in specs)

So, eject command, eh? Eject as in “eject cd from the drive”? No joking? Really, what is “eject” command supposed to do for CD-ROM drive that doesn’t even exist? Maybe “eject” it and “inject” a modem instead? It is just might be crazy enough to work:

alqualos@eternity:~$ lsusb
Bus 001 Device 002: ID 04f2:b044 Chicony Electronics Co., Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 004: ID 05c6:1000 Qualcomm, Inc.
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
alqualos@eternity:~$ sudo eject sr1
[sudo] password for alqualos:
alqualos@eternity:~$ lsusb
Bus 001 Device 002: ID 04f2:b044 Chicony Electronics Co., Ltd
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 005: ID 16d5:6502 AnyDATA Corporation
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

No, is that really it? No 3rd-party utilities, no need to recompile the entire kernel?

But it really worked. At least for 1 minute. Then it dropped off. Along with the modem. Replug, eject, reconnect. 1 minute. Drop-off. Damn. Let’s see…

Jul 4 20:50:15 eternity kernel: [ 1147.818112] option 2-1:1.0: device disconnected
Jul 4 20:50:15 eternity pppd[24490]: Modem hangup
Jul 4 20:50:15 eternity pppd[24490]: Connect time 0.6 minutes.
Jul 4 20:50:15 eternity pppd[24490]: Sent 28945 bytes, received 70454 bytes.
Jul 4 20:50:15 eternity kernel: [ 1147.880339] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
Jul 4 20:50:15 eternity kernel: [ 1147.884729] option 2-1:1.1: device disconnected
Jul 4 20:50:15 eternity kernel: [ 1147.885010] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
Jul 4 20:50:15 eternity kernel: [ 1147.885041] option 2-1:1.2: device disconnected
Jul 4 20:50:15 eternity pppd[24490]: Connection terminated.
Jul 4 20:50:15 eternity pppd[24490]: Terminating on signal 15
Jul 4 20:50:15 eternity kernel: [ 1147.979524] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
Jul 4 20:50:15 eternity pppd[24490]: Exit.
Jul 4 20:50:15 eternity kernel: [ 1148.020082] usb 2-1: reset full speed USB device using ohci_hcd and address 9
Jul 4 20:50:16 eternity kernel: [ 1148.193195] option 2-1:1.2: GSM modem (1-port) converter detected
Jul 4 20:50:16 eternity kernel: [ 1148.196748] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB0
Jul 4 20:50:16 eternity kernel: [ 1148.196838] option 2-1:1.1: GSM modem (1-port) converter detected
Jul 4 20:50:16 eternity kernel: [ 1148.196956] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB1
Jul 4 20:50:16 eternity kernel: [ 1148.197014] option 2-1:1.0: GSM modem (1-port) converter detected
Jul 4 20:50:16 eternity kernel: [ 1148.197145] usb 2-1: GSM modem (1-port) converter now attached to ttyUSB2

Oh, so it just reconnects after about a minute, and PPP together with Network Manager just can’t stand it? That’s not good. But then again… Why not to wait another minute? Still connected? Another one… Still connected? So it does this just once? What the hell? Oh, nevermind.

So, from the very beginning:
1. Somehow enable option_zero_cd=2 option on usb_storage. Since modprobe.d doesn’t work, we have to do it manually by booting with no USB storage devices (including the modem) and then doing “modprobe usb_storage option_zero_cd=2”. Or we may try other methods, like /etc/modules or boot scripts…
2. Plug in the device.
3. “eject” it. Use “dmesg” to find out CD-ROM name (sr1 in my case).
4. Watch dmesg and wait until it suddenly disconnects and reconnects. About a minute.
5. Use it! But don’t forget to set up a wirelless broadband connection first!

Still cumbersome but a way better than booting in Windows just to initialize the damn thing.