LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Linux Answers > Networking
User Name
Password

Notices


By petn-randall at 2004-12-21 12:13
How to connect the Zaurus with a gnu/linux computer via USB [ver 0.1]
written by randall with help from the z-portal.info forums

This How-to will help you to bring up a basic network connection between a linux computer and you favorite Z. You will need this before you do any of the advanced stuff, like syncing, up-/downloading stuff to your Z and accessing the internet/you LAN via your handheld.

As a prerequisite you will need a fully installed linux computer with a free USB port and a Zaurus SL-5500 with OZ on it. Make sure your Z is not connected to the computer yet and start gnu/linux. For this How-to you will need basic experience with the console, so revamp your skill if needed !

We will be using the usbnet module, since it works for my system. It may be possible to connect to your Z by other means, and if it works please mail me and tell me how ;)

1) On the console, log in as root and edit /etc/hotplug/blacklist with your favorite editor. A very easy to use editor is nano. Add the word "cdcether" to the end of the file. If you're boggled by editing, just type the following:

echo "cdcether" >> /etc/hotplug/blacklist

This will just append 'cdcether' to your blacklist.

2) In this step we'll connect the Z and see if it was recognized by your computer. To do that we'll open up another console and type "tail -f /var/log/messages". You will see a the last few lines of you system log. Now put your Z in the cradle, turn it on and connect the cradle to your USB port. You should see that an usb device was connected, the usbnet module was loaded and that your Zaurus was recognized:

Dec 19 16:24:07 localhost kernel: ohci_hcd 0000:00:02.1: wakeup
Dec 19 16:24:08 localhost kernel: usb 2-1: new full speed USB device using address 6
Dec 19 16:24:08 localhost usb.agent[3779]: usbnet: loaded successfully
Dec 19 16:24:08 localhost kernel: usb0: register usbnet at usb-0000:00:02.1-1, Sharp Zaurus SL-5x00
Dec 19 16:24:08 localhost kernel: usbcore: registered new driver usbnet

With 'lsmod | grep usbnet' you should find that the module was loaded.

bateau:~# lsmod | grep usbnet
usbnet 18888 0

You'll probably have one or two more lines containing the word usbnet, but you definitely should have this line here. If not, something went wrong with loading the module.

An 'ifconfig -a' should give you a usb0 network interface, which isn't configured yet. There may be more network interfaces depending on your system, but usb0 should definitely be there.

usb0 Link encap:Ethernet HWaddr xx:xx:xx:xx:xx:xx
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

3) In this step we'll configure the network interface of the Z and your linux computer. We'll give your computer and your Z a static IP, since DHCP is a bit complicated and not the best option if you only have one PC and your Z on the network. If you're part of a larger network, which assigns IPs via DHCP, you should think of turning your PC into an etherbridge. You can find how-tos for that on www.linuxquestions.org
First your Z:

Start 'Network' in your Settings dir. Click on the interface 'usbd0' and click configure.

Fill in the Following:

(X) Automatically bring up
( ) DHCP

Static Ip Configuration
IP Address 192.168.129.201
Subnet Mask 255.255.255.0

Leave the rest empty for now.

On your linux computer, as root, type the following:

ifconfig usb0 192.168.129.1 netmask 255.255.255.0 up

This should configure your USB network interface and bring it up. Now we'll try if we can reach the Z. On the console, we'll do this by pinging it's IP address:

bateau:~# ping -c 5 192.168.129.201
PING 192.168.129.201 (192.168.129.201) 56(84) bytes of data.
64 bytes from 192.168.129.201: icmp_seq=1 ttl=255 time=2.38 ms
64 bytes from 192.168.129.201: icmp_seq=2 ttl=255 time=1.27 ms
64 bytes from 192.168.129.201: icmp_seq=3 ttl=255 time=1.15 ms
64 bytes from 192.168.129.201: icmp_seq=4 ttl=255 time=1.24 ms
64 bytes from 192.168.129.201: icmp_seq=5 ttl=255 time=1.22 ms

--- 192.168.129.201 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4003ms
rtt min/avg/max/mdev = 1.150/1.453/2.382/0.467 ms

If you don't get the same message as above, you've probably screwed up in on of the steps above and go through them again. If you get ping replies, your USB connection works ! Hurray ! Now you can think of up-/downloading stuff to your Z, syncing or even try to access the internet via your Z. This is very useful if you want to install or update software via feeds.

4) Making your configuration permanent
You don't want to type 'ifconfig usb0 192.168.129.1 netmask 255.255.255.0 up' on the root console to use your Z, and you'll probably just want to stick it in to be able to use it. Debian has the right tools to do this.

Edit your /etc/network/interfaces and add following lines:

mapping hotplug
script grep
map usb0

iface usb0 inet static
address 192.168.129.1
netmask 255.255.255.0

This will ensure that every time your Z hits the cradle the network connection will be started. If anybody with an other distro than Debian has an idea how to make your config permanent, please mail me and I'll add it to the next version of this how-to.
Please send feedback, corrections, flames to lee-in-berlin[whirly a]web.de


by Sir_Yaro on Fri, 2007-03-16 10:12
http://wiki.openzaurus.org/HowTos/Bridging_with_Gentoo

Quote:
I found that the MTU assigned to usbd0 on the Zaurus was diferent from that assigned to usb0 on the PC:

Different MYU does not prevent logging into the Zaurus using ssh but does prevent downloading files larger than about 1kB. I am not sure why this happens, it may be related to this kernel bug report

The solution is to reduce the MTU on the Zaurus end. You can configure the Zaurus to do this automatically by editing /etc/network/interfaces. Find the section starting 'iface usbd0' and add the following line:

up ifconfig usbd0 mtu 1494

by allelectrix on Sun, 2008-11-16 16:44
Guys, thanks, this is a good lead,but was wondering if we can get an Internet or local net connection using a Z and an rt73 or rt2570 USB Wifi card in managed mode running pdaXii13 or pdaXrom or Cacko 1.23 ?

So far, DHCP does not work, neither dhcpcd or dhclient even with recompiling the Kernel with network modifications. So, is it possible to connect to an AP running DHCP services manually using ifconfig ?

also, very important, what would be a minimum kernel .config file for a kernel recompile to set up USB Network services using Wifi ? - thats a 2.4.20 kernel folks.

thanks all ;-)


  



All times are GMT -5. The time now is 10:13 AM.

Main Menu
Advertisement
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration