kate.alhola | 12 February, 2008 15:56

This is the second part of the USB saga, this is little bit more in deep technical aspects. The next part will then have USB-O-The Go statusbar plugin that will automatize most of hard hand work explained here.
here are two possible ways to connect N810 tablet to network via USB. One is to use USB host mode and USB ethernet adapter and the other is USB slave mode using ethernet gadget driver.
Here are the basic instructions about USB slave-mode networking on maemo.org web pages http://maemo.org/development/documentation/how-tos/4-x/setting_up_usb_networking.html .
The basic setup in USB networking is Linux computer and N810 are connected to each other with a normal USB cable. Using g_ether driver tablet emulates USB networking device isntead of the FAT memory card. USB networking is very useful in many ocassions where WLAN is not availale or usable.
These above mentioned instructions lack some important things. This setup does not work with browser or does not set up dns server address. It also supports only one tablet connection to server.
To be able to use browser, you need to create a dummy IAP so that browser does not ask you to open wlan/bluetooth connection. You can do this entering to su prompt in terminal window command:
gconftool -s -t string /system/osso/connectivity/IAP/DEFAULT/type DUMMYTo be able to use dns services you need also make dnsmasq aware of the usb0 network interface by adding following line to /etc/dnsmasq.conf after similar line for wlanresolv-file=/tmp/resolv.conf.usb0The original example uses static IP addresses configured for usb0 and this configuration is also set in /etc/network/interfaces file as follows :
resolv-file=/tmp/resolv.conf.eth0
auto eth0
iface eth0 inet dhcp
auto usb0
iface usb0 inet static
address 192.168.2.15
netmask 255.255.255.0
gateway 192.168.2.14You should change it using dhcp method to allow your Linux server deliver IP address and dns server address. Notice that the way used in eth0 interface does not work, not even eth0 . The working way is following auto eth0
iface eth0 inet manual
up /sbin/udhcpc -i eth0 -s /etc/udhcpc/udhcpc.script
auto usb0
iface usb0 inet manual
up /sbin/udhcpc -i usb0 -s /etc/udhcpc/udhcpc.script To use your USB networking, you can should use methods descripted in maemo.org documentation
insmod /mnt/initfs/lib/modules/2.6.21-omap1/g_ether.ko
ifup usb0
Next uou need to setup your Linux server. To deliver dhcp address to tablet and have needed bridging functionality you shoud issue following command, in this example, in Ubuntu gutsy:
apt-get install bridge-utils dhcp Then install following lines to /etc/network/interfaces for your usb network interfaces. As many as you will have tablets connectediface usb0 inet manual
up brctl addif br0 usb0
iface usb1 inet manual
up brctl addif br0 usb1You also need to add to your /etc/dhcpd.conf, in domain-name-servers you should put your dns server address if you don't have one running in same machine. subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.20 192.168.2.250;
option domain-name-servers 192.168.2.1;
option routers 192.168.2.1;
option subnet-mask 255.255.255.0;
}And then as a last thing you need to set up your bridged network and masquering with following scriptbrctl addbr br0
ifconfig br0 192.168.2.1
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.2.0/24 -j MASQUERADE
dhcpd br0Now you should have everything set up, just plug your tablets in USB ports of your server and test with ping that connection works.
USB Host mode networking
maemo kernel for N810 has build in driver for Realtek RTL8150 based USB network adapters. To use them you need to use USB On-The-Go mode. In my bog article http://blogs.forum.nokia.com/blog/kate-alholas-forum-nokia-blog/maemo/2008/01/21/usb-on-the-go i tell how to set up USB-OTG. For USB OTG host mode. To use ethernet, you need also the dummy IAP and same modifications decripted above modifications to /etc/network/interfaces and /etc/dnsmasq.conf to get it working. When you plug in adapter, you don't need install driver, just type to super user command prompt
ifup eth0
Kate is maemo chief engineer in Forum Nokia,
She has long Linux/Open Source developer background.
RDF Facets:
qfnZtypeQUqfnTypeZBlogContentQ
qfnZtypeQUqfnTypeZCommunityContentQ
qfnZtypeQUqfnTypeZWebpageQ
qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX