Sunday, September 13, 2009

AnyDATA ADU-510L CDMA modem settings for Linux

I wrote this tutorial with instructions in English, because not only the Romtelecom subscribers use the AnyDATA ADU-510L high speed CDMA modem. AnyDATA ships their modems worldwide, so that feel free to use my advices wherever you are.

I use an Ubuntu 8.04 distribution because it is a LTS - long term support version of Ubuntu, so that one can feel confident that it is here to stay for years to come :).

If you use any newer Ubuntu distribution, chances are that you will succeed to make the internet connection, too.

Before starting, make sure that you downloaded and installed the packages mentioned in my other post too.

Copy this article in a text file onto your Linux computer, so you can proceed step by step even if you are not connected to internet anymore.

Let's go....

I assume you installed usb_modeswitch where I did, too ( I created an invisible folder called .apps into my main user's folder ). If not, you will put there your own location (but preferably NOT on the desktop).

Open a terminal ( you find it at Applications >> Accesories >> Terminal ) and run :

lsusb

you will see a list, and there appears the usb storage device ( ID 05c6:1000 Qualcomm, Inc.)

cd /home/myusername/.apps/usb_modeswitch-1.0.5

writing instead of "username" your real username there.

this moves you to the folder where is located the file usb_modeswitch-1.0.5

sudo ./usb_modeswitch -v 05c6 -p 1000 -M 5553424312345678000000000000061b000000020000000000000000000000 -m 0x08

( please note that the command above is a SINGLE LINE command line, even if it has spaces between the strings !! use Copy >> Paste so that you don't make mistakes when writing it in terminal )

Insert your password when asked, then press Enter.

This will give you the following message in terminal :

Quote :

Looking for default devices ...
Found default devices (1)
Accessing device 003 on bus 001 ...
Using endpoints 0x08 (out) and 0x87 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
OK, driver found ("usb-storage")
OK, driver "usb-storage" detached

Received inquiry data (detailed identification)
-------------------------
Vendor String: AnyDATA
Model String: CD-ROM
Revision String: 1.00
-------------------------

Device description data (identification)
-------------------------
Manufacturer: AnyDATA Corporation
Product: USB MMC Storage
Serial No.: 000000000002
-------------------------
Setting up communication with interface 0 ...
Trying to send the message to endpoint 0x08 ...
OK, message successfully sent
Device is gone, skipping any further commands
-> Run lsusb to note any changes. Bye.
End quote .

(This means that now the device does not act anymore as storage device. We must to change its operation mode into a serial device.)

sudo modprobe usbserial vendor=0x16d5 product=0x6502

Now let's check again how is seen the device :

lsusb

You will see again a list, and there appear the previous usb storage device, but this time it has a different ID
( ID 16d5:6502 )

Let's check how is registered the device :

dmesg

if the answer is like this one bellow, then everything is fine.

Quote :


[ 548.781761] usb-storage: device found at 4
[ 548.781766] usb-storage: waiting for device to settle before scanning
[ 548.820652] usbcore: registered new interface driver usbserial
[ 548.820872] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered for generic
[ 548.821105] usbcore: registered new interface driver usbserial_generic
[ 548.821109] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial Driver core
[ 548.827207] /build/buildd/linux-2.6.24/drivers/usb/serial/usb-serial.c: USB Serial support registered for GSM modem (1-port)
[ 548.827507] option 1-2:1.0: GSM modem (1-port) converter detected
[ 548.827787] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB0
[ 548.827965] option 1-2:1.1: GSM modem (1-port) converter detected
[ 548.828208] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB1
[ 548.828383] option 1-2:1.2: GSM modem (1-port) converter detected
[ 548.828639] usb 1-2: GSM modem (1-port) converter now attached to ttyUSB2
[ 548.828809] usbcore: registered new interface driver option
[ 548.828813] /build/buildd/linux-2.6.24/drivers/usb/serial/option.c: USB Driver for GSM modems: v0.7.1
End quote .

This means that the device was registered as modem in USB port, and it act as "option" type device, not just simply as some "generic" device.

================= =================

Note : If you see mentioned there only "usbserial_generic" (without "option"), then you must activate the "option" mode of driver with this command :

sudo modprobe -v option

then run again :

dmesg

to check again if "option" mode is activated, as explained above. (end note)

================= =================

Most often this situation mentioned in the Note above ( of installation in "generic" mode ) happens only first time (when you insert and configure first time the device in your computer), when "option" driver is loaded through "modprobe" command.

From now on, you can ignore it (the modem will be configured each time with "option"), so you can proceed to next step : to open the internet connection using gnome-ppp.

And YES, you must switch the device each time you insert it in USB port. (So save this article in your computer and keep it at hand for when you need it next time.)

After you unplug the modem, when you plug it again, it will be seen again as usb-storage, so you must repeat the procedure above (to switch it from "storage" to "modem" device)

@@@@@@@@@@@@@@@@@@@@@@@@@@

How we do connect to internet ?

Very simple :

open the Gnome PPP and use the following settings :

user - given to you by internet provider
password - also, take it from internet provider
number #777 ( or what else is received from your internet provider )

Modem settings (I use them and they work just fine) :

/dev/ttyUSB0 (you must press "Detect" button to access the modem through USB)
USB Modem (obviously !!)
3100000 (write by yourself in that field, and ignore any list of other values from there :) ... )
Tone
Low
10 (or anything you like, better is to be anything more than 5)

Networking :

Dynamic IP
Automatic DNS

Options :

Minimize
Dock

Ignore terminal strings
180

( leave unchecked any other settings there - or you can try at your own risk if you wish, or depending of your own internet provider )
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

That's it !!

Oh, now just press "Connect", and you're online :)

( I posted this blog from my mobile internet connection set as above .)

Friday, September 11, 2009

How to install a CDMA modem in Ubuntu

Let's explain here how to install a HIGH SPEED CDMA modem in Linux.

I use the AnyDATA device, model ADU-510L, but a lot of USB modems can use the same procedure as well.

http://www.anydata.co.kr -> they don't offer any support for Linux distribution, so forget about using manufacturer website.

Instead, try this step by step approach:

Click Places > Home folder, then File > Create folder > .apps, so you just create a new invisible folder here, called .apps (it is invisible because the name ".apps" instead of "apps" .

Its role is to store there for you packages for programs that aren't in repositories yet while still keeping them at hand (for example I put there the firefox 3.5.x packages - because Ubuntu Hardy still does not offer any way to install it through Synaptic or Add/Remove feature because it is not yet added/maintained by Ubuntu community in the repositories, also I keep there AlsaUpgrade newest versions, or usb_modeswitch, etc.)


Let's go on further.

There are two ways to get the job done, one is using some .deb package (maybe a little easier but not so safe) and another one is a do-it-yourself way.

First one needs that you go at Debian repositories page here :

http://packages.debian.org/search?keywords=usb-modeswitch

if you want to download the .deb version of the program called usb-modeswitch that changes the mode usb-storage into usbserial of the AnyDATA device.

You will find there ( as of now ) 2 packages : "squeeze (testing)" and "sid (unstable)".

We could use the testing one (called squeeze), taken from this page :

http://packages.debian.org/squeeze/usb-modeswitch


You can download it and install it in your computer using GDebi Package installer.

However, you must take care that the debian version is 1.0.2 instead of 1.0.5. ( latest one ). The main differences are seen here  :

=========
Version 1.0.5, 2009/08/26
More changes and fixes regarding success check; "--version" option; config "database" updated
Version 1.0.4, 2009/08/23
    Success check bugs (and others) fixed
Version 1.0.3, 2009/08/20
Success check improved; experimental system integration (fully automated), optional; new parameter "TargetProductList" needed for this; other necessary small adaptations; more devices
Version 1.0.2, 2009/06/09
    Some output bugs fixed

(source : http://www.draisberghof.de/usb_modeswitch/index.html#download)
=========

For those of you that want to use the latest version (this is the second way) :

- download the latest version from here http://www.draisberghof.de/usb_modeswitch/index.html#download , which is 1.0.5 ( or any newer one )

- create a new folder in your "home folder" folder, preferably a hidden one, called .apps, where you can store in the future any non-standard applications folders ready to install. ( I already explained you above how to do that. )

- move inside that folder the archived file usb_modeswitch-1.0.5.tar.bz2

- go inside that folder and unpack that archive with Archive Manager . It will create a folder called usb_modeswitch-1.0.5 so that you can now delete the downloaded file and work only with the folder newly created.

- download also this file http://www.draisberghof.de/usb_modeswitch/usb_modeswitch.conf and copy it inside that same folder above. It will replace the older one (the file from extracted archive is a slightly older than this one).

Run

- System > Administration > Synaptic > ( password ) > Search > libusd (Search in "Name") > mark "libusb-dev" for installation > Apply --> that will install libusb-dev which is requested for compiling the files needed for instalation of usb-modeswitch in your Linux computer.

------------------ few technical details of the AnyDATA ADU-510L ----- those needs to be seen into the configuration file:

DefaultVendor=  0x05c6
DefaultProduct= 0x1000

TargetVendor=   0x16d5
TargetProduct=  0x6502

Also, only for reference and 0.x versions :

MessageEndpoint=0x08

MessageContent="5553424312345678000000000000061b000000020000000000000000000000"
---------------------------------------------------------------------------------------------------------------------

(Similar to those above, the usb_modeswitch.conf file has the specific lines for each CDMA modem on the market now. I just have AnyDATA ADU-510L, that's why I mentioned it here. We will need again very soon this info. )

Open a Terminal and write :

cd /home/your-username/.apps/usb_modeswitch-1.0.5

(of course, "your-username" word has to be replaced with YOUR USERNAME there )


sudo make install

then

sudo gedit /etc/usb_modeswitch.conf

( read inside the file usb_modeswitch.conf opened with gedit and delete the ";" signs before DefaultVendor and Product and also TargetVendor and Product and Messages ( as above ), only these 6 lines corresponding to your own modem )

sudo sh ./usb_modeswitch -> it is possible to give some answer "wrong ")" syntax" or alike. ignore it.

dmesg => this will give you a full list of lines, last ones having "full speed USB device" which is ok.

now execute :

sudo modprobe usbserial vendor=0x16d5 product=0x6502 -----> this must load the drivers of the modem, which can be checked running again

dmesg

The modem is set.


Usually, if registering is successful, it reads :

"usbcore: registered new interface driver option" which means that modem is set NOT as "generic", but as it should be actually.

and then "USB Driver for GSM modems" ( in a line similar to this one : /build/buildd/linux-2.6.24/drivers/usb/serial/option.c: USB Driver for GSM modems: v0.7.1 )

This is it.

Modem is installed and set as it should be.

-------

If something goes wrong, please check carefully this page : http://www.draisberghof.de/usb_modeswitch/index.html#trouble

It has all explanations of what can be done ( hopefully you won't need it !! )

( I will write here soon also the messages from terminal and how to connect successfully to the internet ). I also will post here the safest way to succeed the switch (sometimes it does not succeed and modem has to be unplugged and plugged again).