Introduction

USB is far from the ideal medium for network access, if you can get your hands on an ethernet modem you may save yourself some trouble. If you have a modem that can connect both via USB and ethernet you should use the ethernet connection.

To get an eagle-usb modem to work under Dapper, we will use the ueagle-atm driver. The ueagle-atm driver works for modems that use the eagle-usb I, II or III chipsets, from Analog Devices Inc. (ADI).

Compatible modems : Sagem Fast 800, Sagem Fast 840, Sagem Fast 908, Comtrend ct 350, Comtrend ct 361, US Robotics USR9000 Sureconnect, TELINDUS ND 220 ARESCOM, Elcon 111U, Aztech 206U, Dlink DSL-200i , ARESCOM NDS1060, ECI B-FOCuS 150A II, Aethra Starmodem, Huawei SmartAX MT810 ID, Teledat 300 usb, Zoom 5510B, ASUS AAM6000UG

Disclaimer

Several times in this tutorial, you're asked to use the command

gksudo gedit

to edit a text file. If you're using Kubuntu, the command should be

kdesu kate

If you're using Xubuntu, the command should be

gksudo mousepad

Ubuntu 10.10 (Maverick Meercat)

Eagle drivers are now natively included (see linux-firmware changelog). Therefore you don't need to install them anymore : go directly to the "Configuring The Connection" section of this page.

Ubuntu 10.04 LTS(Lucid Lynx) & 9.10(Karmic Koala),6.10(Edgy Eft) & 7.04(Feisty Fawn)

This is a simple and quick guide to setup ueagle-atm(for Sagem Fast 800 and other modems which use the eagle-usb I, II or III chipsets) in Ubuntu 6.10(Edgy Eft) & 7.04(Feisty Fawn) 32bit & 64bit. This method has also been tested and confirmed working with Ubuntu 10.04 and 9.10

Ueagle-atm is build into the Linux kernel which comes with Ubuntu 6.10/7.04. But there is one little problem(not in 7.04), this kernel has enabled the eagle-usb module which conflicts with the ueagle-atm module thus rendering your modem non functional. Now let's start.

Setting up the modem

  1. First of all you need to download the modem firmware from here (use another computer which has Internet access and transfer the file on Ubuntu with a cd/dvd/usb pen/whatever).

  2. Start Ubuntu and plug your modem.
  3. Let's say you saved the file, mentioned above, on your "home" folder (/home/username). Open a Terminal(console) and enter this:

    $ tar -xvzf ueagle-data-1.1.tar.gz
    $ sudo mkdir /lib/firmware/ueagle-atm
    $ cd  ueagle-data-1.1/
    $ sudo cp -a * /lib/firmware/ueagle-atm

    This extracts the firmware files and copies them to the appropriate location.

  4. You don't need to do this step in Ubuntu 7.04(Feisty Fawn).Now it's time to disable the eagle-usb module and remove it. Enter this in the console:

    $ sudo rmmod eagle-usb
    $ sudo rm /lib/modules/`uname -r`/kernel/drivers/usb/net/eagle/eagle-usb.ko

    Note: Each time you update your kernel you have to do only the above step.

  5. Now UNPLUG your modem, wait a few seconds and PLUG it again. After a few seconds(maybe 20-30seconds) the lights on the modem should start to flash and then stay on after a while. If this doesn't happen then you should restart your computer.

  6. To configure your connection scroll down to the title "Configuring The Connection" or click here.

Ubuntu 6.06(Dapper Drake)

This guide is for setting up a USB ADSL modem with the ueagle-atm driver (Sagem Fast 800, ADI eagle-usb chipsets) under Ubuntu 6.06 (Dapper Drake). It has not been tested on Ubuntu 6.10 (Edgy Eft) or newer (since I no longer have access to a compatible modem, or indeed an Ubuntu 6.10 system) therefore, as with anything on the Wiki, your comments and improvements are welcome. This was based on my experience following the forum thread linked at the bottom and is far from complete, if something doesn't work for you then edit this page to leave a comment, and if you know why it doesn't work then please improve the guide.

Getting The Ingredients

This driver is not included on the Ubuntu CDs/DVDs (yet) so we must download it ourselves. Since there is probably no Internet connection on the machine you are installing the driver on it is probably most convenient to get everything we need at once, then transfer them to the Ubuntu machine awaiting the driver using a writable CD, USB drive, etc.

Driver Files

There are two archives we need. The first is the driver itself, which can be found here. The second is the firmware (the instructions which get sent to the modem), it is not Free Software so it is packaged seperately here.

System Tools

The driver comes as source code, which means that the archive you have downloaded can be compiled and run on any Ubuntu machine. However, to compile it you will need some tools which are not installed by default, and since it is a kernel driver you will need some extra information about your kernel called it's "headers". First, to find out which headers you need run the command:

uname -r

which will tell you the kernel version you are using.

If you have an Ubuntu DVD or "alternate" CD handy then pop it into your drive and using Synaptic or some other package manager tool install the packages "build-essential" and "linux-headers-<kernel version>" where <kernel version> is obviously the version of your kernel.

If you don't have access to such a disc then you can get these packages from Ubuntu's package search engine. Remember to get the dependencies of these packages as well (otherwise they won't install).

Building The Driver

Note: If you have the alternative eagle-usb driver installed you should uninstall it now as the two drivers conflict.

To see if it is being used run:

lsmod | grep "eagle"

If it shows the driver then it is running. Stop it with:

sudo rmmod eagle-usb

For more detailed removal instructions see the UsbAdslModem/EagleUsb page (it tells you under the part about reinstalling for new kernels)

So, you now have the tools you need (if you had to transfer the package files onto your system then double clicking on them should launch the GDebi package installer to install them, or alternatively you can try putting them in the folder /var/cache/apt/archives and install them using a package manager to reduce "dependency hell" a little) so you need to build the driver.

Firstly I would highly recommend putting the two gzipped tarballs you have downloaded into a sensible location somewhere in your Home folder, since you will probably need to build them again in the future if (when) you update your kernel.

Once they are in a sensible place you should extract them by selecting them, right clicking and choosing "Extract Here" (and maybe give each new folder a nicer name). Now comes the hardcore bit, open a terminal (in Accessories) and change your directory to the location of the driver files (the first archive you downloaded) with the command:

cd /the/full/path/to/your/driver/files

So in my case I put them in the folder "Files/System/Storage/UEagle-ATM/Driver" in my Home, so the above command for me would be:

cd /home/chris/Files/System/Storage/UEagle-ATM/Driver

NOTE: It is important that the path to the driver has no spaces in it, since not only does it take a little more knowledge of terminals to include spaces in paths, but also the driver will not build! (I found this out the hard way by using a folder called "Modem Driver" and the build problems took me a while to figure out)

Once in there you can build the driver with the command:

sudo make

You will need to enter your regular user password to confirm your identity for running a system task. (Don't worry, your typing is being recognised, it just isn't shown in case someone is looking over your shoulder)

Hopefully that didn't give an error (if it did then try the forums or the driver's wiki), so now you can install it with:

sudo make install

(Since you typed your password a few minutes ago it won't bother asking this time)

If that went well then the driver is installed, but we need to give it the firmware. Change directory to where you put the firmware with:

cd /the/full/path/to/the/firmware/files

We need to put the firmware somewhere nice and accessible, so make a folder for it with the command:

sudo mkdir /lib/firmware/ueagle-atm

Now copy everything from the firmware folder your terminal is in to this new folder with:

sudo cp -a * /lib/firmware/ueagle-atm

That should hopefully be all that is needed to get the modem up, so try loading the driver with:

sudo modprobe ueagle-atm

The lights on your modem should start to flash, then stay on. (If not then check the note above to make sure the older eagle-usb driver is not being used)

Configuring The Connection

Now the modem is working we just need to tell it how to connect to our ISP. This may differ for different service providers, but it works fine for Tiscali connection in the UK and OTEnet connection in Greece.

  1. First run the command:

    gksudo gedit /etc/ppp/peers/ueagle-atm

    And in this file put:

    user "<your username>"
    password "<your password>"
    plugin pppoatm.so <VP>.<VC>
    noipdefault
    usepeerdns
    defaultroute
    persist
    noauth

    Where <your username> is your ISP username and <VP> and <VC> are decimal numbers which vary from country to country, and sometimes between providers. There is a nice list here for some countries. If you don't find there the VP/VC numbers for your country/provider then you should ask your provider.

  2. Now save that file and close it, then run:

    gksudo gedit /etc/ppp/chap-secrets

    There should be one uncommented line (has no "#" in front of it) which reads:

    "<your username>"  "*"  "<your password>"  "*"

    Where obviously <your username> and <your password> are the username and password you use to connect to your ISP respectively. Save this file and close it.

  3. Repeat the same for this file:

    gksudo gedit /etc/ppp/pap-secrets

Note: Don't worry about storing your information into these files because they can be viewed only by privileged users(e.g. root)

Launching the connection

  1. Now to launch the connection type in the console (your modem must be synchronised--> lights on):

    pon ueagle-atm
    To see if this worked(wait 2-3 secs to make the connection) launch your browser and load any page. If the page appears then it worked. Congratulations!!!
  2. To turn off the connection type in the console:

    poff

    or

    poff ueagle-atm

Automating The Connection

Starting At Boot

If your connection works then you can launch it automatically at startup using the regular boot scripts system. To do this you need to create a script, in this case I will call it "modem-startup", so run:

gksudo gedit /etc/init.d/modem-startup

This will open the text editor, and in here you should copy the following:

case "$1" in
  start)
    modprobe ueagle-atm ;
    sleep 60 ;
    modprobe pppoatm ;
    pppd call ueagle-atm    
    ;;
  stop)
    true
  ;;
  *)
    echo "Usage: $0 {start|stop}" >&2
    exit 3
    ;;
esac

This will run the commands following "start)" when this script is run as modem-startup start (this includes a 1 minute wait for the modem to initialise), and will run the program "true" when it is run as modem-startup stop, this makes sure the system knows the script hasn't failed, even though we do not need to do anything special for shutdown. (FIXME: Maybe some different connections do? If so then please add any shutdown commands you use). If the script is run with any options other than start or stop then it will print a usage message and fail.

Save that file and close the text editor. We now need to give superusers permission to execute that file, so run:

sudo chmod u+x /etc/init.d/modem-startup

Now the script is ready we must tell the system to run modem-startup start when the system boots normally, and modem-startup stop when it shuts down or restarts. This is done with the command:

sudo update-rc.d modem-startup defaults

If you also want the connection to start when you enter recovery mode then you can run this command as well:

sudo ln -s /etc/init.d/modem-startup /etc/rc1.d/S20modem-startup

Restarting With A Button

You may want to have an easy way of launching the connection after the system has already started, for instance if you did not have the modem plugged in during boot or if the connection fails (you will usually have to unplug the modem and plug it back in after the connection fails anyway), so to do this we can make another little script and add a menu entry or button to run it. Make the script with the following command:

gkgksudo gedit /usr/local/bin/reconnect-script

Enter into this script the following (assuming you have added it to bootup following the instructions above):

gksudo /etc/init.d/modem-startup start
exit 0

Now save the file and exit the editor, make the file executable with:

sudo chmod 755 /usr/local/bin/reconnect-script

Now you can add an entry into your menu using the Alacarte Menu Editor (in Application>Accessories). For your menu entry you should set the command: box to say reconnect-script, then set the other parameters to whatever you like. If you want a button to do this then you can make the entry in Alacarte, drag it out of the menu onto the panel or desktop, then disable the menu entry in Alacarte. Remember to un/replug your modem before running the script though.

(advanced) Starting automatically with udev

In this setup, the connection will be started automatically when the modem is connected to the USB port, including at boot.

Create the udev rule

find out the USB vendor ID and product ID of your modem: when you insert the modem, you shold see two lines in syslog (see /var/log/messages) like these:

# grep 'ADSL device founded' /var/log/messages
Sep 30 10:56:43 HCE kernel: [ 7618.311170] usb 2-1: [ueagle-atm] ADSL device founded vid (0X1110) pid (0X9022) : Eagle II pots
Sep 30 10:56:47 HCE kernel: [ 7622.149829] usb 2-1: [ueagle-atm] ADSL device founded vid (0X1110) pid (0X9021) : Eagle II pots

the first line is the modem before loading the firmware, the second the modem booting with its firmware (note that the two lines have different pid (product ID)). Your vendor ID an product ID, as well as the firmware chosen (Eagle II pots in this case) may vary. pick up vendor ID and product ID from the second line, and create the /etc/udev/rules.d/91-ueagle-atm.rules file with the following content (substitute product ID and vendor ID from your modem):

ATTRS{idProduct}=="9021", ATTRS{idVendor}=="1110", RUN+="/etc/udev/scripts/ueagle-atm %k"

create the udev script

Create a file named /etc/udev/scripts/ueagle-atm, and copy the following lines. Edit it with the commands needed to start the connection.

(
# wait for syslog to be writable (otherwise it might lock-up at boot)
while [ ! -w /dev/log ]; do sleep 1 ; done ;
sleep 1
if [ ! -f /sys/bus/usb/devices/$1/stat_human_status ]; then
#       logger ueagle-udev[$$][$1]: wrong device
        exit;
fi
logger ueagle-udev[$$][$1]: status is \"$(cat /sys/bus/usb/devices/$1/stat_human_status)\"
while ! grep -q "Modem is operational" /sys/bus/usb/devices/$1/stat_human_status ; do sleep 1 ; done ;
logger ueagle-udev[$$][$1]: status is \"$(cat /sys/bus/usb/devices/$1/stat_human_status)\"

#insert here the commands needed to start the connection
#pppd file /etc/ppp/peers/ueagle-atm
#/etc/init.d/modem-startup start

sleep 5
logger ueagle-udev[$$][$1]: $(ip a s dev ppp0|grep inet|awk '{print "inet "$2", peer "$4 }')
)&

Restart udev

Force udev to re-read its configuration:

udevcontrol reload_rules

To Do

  • Include Gutsy Gibbon instructions.
  • Sort out a few details for connections to make them more generic (Please help with this, since I have it working for my UK Tiscali connection, but cannot test it with others!)
  • removal instructions ("sudo make uninstall" doesn't work)

See also


CategoryNetworking CategoryInternet

UsbAdslModem/ueagle-atm (last edited 2010-10-15 10:50:27 by mohican)