USB networking

=UsbNetworking=

This page describes how the maemo platform can be turned into a USB network device. There are two parts to this document. The first part of this document describes how to configure the Nokia 770/n800 to be a USB plugable network device. The second part of this document describes how to configure various platforms to use the Nokia 770/n800 as a network device. These are the reasons that you may want to use Usb Networking with the Nokia 770/n800

As with all usb hardware, driver software must installed on the host computer before the usb device is attached. Please make sure that your Nokia 770 is not connected to the computer while performing these steps.
 * Transfer data back and forth between the Nokia 770/n800 and a host computer.
 * Perform remote logins to the Nokia 770/n800 from a host computer.
 * Add a third connectivity tool to the existing WAN and BlueTooth support that the Nokia comes with out of the box.

=Page Status= /!\ Status: Early Draft: Some useful information.

Part I -- Nokia 770/n800 USB Network Environment Configuration http://m770cias.garage.maemo.org/images/usbnet/usbnet_concept_800.png

An usbnet concept image helps to see what the configuration will do. In normal circumstances, the USB Mass storage driver had control of the usb hardware. USBNet will displace the mass storage driver's control of the usb hardware with the g_ether network driver. Until the replacement occurs, the host computer will see the 770/n800 as just another mass storage device or an empty cable.

NOTE: After installing USB networking you should setup DUMMY access point to allow network access from www browser etc. http://maemo.org/maemowiki/DummyIAP

=Start and Stop Script= For convenience, I placed the following script /etc/init.d/usbnet on my Nokia: In order to add this script to your device, you will need root access. Please see HowDoiBecomeRoot or the easier HowDoiBecomeRoot2 for information.


 * 1) ! /bin/sh
 * 2) Startup script for USBnet (networking, instead of USB Mass Storage behaviour)
 * 3) Author: Michael Mlivoncic
 * 1) Author: Michael Mlivoncic

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin NAME=usbnet DESC="USB Networking for Nokia 770" INITFILE=/etc/init.d/$NAME

case "$1" in start)       umount /media/mmc1        umount /media/mmc2        sleep 2        USBNET="`lsmod | grep g_ether`"        KERNEL_VERSION="`uname -r`"        if [ "$USBNET" = "" ]        then           echo "entering Ethernet via USB mode (g_ether)..."           insmod /mnt/initfs/lib/modules/$KERNEL_VERSION/g_ether.ko           echo "waiting, then starting up the usb0.."           sleep 1           /sbin/ifup usb0        else          echo "already in Ethernet-via-USB mode..."          echo "try ping 192.168.2.15"        fi        ;; stop) echo "switching back to USB Mass Storage mode..." echo "removing module g_ether" /sbin/ifdown usb0 sleep 2 rmmod g_ether ;;       printf "Usage: $INITFILE {start|stop}\n" >&2 exit 1 ;; esac

exit 0

Definitely, there is some room for improvement, but it can be used as a startup script or - as I currently do - manually:

sudo /etc/init.d/usbnet start activates the USB-networking while

sudo /etc/init.d/usbnet stop deactivates, i.e. switches back to USB mass storage device mode.

While switching, it is important to have USB disconnected! Otherwise the kernel modules will be blocked.

I found that the usb0 configuration was already there in the SE2005 image on my Nokia. Check /etc/network/interfaces. Otherwise, you need to configure the network on the device by adding the following lines to /etc/network/interfaces on the 770 and comment out or delete the existing usb0-entry:

iface usb0 inet static address 192.168.2.15 netmask 255.255.255.0 broadcast 192.168.2.255 up route add default gw 192.168.2.14

I.e. on the windows side, the USB cable will be 192.168.2.14, the Nokia's side will be 192.168.2.15. Feel free to change that as you like.

=Part II -- Host Platform USB Network Configuration= The Nokia 770/n800 configuration was the focus of part I of the USB Networking document. In part II our attention is turned to the configuration of various host computers.

Common Kernel Issues
The focus of you Linux distribution will determine if you need to support this step or not. If the distro you use has a general purpose Linux kernel configured, then you may not need to worry about usbnet configuration support in the kernel.

... CONFIG_USB_USBNET=m
 * 1) USB Network Adapters
 * 1) USB Network Adapters

The Linux usbnet configuration is show above.

Fedora Core===
 * Fedora You can locate this information by looking at the config* files in your grub /boot partition.
 * Debian
 * Ubuntu
 * Suse

Debian
There is another howto located here: HowToSetUpUsbNetworkingDebian Note that this HOWTO recommends a different IP address configuration. If you don't want to change the config on the device you already setup, substitute 192.168.2.14 for 192.168.2.1 in the guide.

The Platform Document on USB Networking also describes a Debian PC setup.

Win 2000/XP
See instructions

ME/9x
Needs a different driver than above, currently appears to be unsupported.

=Other Notes= It is possible to have the MMC cards available for local use on the device (but not available for the computer) while using USB Networking. See here: How_to_use_both_USB_networking_and_the_memory_card_at_the_same_time

=Attribution= =Michael Mlivoncic=, DrKludge