Editing USB networking
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
- | + | {{Midgard article}} | |
- | |||
- | + | 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 | |
- | + | ||
- | + | * 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. | ||
+ | * ... | ||
- | Please | + | 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. |
- | |||
- | + | = USB statusbar plugin = | |
+ | The [https://garage.maemo.org/projects/usb-otg-plugin/ usb-otg-plugin] applet puts an applet right in the menu that not only lets you set up USB networking tablet-side, but switch between host and client mode. This is the easy way to do things and no other tablet-side configuration is required. | ||
- | + | = Tablet 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. | |
- | + | ||
- | In normal circumstances, the USB Mass storage driver had control of the | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | NOTE: After installing USB networking you should setup a dummy access pointby running the following: | |
+ | gconftool -s -t string /system/osso/connectivity/IAP/DEFAULT/type DUMMY | ||
- | + | After running this, you will see a "DEFAULT" connection appear in the connection manager. | |
- | + | == 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 [[root access]] for information. | ||
<pre> | <pre> | ||
Line 47: | Line 37: | ||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
NAME=usbnet | NAME=usbnet | ||
- | DESC="USB Networking for Nokia | + | DESC="USB Networking for Nokia 770" |
INITFILE=/etc/init.d/$NAME | INITFILE=/etc/init.d/$NAME | ||
Line 59: | Line 49: | ||
if [ "$USBNET" = "" ] | if [ "$USBNET" = "" ] | ||
then | then | ||
- | echo " | + | echo "entering Ethernet via USB mode (g_ether)..." |
insmod /mnt/initfs/lib/modules/$KERNEL_VERSION/g_ether.ko | insmod /mnt/initfs/lib/modules/$KERNEL_VERSION/g_ether.ko | ||
- | echo " | + | echo "waiting, then starting up the usb0.." |
sleep 1 | sleep 1 | ||
/sbin/ifup usb0 | /sbin/ifup usb0 | ||
else | else | ||
- | echo " | + | echo "already in Ethernet-via-USB mode..." |
- | echo " | + | echo "try ping 192.168.2.15" |
fi | fi | ||
;; | ;; | ||
Line 84: | Line 74: | ||
exit 0 | exit 0 | ||
</pre> | </pre> | ||
- | |||
- | |||
- | + | 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: | ||
<pre> | <pre> | ||
- | |||
iface usb0 inet static | iface usb0 inet static | ||
address 192.168.2.15 | address 192.168.2.15 | ||
netmask 255.255.255.0 | netmask 255.255.255.0 | ||
- | + | broadcast 192.168.2.255 | |
+ | up route add default gw 192.168.2.14 | ||
</pre> | </pre> | ||
+ | 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. | ||
- | + | = 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. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ==Linux== | |
- | + | ===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. | |
- | + | ||
- | + | ||
- | ==== | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
<pre> | <pre> | ||
Line 135: | Line 108: | ||
... | ... | ||
CONFIG_USB_USBNET=m | CONFIG_USB_USBNET=m | ||
- | |||
- | |||
- | |||
</pre> | </pre> | ||
- | + | The Linux usbnet configuration is show above. | |
- | + | *Fedora You can locate this information by looking at the config* files in your grub /boot partition. | |
- | + | *Debian | |
- | + | *Ubuntu | |
- | + | *Suse | |
- | + | ===Fedora=== | |
- | + | Fedora supports Ethernet USB gadgets out-of-the-box. To configure the USB networking: | |
- | + | ||
* Connect the tablet with g_ether.ko loaded to your Linux PC | * Connect the tablet with g_ether.ko loaded to your Linux PC | ||
* Open System -> Administrate -> Network (or run system-config-network from command line). | * Open System -> Administrate -> Network (or run system-config-network from command line). | ||
* Press the "New" button to create a new network interface. Select "Ethernet" network card type. | * Press the "New" button to create a new network interface. Select "Ethernet" network card type. | ||
- | * On the next screen, select the "Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget (usb0 | + | * On the next screen, select the "Netchip Technology, Inc. Linux-USB Ethernet/RNDIS Gadget (usb0)". |
- | * Choose "Static IP address" and enter | + | * Choose "Static IP address" and enter an IP address for your PC. Please choose a unused IP subnetwork for USB networking, otherwise it won't work. For example, make your PC 192.168.99.1 and your tabled 192.168.99.2. Don't fill the gateway field on the Fedora machine. |
* Fill other settings (DNS etc) if you want to, then press "Finish". | * Fill other settings (DNS etc) if you want to, then press "Finish". | ||
Now reconnect the tablet to PC and the interface should automatically configure. | Now reconnect the tablet to PC and the interface should automatically configure. | ||
- | + | ===Debian=== | |
+ | There is another howto located here: [[USB Networking with Debian]] 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. | |
- | + | ==Windows== | |
+ | |||
+ | '''WARNING''' | ||
+ | Currently there is a bug in the g_ether.ko driver of ITOS2008 (both 4.0.1 and 4.1) which prevents USB networking from working correctly with Windows machines (but not with Linux machines). See [https://bugs.maemo.org/show_bug.cgi?id=3243 this bug] for details. The bug was introduced somewhere between kernels 2.6.18 and 2.6.21, so ITOS versions based on 2.6.18 kernels (e.g. ITOS2007 and earlier) will work. | ||
+ | |||
+ | That said, nothing prevents you from trying the instructions below, but be warned that most likely you won't succeed unless bug #3243 is solved. | ||
+ | |||
+ | ===Requirements=== | ||
+ | *Windows XP SP2 contains the required .sys files. | ||
+ | |||
+ | *Windows 2000, you will need to download the RNDIS drivers from http://www.microsoft.com/whdc/device/network/NDIS/rndis.mspx. | ||
+ | |||
+ | *Download the file Nokia770 USB Ethernet RNDIS.inf from here or here It will instruct Windows XP that its built-in RNDIS driver is appropriate for Linux USB networking devices, and the Nokia 770 as such. | ||
+ | |||
+ | *If you are using an N800, skip all the steps below which apply to the N770; the bora distribution supplies a control panel applet called "maemo-statusbar-usbnet". Once installed, the control panel "Maemo-DM" will allow you to change the function of the USB port from "MMC emulation" to a RNDIS emulation of a USB ethernet interface. You will also need to set the WinXP side's IP address to be fixed at 192.168.2.14. | ||
+ | |||
+ | This file is my updated/improved version of linux.inf from gumstix. The original version did not work with the current download for Windows 2000 from above. | ||
+ | |||
+ | I tried these 3 .inf files on a Windows2000 (5.00.2195 SP3) plateform, but none of them reconized the N770 (the list of drivers stays blank after selecting the directory where the .inf and .sys files are)... any ideas ? | ||
+ | |||
+ | *...and of course, as usual, i.e. need to be root / have xterm on the Nokia 770. | ||
+ | |||
+ | ===Setting up your environment on Nokia 770=== | ||
+ | |||
+ | For convenience, I placed the following script /etc/init.d/usbnet on my Nokia: | ||
<pre> | <pre> | ||
- | + | #! /bin/sh | |
+ | # | ||
+ | # Startup script for USBnet (networking, instead of USB Mass Storage behaviour) | ||
+ | # 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) | |
- | + | USBNET="`lsmod | grep g_ether`" | |
- | + | if [ "$USBNET" = "" ] | |
- | + | then | |
+ | echo "entering Ethernet via USB mode (g_ether)..." | ||
+ | insmod /mnt/initfs/lib/modules/current/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 | ||
</pre> | </pre> | ||
- | + | 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: | ||
<pre> | <pre> | ||
iface usb0 inet static | 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 | |
- | + | ||
- | + | ||
- | + | ||
</pre> | </pre> | ||
- | |||
- | + | 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. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | === | + | ===Preparing the Windows host=== |
- | + | When you connect the Nokia to the PC, it will look for a suitable driver. As opposed to the USB mass device mode, Windows will not find a suitable driver by default. Actually, Windows XP comes with built-in support for so called RNDIS devices, but it does not know that the N770 will act as such. Therefore, we need to instruct it to do so: In the driver dialog, choose that you will provide the driver's location. Point it to the directory where you previously downloaded the Nokia770 USB Ethernet RNDIS.inf (or linux.inf) file. It will show you a driver called ''Linux USB Ethernet/RNDIS Gadget''. Install it. | |
- | + | ===Additional step for Windows 2000=== | |
- | + | As mentioned before, Windows 2000 lacks of the basic driver files. So, first unpack RNDIS-USB-Kit_05.exe you have downloaded above (266kB from July 2005). You only need to copy rndismpy.sys (30 KB) and usb8023y.sys (14 KB) from | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | RNDIS USB kit 2005\Drivers\x86fre\sys files | |
- | + | to a folder of your choice, e.g. c:\Drivers\Nokia770_RNDIS. Add Nokia770 USB Ethernet RNDIS.inf to the same folder; this will complete your driver set. As with Windows XP, now just install it from the Device Manager dialog. | |
- | + | A new network card with this name will become visible afterwards. I assume, you know or can figure out how to set up this network adapter. Minimally, set its IP-address to static 192.168.2.14. Optionally activate ICS (Internet Connection Sharing) on your network adapter to share the outside world with your little Nokia. | |
- | === | + | ===Testing the connection=== |
+ | To test the connection, you can either type '''ping 192.168.2.15''' on your PC or vice versa, '''ping 192.168.2.14''' in the xterm. | ||
- | + | For troubleshooting, use '''ifconfig -a''' and route to verify on the Nokia, '''ipconfig /all''' and '''route print'''. | |
- | + | ===Known issues=== | |
+ | As opposed to connecting with a Debian host, I realize some problems when unplugging and replugging the USB cable between the two devices - Windows will indicate a code 10-error indicating that the device could not start properly. The problem seems to be actually on the Nokia side - as rebooting the device helps. So, make sure to first initialize g_ether, then connect the cable and enjoy networking. | ||
- | + | Probably some background service on the N770 interferes with unloading/loading sequence of g_ether and g_mass_storage. i.e. some task mounts/unmounts MMC card when plugging in USB. | |
- | + | ||
- | + | I would highly appreciate any comments on this - Does re-connecting USB work for you? Seems to work fine with XP together with IT2006. | |
- | + | Does anyone know a fix for this? | |
- | + | ===Final remarks=== | |
+ | I have my Nokia 770 now for almost a week. A impressive little Linux box. I like the BT networking as it consumes less battery than WLAN. Now, It is even a USB network card (or even a USB to BT and WLAN dongle). Many of the Howtos here were very useful (especially Swap device, BT networking, BT OBEX,...) So, hope you enjoy my contribution and do not hesitate to add some stuff. | ||
- | + | A few ideas about how to use this feature: I already have OpenSSH on the Nokia. So, if the PC has WinSCP installed, you can browse the Filesystem or copy files to the MMC card (other than the first partition, as it is automatically deactivated when USB is plugged in; however you can re-mount it with | |
- | + | ||
- | + | mount /media/mmc1 | |
- | |||
- | |||
- | |||
- | |||
- | |||
- | + | As I mentioned at the beginning, my PC has the faster USB interface. Now, when I'm connected, I can backup the whole root-fs to my Linux box with maximum performance. | |
- | === | + | <PRE>rsync -avzxlrP <del>delete </del>inplace --numeric-ids / 192.168.8.4:/Nokia770_Backup</PRE> |
+ | |||
+ | Why am I backuping everything? If I ever screw it up again (before SE2006), I hope to be able to use the trick from http://maemo.org/maemowiki/ModifyingRootImage and flash my backup back onto the device. | ||
+ | |||
+ | I will let you guys know ;-) | ||
+ | |||
+ | ===Windows 98 and ME=== | ||
+ | Any chance that these OSes might support USB networking? | ||
+ | |||
+ | Since the first thing I would do with a computer of mine that ran these OSes was to get rid of them I'm talking about other people's computers, and I need to be sure I won't break anything. So I'm not gonna try out stuff myself. | ||
+ | |||
+ | ===Questions about these procedures=== | ||
# So if we have already plugged in our 770 into XP, and it recognized it as a drive, do we need to remove the driver software that makes it appear as a USB drive, and replace it with the USBNet drivers? | # So if we have already plugged in our 770 into XP, and it recognized it as a drive, do we need to remove the driver software that makes it appear as a USB drive, and replace it with the USBNet drivers? | ||
- | #* No, windows | + | #* No, windows will assume it is a different device, so no conflict with the update/storage/network drivers for the Nokia770. |
- | #* However, as stated above: you have to insmod the kernel module on | + | #* However, as stated above: you have to insmod the kernel module on the N770 before you connect the cable! |
- | # When I try to do the above, I get an error stating that the driver I am trying to choose doesn't have anything to do with my hardware. | + | # When I try to do the above, I get an error stating that the driver I am trying to choose doesn't have anything to do with my hardware. |
- | #* Make sure you have activated USB networking on the Nokia side correctly. | + | #* Make sure you have activated USB networking on the Nokia side correctly. I'm also using 2006OS Beta if that makes a difference |
+ | #* Haven't tried with the Beta, but with the official release from 06/30/2006. | ||
# My tablet can now talk to my XP machine, but how do I get out to the rest of the network? | # My tablet can now talk to my XP machine, but how do I get out to the rest of the network? | ||
- | + | Firstly, set up a dummy access point, as described above, so that you can configure the network settings in connection manager for your usbnet connection. This will allow you to configure proxy server access. Secondly, install a proxy on your local machine. Examples include [http://www.proxomitron.info/ proxomitron] or [http://www.handcraftedsoftware.org/ freeproxy]. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
[[Category:Users]] | [[Category:Users]] | ||
+ | [[Category:Midgard wiki]] | ||
[[Category:Wiki page of the day]] | [[Category:Wiki page of the day]] | ||
- | |||
- | |||
- | |||
- |
Learn more about Contributing to the wiki.