OESF Portal | OESF Forum | OESF Wiki | LinuxPDA | #planetgemini chat on matrix.org | #gemini-pda chat on Freenode | #zaurus and #alarmz chat on Freenode | ELSI (coming soon) | Ibiblio


Welcome Guest ( Log In | Register )

> Usb Connection Howto, Windows & Linux - OE specific
post Apr 7 2005, 06:03 AM
Post #1

Group: Members
Posts: 4,512
Joined: 25-October 03
From: Bath, UK
Member No.: 464

Another pinned topic :-)

Let's nail setting up USB connections between a Z and a PC (running WinXP or Linux), which is a basic thing which ought to be documented (and which comes up from time to time).

What we need is:
* Your Z (hardware, OZ version, kernel version)
* Your PC OS (including kernel version/service pack/etc.)
* Where you got the drivers from (if needed)
* What changes you made on the PC (if any, mainly for Linux)
* What changes you made on your Z (if any)



P.S. I know there are already HowTos in the ZUG HowTos area, however these generally apply to Sharp ROMs (and although there may not be many differences, there are enough).

By all means, lift the info from there if it works, it'll go back in there once this is all sorted.
Go to the top of the page
+Quote Post
Start new topic
post Apr 13 2005, 12:45 PM
Post #2

Group: Members
Posts: 11
Joined: 5-May 04
From: Birmingham, UK
Member No.: 3,155

SL-5500 (Collie)
Hentges.net ROM T7 (based on OpenZaurus 3.5.2)

Debian 3.1 "Sarge", Vanilla Kernel (Should work with earlier 2.6 kernels, but note that the driver location has moved.)

Device Drivers -> USB Support -> USB Network Adapters
Set "Multi-purpose USB Networking Framework" as a Module and turn on "Embedded ARM Linux links (iPaq, ...)" and "Sharp Zaurus (stock ROMs)"
Rebuild your kernel or just "make; make modules_install" if you're feeling brave.

This will make the "usbnet.ko" module.

PC-Side changes
Install the "hotplug" package.

Add the following line into /etc/hotplug/usb.distmap:
usbnet    0x003    0x04dd    0x8004    0x0000    0x0000    0x00    0x00    0x00    0x00    0x00    0x00    0x00000000

(That's one single line with Thirteen (13) white-space-delimited fields)

Now create the following file /etc/hotplug/usb/usbnet:
#! /bin/bash
typeset -i num
num=`ifconfig | grep usb0 | wc -l`
if [ $num -eq 0 ]; then
   ifup usb0
   ifdown usb0
   sleep 1
   ifup usb0

and make it executable with "chmod +x /etc/hotplug/usb/usbnet"

Add the following to /etc/network/interfaces:
# USBd Interface to the Zaurus
# Statically configure the interface (i.e. no DHCP)
iface usb0 inet static
   address     # Address of PC's end of link
   pointopoint   # Address of Zaurus' end of link
   # Now call some commands when the link comes up
   up iptables -t nat -F      # Flush the NAT table
   up iptables -t nat -A POSTROUTING -j SNAT -o eth0 --to $addr
        # Set up Source Network Address Translation (SNAT)
        # Note:
        # eth0 - Interface towards the internet.
        #   This can probably be ppp0 if the PC is dialled up.
        # $addr - Set this to the address of the above interface.
   up echo "1" > /proc/sys/net/ipv4/ip_forward
                   # Turn on IP Forwarding
   # Now call some commands AFTER the link has gone down
   post-down echo "0" > /proc/sys/net/ipv4/ip_forward
                   # Turn off IP Forwarding
   post-down iptables -t nat -F  # Flush the NAT table

# Optional IPv6 on interface
iface usb0 inet6 static
   address 2001:618:429:cafe::5501 # Choose an address in your own block
        # I have ...::5501 at this end and the
        # Zaurus configured as ...::5500
   netmask 128
   mtu 1500

Zaurus-side changes
In Network Settings, for usbd0:
Turn ON "Automatically bring up"
IP Address: (To match pointopoint address above)
Subnet Mask:
Gateway: (To match address on PC)
First DNS: Whatever you like
Second DNS: Whatever you like

Now, you should be able to just plug the Zaurus in. Hotplug will detect the SL-5500, load usbnet.ko, configure the interface and iptables will allow the Zaurus to connect to the internet.

NOTE: We've only used Source NAT so, while the Zaurus can access the internet (pull down ipks etc), it is not accessible to internet computers connecting to it. (That is, you won't be able to ping the Zaurus or connnect to any servers on the Zaurus from any computer other than the one at the end of the USB cable). Also note that you WILL want to tweak the lines in /etc/network/interfaces if you perform other NAT functions on the PC. Suggestions are welcome for more specific (and better) iptables commands.

This post has been edited by darac: Apr 14 2005, 02:01 PM
Go to the top of the page
+Quote Post

Posts in this topic
lardman   Usb Connection Howto   Apr 7 2005, 06:03 AM
lardman   Zaurus - C750, 2.6.11 kernel, OZ 3.5.3pre (probabl...   Apr 7 2005, 06:07 AM
darac   Zaurus: SL-5500 (Collie) Hentges.net ROM T7 (based...   Apr 13 2005, 12:45 PM
obergix   QUOTE(darac @ Apr 13 2005, 10:45 PM)Add the f...   May 18 2005, 12:15 AM
gfdsa   Zaurus: SL-600L, OZ 3.5.2, Dock Station PC: WinXP ...   Apr 14 2005, 08:58 AM
jancici   hi, for me this is not working, I can remember tha...   Apr 17 2005, 01:30 PM
lardman   Start a seperate thread please, this thread is jus...   Apr 18 2005, 12:10 AM
lardman   Zaurus: OZ 3.5.3 C7x0 with 2.4.18 kernel (GPE onl...   Apr 18 2005, 01:13 AM
dansawyer   The howto is very helpful as it is. I would sugge...   May 26 2005, 05:56 AM
niv   Windowz: you may want to use NT/2000/XP routing to...   Jun 19 2005, 05:48 PM
charcler   HELLO sysops... gurus... wanna.. new... all ;) M...   Aug 4 2005, 07:50 PM
ajaygautam   Z: SL5500, OZ 3.5.3,2.4.18-rmk7-pxa3-embedix PC: G...   Aug 11 2005, 10:47 AM
NickNak   Using an ethernet bridge to plug your Zaurus into ...   Sep 14 2005, 08:56 AM
Headrush   QUOTE(NickNak @ Sep 14 2005, 11:56 AM)Using a...   Sep 19 2005, 02:11 PM
jan   QUOTE(NickNak @ Sep 14 2005, 06:56 PM)Using a...   Feb 19 2006, 12:51 PM
NickNak   Using this method, usb0 and eth0 do not need IP ad...   Sep 19 2005, 02:31 PM
Headrush   I had this usbd connection working perfectly and t...   Dec 4 2005, 12:41 PM
lardman   No, no, no, no, no - this is a thread giving detai...   Dec 5 2005, 03:32 AM
7_feet_up   Debian unstable Zaurus USB-network how-to: Install...   Dec 17 2005, 09:08 AM
Storm   QUOTE(7_feet_up @ Dec 17 2005, 01:08 PM)Debia...   Jan 30 2006, 02:24 PM
7_feet_up   QUOTE(Storm @ Jan 30 2006, 11:24 PM)<snip...   Mar 20 2006, 01:24 PM
microsoft/linux   what happens if the usbnet driver is built into my...   Jan 22 2006, 09:49 PM
7_feet_up   QUOTE(microsoft/linux @ Jan 23 2006, 06:49 AM...   Jan 24 2006, 03:00 AM
microsoft/linux   ok, I changed GUIs, after I updated to 3.5.4. Now ...   Mar 20 2006, 09:11 PM
pgas   PC: windows XP Zaurus: 860 oz/gpe 3.5.4 2.6 kernel...   Mar 20 2006, 11:42 PM
jerrybme   QUOTE(pgas @ Mar 21 2006, 01:42 AM)PC: window...   Mar 24 2006, 07:05 AM
GenericAnimeBoy   For those of us poor fools who have to internet co...   Mar 21 2006, 10:34 PM
papercrane   The Cxx00 doesn't talk to Windows correctly ye...   Mar 29 2006, 12:32 PM
Tron   QUOTE(papercrane @ Mar 29 2006, 10:32 PM)The ...   Apr 4 2006, 12:25 AM
nick88   Hi, I followed the shell scripts and can ping a...   Apr 6 2006, 05:20 PM
telemetric_au   followed 7_feet_up's guide (thanks) and it wou...   Apr 17 2006, 06:33 AM
telemetric_au   well after mucking aroun some i cant get my z to p...   Apr 17 2006, 07:11 AM
telemetric_au   I GOT IT WORKING !!! --finally after ...   Apr 18 2006, 04:17 AM
telemetric_au   Just to make life even more sweet, i just set the ...   Apr 18 2006, 04:44 AM
telemetric_au   i just added an updated bridging guide to the wik...   Apr 28 2006, 03:25 PM
lardman   Please add stuff to the official OZ wiki: http://o...   Apr 29 2006, 02:03 PM
telemetric_au   trying to do it now, but the server is soooo slow....   Apr 29 2006, 02:25 PM
NickNak   I have run into problems with my bridging setup: ...   May 1 2006, 12:17 PM
7_feet_up   QUOTE(NickNak @ May 1 2006, 09:17 PM)I have r...   May 3 2006, 02:32 AM
telemetric_au   sorry, but i have no experience with that problem ...   May 2 2006, 03:09 PM
NickNak   The "USB Networking" howto submitted by ...   May 4 2006, 01:54 PM
telemetric_au   QUOTE(NickNak @ May 5 2006, 08:54 AM)The ...   May 4 2006, 03:04 PM
telemetric_au   NickNak: fixed up my title to debian rather than ...   May 4 2006, 03:20 PM
benplaut   waiting for an arch tutorial, all you arch users h...   Jul 18 2006, 06:51 PM
lardman   If someone fancies tidying up the info in this thr...   Jul 19 2006, 02:32 AM
speculatrix   I added some stuff which is somewhat 6000 specific...   Oct 10 2006, 05:38 AM
lardman   I'll have a look through, thanks Si   Oct 10 2006, 06:54 AM

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 25th April 2018 - 10:15 PM