Tutorial: HOWTO: Configure onboard Ethernet in Ubuntu 9.04 Linux for Roboard

  1. kboyd kboyd is offline Abacus
    Category
    How To, DIY
    Views
    34,357
    Replies
    3
     

    HOWTO: Configure onboard Ethernet in Ubuntu 9.04 Linux for Roboard

    Difficulty
    As easy as reading an article about technology - accessible to anyone!
    Estimated Time
    Expect to spend 30 minutes to complete this tutorial.
    Skills Required
    Ability to throw a 70 yard pass. Kidding! If you can read this line, then you have all of the skill you need.
    Parts Required
    A Roboard running Ubuntu 9.04
    An Ethernet Cable to connect your Roboard to a network
    Optionally, a USB drive may be needed to transfer files from this tutorial to your Roboard
    Tools Required
    1 Keyboard
    1 Monitor
    1 Mouse
    1 Network with a DHCP-enabled, wired ethernet capable network access device (a router, switch, hub, etc) for connecting your Roboard during this tutorial
    Hi!

    OK - So you've got a Roboard running Ubuntu 9.04 - and maybe you have customized the video display to match your monitor. Now what? I'll bet you've been eyeing that onboard Ethernet and wondering "Now how do I get *THAT* to work?" Admit it, you have. There are several different ways to network the Roboard, and there are several different ways to get onboard networking configured correctly. This tutorial will show you two different methods to enable onboard ethernet, and leave it to you to decide which one works best for you.

    Overview:

    I. Choose your own adventure!
    II. Power up Roboard and log into Ubuntu
    III. Configure the network driver module for onboard ethernet
    IV. Test the module
    V. Add the driver module to your Ubuntu system
    VI. Restart networking and check settings for onboard ethernet
    VII. Add driver module to startup text file
    VIII. Enjoy!

    Let's get started!

    I. Choose your own adventure:
    A. Quick install with pre-compiled driver module
    B. Standard install via compiling the driver module from source

    A. Quick install with pre-compiled driver module
    Pros:

    • saves time and effort if you are interested in testing networking
    • a single file is all you will need to transfer via USB drive to the Roboard
    • if you are comfortable with the results, you will not need to compile your own driver

    Cons:

    • If you upgrade your system, you will need a new pre-compiled driver module, or you will need to learn how to compile your own
    • you will miss out on all of the fun of compiling a linux driver module

    Steps to perform:

    1. Download the zipped, pre-compiled ethernet driver module here: r6040.ko

    2. Save r6040.ko to a portable USB drive

    3. Connect the USB drive to your Roboard and power it on

    4. Once you are logged in, drag the zipped file from the USB drive to your desktop (if you have disabled your graphical user interface, temporarily restart it for this tutorial)

    5. Next you will unzip this file. Open a Terminal window and then type:
      cd Desktop
      unzip r6040.ko.zip
      (note that the name of the file will be slightly different because it was uploaded to this tutorial. Type in the name of the zip file as it was saved on your Desktop)

    6. Insert the resulting driver module by typing:
      sudo insmod r6040.ko
      (be sure to remember to supply your password for sudo)

    7. If the insmod command succeeds, then it will not return any messages. If step #6 above results in no error messages, then you can begin the process of adding this driver module to your system. To install this driver in the correct location, type:
      sudo cp r6040.ko /lib/modules/`uname -r`/kernel/drivers/net/
      (be sure to note the backticks " ` " in the above command)

    8. Next you will need to generate the dependencies for this module. Type:
      sudo depmod -a
      (Be patient. This command may take some time to complete.)

    9. To test networking, you will now restart networking by typing:
      sudo /etc/init.d/networking restart
      (Don't forget to plug your Roboard into your DHCP-enabled network access device.)

    10. Your network should automatically assign an address to the Roboard, and you should be able to access the network.

    11. To finish configuring your Roboard to load this module at system startup, add the following command to the end of /etc/modules by typing:
      sudo nano -w /etc/modules

    12. This will start the nano text editor. At the end of the file, type:
      r6040

    13. To save this change and exit nano, press the key combination "Ctrl-X" and then press "Y"


    14. To verify your current setup, you can type:
      ifconfig

      and then press ENTER to see your new network settings. To test your networking connection, try typing:

      ping www.ubuntu.com


      and then press ENTER to initiate a few test pings from your Roboard to the Ubuntu website. You may also want to reboot and run this test again to see if your startup setting changes work as expected.

    15. Congratulations! You have successfully configured Roboard onboard ethernet.



    B. Standard install via compiling the driver module from source
    Pros:

    • Guarantees your hardware will work with your OS installation (provided you have the correct driver source and OS development support files)
    • Provides you with experience that can be used to compile drivers for other devices that you may want to connect to your Roboard
    • Gives you the ability to examine the source code used to create your network interface

    Cons:

    • May seem daunting (but then again you are building a robot, right? )
    • Error messages may provide you with little or no support or direction
    • Who wants to spend time working on their patience level??? This exercise may test you.

    Steps to perform:


    1. Install development support files
      There are two easy ways to install development support files onto your Roboard microSDHC card:
      1) Via USB Ethernet adapter --or--
      2) Via booting a desktop/server machine via your microSDHC card mounted via USB (as we did when configuring your initial Ubuntu Roboard setup.)
      In either scenario, you will end up with a machine that has network connectivity so that you can install these support files via the Internet. Choose either method, log into Ubuntu, open a Terminal window and install the linux kernel header files by typing:
      sudo apt-get -y install linux-headers-`uname -r`

      (Be sure to supply your password and note the use of backticks " ` " in this command)

    2. Next you can install the files used for compiling programs by typing:
      sudo apt-get -y install make patch gcc build-essential

    3. Launch Firefox and you can download the source code for the driver from here: r6040_debian_src.zip

    4. Firefox will store this file on your Desktop by default. Change your working directory to the Desktop, unzip this file, and then move this folder and change to its subdirectory by typing:

      cd Desktop
      unzip r6040_debian_src.zip
      sudo mv r6040 /usr/src/
      cd /usr/src/r6040

      (note that the name of the file will be slightly different because it was uploaded to this tutorial. Type in the name of the zip file as it was saved on your Desktop)

    5. Now we can create this driver module by typing:
      make -f Makefile-2.6 KDIR=/usr/src/linux-headers-`uname -r`

      (This command may take some time to complete while the driver is compiled)

    6. If step 5 completes with no errors then Congrats! Step 6 is go to Step 6 of "Choice A:" to complete the driver install.
    Attached Files


Replies to Tutorial: HOWTO: Configure onboard Ethernet in Ubuntu 9.04 Linux for Roboard
  1. Re: HOWTO: Configure onboard Ethernet in Ubuntu 9.04 Linux for Roboard

    Hi kboyd,

    these are fantastic tutorials, easy to follow and in 2 of 3 cases successful. In details, the installation of the Ubunutu 9.04 on my microSD Card worked very well. The Roboard starts up, no issues. Also the Volari configuration worked perfect as described in your tutorial.

    Now the last tutorial gave me some trouble and I hope you might be able to help out. I tried to configure the Ethernet card with both methods described in your tutorial. When making the new driver it goes successfully with a few warnings but no error. However, when I "insmod" the new r6040.ko I get an error saying: "insmod: error inserting 'r6040.ko': -1 Unknown symbol in module"

    Any idea how to fix this?

    Thanks so much for sharing all this and best regards,

    marsman
        

  2. Re: HOWTO: Configure onboard Ethernet in Ubuntu 9.04 Linux for Roboard

    "When making the new driver it goes successfully with a few warnings but no error. However, when I "insmod" the new r6040.ko I get an error saying: "insmod: error inserting 'r6040.ko': -1 Unknown symbol in module" "


    I have exactly the same problem and cannot complete this driver installation. Does anybody have the solution?
        

  3. h.hittini Guest

    Re: HOWTO: Configure onboard Ethernet in Ubuntu 9.04 Linux for Roboard


Closed Tutorial