Editing N900 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: | ||
- | This page describes how to enable Networking on the [[ | + | This page describes how to enable Networking on the [[N900]] via [[USB]]. The first part describes how to configure the Nokia N900 as a USB pluggable network device. The second part describes how to configure various platforms to use the Nokia N900 as a network device. This article is based on the Maemo 4.x [http://wiki.maemo.org/USB_networking wiki] for configuring USB networking. |
- | You might want to use the N900 as a USB network device to log into your N900 remotely, or to transfer data from your N900 to another computer, in a situation where wifi or | + | You might want to use the N900 as a USB network device to log into your N900 remotely, or to transfer data from your N900 to another computer, in a situation where wifi or bluetooth are not an option. If you wish to connect your N900 to a Linux machine over TCP/IP, the [http://maemo.org/development/documentation/pc_connectivity/ PC connectivity] section in the Maemo SDK documentation also contains useful information. |
== N900 USB network configuration == | == N900 USB network configuration == | ||
- | + | There is a default USB network interface configuration on Nokia N900. In the file /etc/network/interfaces, you should see a section which looks like this: | |
- | + | ||
- | + | ||
- | There is a default USB network interface configuration on Nokia N900. In the file | + | |
<pre> | <pre> | ||
auto usb0 | auto usb0 | ||
Line 19: | Line 16: | ||
up route del default | up route del default | ||
up route add default gw 192.168.2.14 | up route add default gw 192.168.2.14 | ||
- | |||
- | |||
and | and | ||
up run-standalone.sh dbus-send --type=method_call --system --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:DUMMY uint32:0 | up run-standalone.sh dbus-send --type=method_call --system --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect string:DUMMY uint32:0 | ||
Line 26: | Line 21: | ||
down run-standalone.sh dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true | down run-standalone.sh dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true | ||
- | to properly set/reset the connection manager on connection/disconnection | + | to properly set/reset the connection manager on connection/disconnection |
+ | especially if you have set up a DUMMY network as decribed later. | ||
- | With this default configuration, the N900 USB interface will have the IP address 192.168.2.15, and the remote end will have the IP address 192.168.2.14. By default, the USB network interface on the N900 is configured. You need to install the package usb-network-modules. | + | With this default configuration, the N900 USB interface will have the IP address 192.168.2.15, and the remote end will have the IP address 192.168.2.14. |
+ | By default, the USB network interface on the N900 is configured. | ||
+ | You need to install the package usb-network-modules. | ||
=== Starting USB network mode === | === Starting USB network mode === | ||
- | |||
- | |||
- | |||
Plug one end of the USB cable on the host and the other end into the N900. The N900 will bring up the mode-selection dialog. Select 'PC Suite mode'. | Plug one end of the USB cable on the host and the other end into the N900. The N900 will bring up the mode-selection dialog. Select 'PC Suite mode'. | ||
Line 41: | Line 36: | ||
- | Open a | + | Open a root shell in 'X Terminal' on the N900 and activate the interface by executing the following: |
<pre> | <pre> | ||
sudo gainroot | sudo gainroot | ||
Line 71: | Line 66: | ||
</pre> | </pre> | ||
- | + | ---- | |
+ | To automatically setup usb0 when entering PC suite mode change the last few lines | ||
+ | of /usr/sbin/pcsuite-enable.sh by adding the "ifup usb0" line. | ||
<pre> | <pre> | ||
- | + | logger "$0: sent SIGUSR1 to syncd" | |
- | + | ifup usb0 | |
+ | exit 0 | ||
</pre> | </pre> | ||
- | In fact if you want to use the `Mail to exchange' feature to synchronize mail, calendar or contacts with an exchange server (such as | + | In fact if you want to use the `Mail to exchange' feature to |
- | mode can be achieved | + | synchronize mail, calendar or contacts with an exchange server (such as |
- | once through the | + | google mail) the |
+ | `PC suite mode' might block the exchange. So don't use it when | ||
+ | connected in that mode, choose the `charging only' mode instead. This | ||
+ | mode can be achieved but choosing neither of the offers in the above | ||
+ | menu. Simply tap above the menu to close it. This `charging only' mode | ||
+ | still gives you the usb0 interface provided that you initialized it | ||
+ | once through the `PC suite mode'. | ||
+ | |||
+ | ---- | ||
+ | |||
+ | |||
+ | |||
If you can not ping the outside world (for example: local network works but Google does not), check your routing tables. | If you can not ping the outside world (for example: local network works but Google does not), check your routing tables. | ||
- | <pre> | + | <pre>/home/user # route |
- | /home/user # route | + | |
Kernel IP routing table | Kernel IP routing table | ||
Destination Gateway Genmask Flags Metric Ref Use Iface | Destination Gateway Genmask Flags Metric Ref Use Iface | ||
192.168.2.0 * 255.255.255.0 U 0 0 0 usb0 | 192.168.2.0 * 255.255.255.0 U 0 0 0 usb0 | ||
default 192.168.2.14 0.0.0.0 UG 0 0 0 usb0 | default 192.168.2.14 0.0.0.0 UG 0 0 0 usb0 | ||
- | default * 0.0.0.0 U 0 0 0 gprs0 | + | default * 0.0.0.0 U 0 0 0 gprs0</pre> |
- | </pre> | + | |
If you have a situation like above where the cell network's packets are at a lower default priority, you might have to run the following to fix it: | If you have a situation like above where the cell network's packets are at a lower default priority, you might have to run the following to fix it: | ||
- | <pre> | + | <pre>/home/user # route del default |
- | /home/user # route del default | + | |
/home/user # route | /home/user # route | ||
Kernel IP routing table | Kernel IP routing table | ||
Line 108: | Line 114: | ||
--- google.com ping statistics --- | --- google.com ping statistics --- | ||
3 packets transmitted, 3 packets received, 0% packet loss | 3 packets transmitted, 3 packets received, 0% packet loss | ||
- | round-trip min/avg/max = 236.481/249.929/257.081 ms | + | round-trip min/avg/max = 236.481/249.929/257.081 ms</pre> |
- | </pre> | + | |
- | If after having fixed the routing table you still are not able to ping the outside world try to add a nameserver to | + | If after having fixed the routing table you still are not able to ping |
+ | the outside world try to add a nameserver to /etc/resolv.conf | ||
nameserver 127.0.0.1 | nameserver 127.0.0.1 | ||
Line 119: | Line 125: | ||
=== Stopping USB network mode === | === Stopping USB network mode === | ||
- | |||
This is optional. It is not necessary to stop the interface after unplugging the USB cable. | This is optional. It is not necessary to stop the interface after unplugging the USB cable. | ||
Line 127: | Line 132: | ||
ifdown usb0 | ifdown usb0 | ||
</pre> | </pre> | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
- | |||
=== Fixing the MAC address === | === Fixing the MAC address === | ||
By default, the N900 sets a random MAC address for the USB interface every time you reboot. | By default, the N900 sets a random MAC address for the USB interface every time you reboot. | ||
- | This makes some operating systems ( | + | This makes some operating systems (MacOSX) detect a new device whenever you connect the N900 |
and ask you to configure the network interface. The solutions is to set a fixed MAC address | and ask you to configure the network interface. The solutions is to set a fixed MAC address | ||
<pre> | <pre> | ||
Line 205: | Line 145: | ||
== Host USB Network Configuration == | == Host USB Network Configuration == | ||
+ | The Host configuration is detailed in the Maemo 4.x [http://wiki.maemo.org/USB_networking#Host_USB_Network_Configuration USB Networking wiki]. Please refer to it for details. | ||
- | + | ''FIXME, there is no usb host mode on n900'' | |
- | + | ||
- | + | == Host configuration on Debian Lenny == | |
Create the file in /etc/udev/rules.d/99-nokia-n900.rules and put in the following lines: | Create the file in /etc/udev/rules.d/99-nokia-n900.rules and put in the following lines: | ||
Line 215: | Line 155: | ||
#SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="0421", ATTRS{idProduct}=="01c8", ATTRS{manufacturer}=="Nokia", ATTRS{product}=="N900 (PC-Suite Mode)", NAME="n900p" | #SUBSYSTEM=="net", ACTION=="add", ATTRS{idVendor}=="0421", ATTRS{idProduct}=="01c8", ATTRS{manufacturer}=="Nokia", ATTRS{product}=="N900 (PC-Suite Mode)", NAME="n900p" | ||
- | + | Note that the udev configuration above may not work in Debian squeeze. This rule renames either the usb network interface (usb0) or the usb phone net interface (usbpn0) to interface called n900. Since the two rules above are identical, the choice is made seemingly at random. Making the rules more accurate by adding a DEVPATH key helps: | |
- | + | ||
SUBSYSTEM=="net", ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:1a.7/usb1/1-2/1-2:1.8/net/usb0", ATTRS{idVendor}=="0421", ATTRS{idProduct}=="01c8", ATTRS{manufacturer}=="Nokia", ATTRS{product}=="N900 (PC-Suite Mode)", NAME="n900" | SUBSYSTEM=="net", ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:1a.7/usb1/1-2/1-2:1.8/net/usb0", ATTRS{idVendor}=="0421", ATTRS{idProduct}=="01c8", ATTRS{manufacturer}=="Nokia", ATTRS{product}=="N900 (PC-Suite Mode)", NAME="n900" | ||
SUBSYSTEM=="net", ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:1a.7/usb1/1-2/1-2:1.0/net/usbpn0", ATTRS{idVendor}=="0421", ATTRS{idProduct}=="01c8", ATTRS{manufacturer}=="Nokia", ATTRS{product}=="N900 (PC-Suite Mode)", NAME="n900p" | SUBSYSTEM=="net", ACTION=="add", DEVPATH=="/devices/pci0000:00/0000:00:1a.7/usb1/1-2/1-2:1.0/net/usbpn0", ATTRS{idVendor}=="0421", ATTRS{idProduct}=="01c8", ATTRS{manufacturer}=="Nokia", ATTRS{product}=="N900 (PC-Suite Mode)", NAME="n900p" | ||
- | Your DEVPATH may be different though, depending on which USB port is used on the host computer etc | + | Your DEVPATH may be different though, depending on which USB port is used on the host computer etc. You can use |
- | + | ||
- | + | ||
- | You can use | + | |
udevadm monitor --kernel | udevadm monitor --kernel | ||
while plugging in the N900 to see what is the correct path. | while plugging in the N900 to see what is the correct path. | ||
- | |||
- | |||
- | |||
After adding the udev rules, you have to reload them with: | After adding the udev rules, you have to reload them with: | ||
udevadm control --reload-rules | udevadm control --reload-rules | ||
- | Then edit | + | Then edit /etc/network/interfaces and add: |
<pre> | <pre> | ||
allow-hotplug n900 | allow-hotplug n900 | ||
Line 249: | Line 182: | ||
</pre> | </pre> | ||
- | Now put your | + | Now put your usb cable in the pc and in the n900 and on the host. |
+ | To check that everything is set up properly you can run: | ||
ifconfig n900 | ifconfig n900 | ||
- | + | == Automatic configuration with ubuntu 9.10 == | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
Note: this instructions should be fixed/improved: | Note: this instructions should be fixed/improved: | ||
Line 291: | Line 194: | ||
SUBSYSTEM=="net", ACTION=="add", ENV{ID_USB_DRIVER}=="cdc_phonet", ENV{ID_MODEL}="N900__PC-Suite_Mode", ENV{ID_VENDOR}=="Nokia", NAME="n900pn" | SUBSYSTEM=="net", ACTION=="add", ENV{ID_USB_DRIVER}=="cdc_phonet", ENV{ID_MODEL}="N900__PC-Suite_Mode", ENV{ID_VENDOR}=="Nokia", NAME="n900pn" | ||
- | Then edit | + | Then edit /etc/network/interfaces and add: |
<pre> | <pre> | ||
auto n900 | auto n900 | ||
Line 303: | Line 206: | ||
</pre> | </pre> | ||
- | + | finally you have to fix /etc/init/network-interface.conf, change the line: | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
stop on net-device-removed INTERFACE=$INTERFACE | stop on net-device-removed INTERFACE=$INTERFACE | ||
with: | with: | ||
Line 322: | Line 212: | ||
(Note the difference: net-device-remove'''d''') | (Note the difference: net-device-remove'''d''') | ||
- | + | ||
+ | You have to reload udev rules with: | ||
udevadm control --reload-rules | udevadm control --reload-rules | ||
- | + | Now put your usb cable in the pc and in the n900. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | Now put your | + | |
If you are unable to autoconnect through the networking applet, you may need to manually bring up the interface: | If you are unable to autoconnect through the networking applet, you may need to manually bring up the interface: | ||
Line 336: | Line 222: | ||
If all went fine: | If all went fine: | ||
- | * you should see with | + | * you should see with ifconfig -a two new network interfaces, n900 and n900pn, the first one configured with the proper ip address 192.168.2.15, and should be able to ping the n900. |
- | + | ||
- | + | * the n900 should be able to use the pc internet connection immediately. | |
- | + | == Windows XP == | |
- | + | Windows XP USB networking does not work out of the box, but the old 770 workaround still works. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | Windows USB networking does not work out of the box, but the old 770 workaround still works. | + | |
So follow these steps: | So follow these steps: | ||
- | + | * install the Mad Developer application and start it. | |
- | + | * click on "Manage Usb" and then on "Load g_ether" | |
- | + | * plug the device into the USB port. Windows will ask you to name a device driver for the RNDIS gadget. Select a device driver by hand and choose the linux.inf from the [[USB_networking]] page. | |
- | + | * open a terminal on the N900 and get root e.g. via "sudo gainroot". Type "ifconfig usb0 192.168.0.1" | |
- | + | * Now windows should display the network as connected. Set the PC ip address in the windows connections dialog. | |
- | + | * Now you should be able to ping the device but not the other way round as Windows still filters the traffic. However everything else should work, e.g. MADDE | |
- | + | ||
- | + | ||
- | + | == Mac OS X == | |
- | OS X will detect a new network interface and ask you to configure it. Choose DHCP with manual address and set the IP address to 192.168.2.14 | + | OS X will detect a new network interface and ask you to configure it. |
+ | Choose DHCP with manual address and set the IP address to 192.168.2.14 | ||
- | To use the Internet connection of your Mac via USB networking make sure to enable System Preferences -> Sharing -> Internet sharing for the N900 interface [http://docs.info.apple.com/article.html?path=Mac/10.5/en/8156.html Howto] | + | To use the Internet connection of your Mac via USB networking |
+ | make sure to enable System Preferences -> Sharing -> Internet sharing for the N900 interface | ||
+ | [http://docs.info.apple.com/article.html?path=Mac/10.5/en/8156.html Howto] | ||
- | == | + | == Using the usb networking for maemo apps == |
- | + | By default standard network apps works well with usb networking, while maemo specific apps not. | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | By default | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
+ | Install libicd-network-dummy from Fremantle Nokia-binaries repository or better libicd-network-null from extras-devel, and when | ||
+ | usb networking is up pickup "Dummy network" from the connection manager. | ||
If the dummy network does not show up in the network manager you could run | If the dummy network does not show up in the network manager you could run | ||
the following commands in xterm: | the following commands in xterm: | ||
Line 456: | Line 258: | ||
gconftool-2 -s -t string /system/osso/connectivity/IAP/DUMMY/autoconnect false | gconftool-2 -s -t string /system/osso/connectivity/IAP/DUMMY/autoconnect false | ||
- | |||
- | |||
- | |||
- | |||
Then restart icd2: | Then restart icd2: |
Learn more about Contributing to the wiki.