OESF | ELSI | pdaXrom | OpenZaurus | Zaurus Themes | Community Links | Ibiblio

IPB

Welcome Guest ( Log In | Register )

4 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> Usb Connection Howto, Windows & Linux - OE specific
lardman
post Apr 7 2005, 06:03 AM
Post #1





Group: Members
Posts: 4,515
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)

Cheers,


Si

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
lardman
post Apr 7 2005, 06:07 AM
Post #2





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



Zaurus - C750, 2.6.11 kernel, OZ 3.5.3pre (probably other C7/8x0 machines, possibly all machines with the 2.6.x kernel).

Windows XP.

Quite simple, no real drivers are required, just an .inf file you should point the hardware wizard to when it says it can't recognise your Z).

The linux.inf file comes from Documentation/usb/linux.inf in the kernel 2.6.x source (it will need to be converted to Windows format first if you take it directly from thje kernel source - use unix2dos, or open it with WordPad and re-save it).

The file is attached to this post for the time being, but we'll find a more permanent location when 3.5.3 is released.

http://www.oesf.org/forums/index.php?showt...indpost&p=73169


Si
Go to the top of the page
 
+Quote Post
darac
post Apr 13 2005, 12:45 PM
Post #3





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



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

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

Drivers:
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.
(In other words, CONFIG_USB_USBNET=m, CONFIG_USB_ARMLINUX=y and CONFIG_USB_ZAURUS=y)

This will make the "usbnet.ko" module.

PC-Side changes
Install the "hotplug" package.

Add the following line into /etc/hotplug/usb.distmap:
CODE
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:
CODE
#! /bin/bash
typeset -i num
num=`ifconfig | grep usb0 | wc -l`
if [ $num -eq 0 ]; then
   ifup usb0
else
   ifdown usb0
   sleep 1
   ifup usb0
fi

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

Add the following to /etc/network/interfaces:
CODE
# USBd Interface to the Zaurus
# Statically configure the interface (i.e. no DHCP)
iface usb0 inet static
   address 192.168.129.200     # Address of PC's end of link
   pointopoint 192.168.129.201   # Address of Zaurus' end of link
   netmask 255.255.255.255
   # 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"
Turn OFF "DHCP"
IP Address: 192.168.129.201 (To match pointopoint address above)
Subnet Mask: 255.255.255.0
Gateway: 192.168.129.200 (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
gfdsa
post Apr 14 2005, 08:58 AM
Post #4





Group: Members
Posts: 55
Joined: 18-January 05
Member No.: 6,256



Zaurus:
SL-600L, OZ 3.5.2, Dock Station
PC:
WinXP SP2
Drivers:
Shipped on CD with Z, or download:
http://ezaurus.com/bzsolution/download/SL6...SL6000Setup.exe
http://www.gfdsa.org/~gfdsa/SL6000Setup.exe

After Windows recognizes SL-6000, point it to UsbDrivers Dir, follow the wizards.

PC-Side Changes
When it finally settles down, go to network connections, enable connection sharing for your internet connection.
Z-Side Changes
Change usbd0 ip to 192.168.0.x or enable dhcp
ifdown usbd0
ifup usbd0

NOTE: Disconnects on large files transffers with SCP, requires device disconnecting and ifdown/ifup
Go to the top of the page
 
+Quote Post
jancici
post Apr 17 2005, 01:30 PM
Post #5





Group: Members
Posts: 11
Joined: 6-January 05
Member No.: 6,129



hi, for me this is not working, I can remember that with original sharp ROM it was working very well. I did flash OZ 3.5.2 and it was not working, yeasterday I did flash OZ 3.5.3. and still I have problem.

so on Z I have OpenZaurus 3.5.3, uname -a saying 2.4.18-mk7-pxa3-embedix
I have done :
1. settings -> network -> usbd0 : to bring it UP automaticaly, and set up static IP
2. restart Z
after that usbd0 net interface is up

on my desktop I am running gentoo with 2.6.11-gentoo-r5 kernel
I did use same configuration as for SharpROM, so I think it's should work (if necesary I can post my config

when I plug Z to cardle and then I plug usb cable to desktop I can see Zaurus on desktop using "lsusb" command. but hotplug on desktop is not starting usbnet and I don't know why.

when I am typing modprobe -l on Z I am getting empty list :-(

I am totaly tired with this, I did try follow several hot-to by did not help.

thanks
Go to the top of the page
 
+Quote Post
lardman
post Apr 18 2005, 12:10 AM
Post #6





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



Start a seperate thread please, this thread is just for reference purposes.

Si

P.S.

Say which machine you have - it'll help people.
Go to the top of the page
 
+Quote Post
lardman
post Apr 18 2005, 01:13 AM
Post #7





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



Zaurus:

OZ 3.5.3 C7x0 with 2.4.18 kernel (GPE only atm)

PC:

Windows XP (should work for other versions of Windows too)

Drivers:

On the CD with your Z, or download the standard Windows USB drivers for the C7x0 machines from ZUG:

http://www.zaurususergroup.org/UpDownload+...t-lid-199.phtml

When the add hardware wizard asks where to look for the drivers, choose the custom location and point it to the net sub-directory in the above zip file.

PC-Side Changes
Go to network connections, select a static IP address (unless your PC or your Z is running a DHCP server - chances are neither is).

Z-Side Changes
Change usb connection IP address to a static address or enable dhcp if either your Z or PC is running a DHCP server.
Go to the top of the page
 
+Quote Post
obergix
post May 18 2005, 12:15 AM
Post #8





Group: Members
Posts: 128
Joined: 15-April 05
From: France
Member No.: 6,888



QUOTE(darac @ Apr 13 2005, 10:45 PM)
Add the following to /etc/network/interfaces:
CODE
# USBd Interface to the Zaurus
# Statically configure the interface (i.e. no DHCP)
iface usb0 inet static

[SNIP]

   up iptables -t nat -A POSTROUTING -j SNAT -o eth0 --to $addr



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.
*


On my system (Debian Sarge), the --to should be replaced by --to-source and followed by the address of the standard network interface of the PC (eth0).

Hope this helps
Go to the top of the page
 
+Quote Post
dansawyer
post May 26 2005, 05:56 AM
Post #9





Group: Members
Posts: 293
Joined: 18-November 03
Member No.: 945



The howto is very helpful as it is. I would suggest a 'debug' section to help when the interface freezes. My Z on a FC2 freezes about every 2 days. Sometimes it is on the Linux side; it seems that usbnet does not like to suspend-resume and have the Z connnection change. So one debug note is the use of lsusb. Is there a way to force reload usbnet w/o rebooting?

The Z hangs occationally as well. The interface will not come up. I am not sure what to do about this? There used to be a change to the suspend resume scripts. Does anyone know if this will help? If it will then I will dig them up, try them, and post here.

Dan
Go to the top of the page
 
+Quote Post
niv
post Jun 19 2005, 05:48 PM
Post #10





Group: Members
Posts: 237
Joined: 3-June 05
Member No.: 7,261



Windowz:
you may want to use NT/2000/XP routing to get ur zaurus to the web.
use these commands:

netsh routing ip nat install
netsh routing ip nat add interface “YOUR LAN INTERFACE NAME” full
netsh routing ip nat add interface Internal private

YOUR LAN INTERFACE NAME has to be replaced with the name of the interface connected to the internet

I think I am missing a line, as it doesn't work yet. will fix it soon.

Niv
Go to the top of the page
 
+Quote Post
charcler
post Aug 4 2005, 07:50 PM
Post #11





Group: Members
Posts: 1
Joined: 4-August 05
Member No.: 7,785



HELLO
sysops... gurus... wanna.. new... all ;)

My (very) first time with Zaurus, (old) model SL 5500, strong Arm 1110 rev 9
Unpack :
Zaurus + dock + SD 128 + flash 128 + wifi Dlink + multicards usb reader + cables ;)

"kernel card 3.1.2" = kernel 2.4.18 rmk7 pxa3 embedix 021129 compiled by mickey@r2d2 ;))
OpenZaurus 3.5.2
Opie, Open PalmTop Integrated Environnement v 1.1.7
Zaurus has been 'burned, cuted' ... cool
tests : gfx rendering : 2560 gops/second // ram performance : 26.5 mb/s Cool!!!

All right's :))

Install first ipk : kismet. ok ! second : wellenreiter. np too. searchin about Zeb paquage to mplayer compil for arm :(( link at it s home at uklinux ... no tarball... any idea ? thanks :)

Well done, The USB Connection :
my workstation :
kernel 2.6.12.6 -- gnu -- mandriva 2005le -- xorg 6.8 -- kde 3.4 --

So :
connect dock with usb and power. Connect Z on.
LSUSB:
Bus 002 Device 003: ID 04dd:8004 Sharp Corp. Zaurus SL-5000D/SL-5500 PDA
ok
less /var/log/kernel/info
Aug 5 05:22:17 charcler kernel: usb 1-2: new full speed USB device using uhci_hcd and address 12
Aug 5 05:22:17 charcler kernel: usb0: register usbnet at usb-0000:00:14.2-2, Sharp Zaurus SL-5x00
Perfect ...

Go into network configuration ...
shutting down shoreline firewall /etc/init.d/shorewall stop (or service shorewall stop or CLICK MandrakeControlCenter - system - services - click on "stop" shorewall )
--CLICK MandrakeControlCenter - Internet/network - Share internet - select usb0 - patient... OK
simply restart firewall (it adapte itself on new nat connection)
Zaurus :
--CLICK settings - network - usb0 - ip/dhcp (hehehe) - start OK
Open Opera : all works good ;) I am on the internet with my Z throught usb connection.
30 secondes for all settings. (2 seconds for settings, 28 seconds to view step-by-step the logs)
roxor.

note : in fixed ip : 4 secondes without log view ;)

Wireless ? too... :))
now : i have the choice between 3 sync applx. Opie, sync and other one... I think it s not hard to sync with Kontact ;)

see you !
Go to the top of the page
 
+Quote Post
ajaygautam
post Aug 11 2005, 10:47 AM
Post #12





Group: Members
Posts: 7
Joined: 10-August 05
Member No.: 7,827



Z: SL5500, OZ 3.5.3,2.4.18-rmk7-pxa3-embedix
PC: Gentoo Linux / x86, 2.6.12-gentoo-r6

Just got IP forwarding / NAT working, so that I can access internet from my Zaurus via the USB connection. Here is the script that worked for me:

CODE
# make sure you have iptables stuff / modules compiled
# needs to be run on PC
modprobe ip_tables
modprobe iptable_nat

echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_dynaddr

EXTIF="eth0"
INTIF="usb0"

iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -t nat -F

iptables -A FORWARD -i $EXTIF -o $INTIF -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A FORWARD -i $INTIF -o $EXTIF -j ACCEPT
iptables -A FORWARD -j LOG

iptables -t nat -A POSTROUTING -o $EXTIF -j MASQUERADE
echo "Make sure Zaurus's /etc/resolv.conf points to correct entries"


Ajay
Go to the top of the page
 
+Quote Post
NickNak
post Sep 14 2005, 08:56 AM
Post #13





Group: Members
Posts: 11
Joined: 6-September 05
From: Bedfordshire, UK
Member No.: 8,046



Using an ethernet bridge to plug your Zaurus into your network seems to me preferable to routing a two-node subnet between your PC and the Z and then using NAT to give the Z access to your network/the internet. Details of how to do it are at the usbnet website. On Gentoo, this is particularly easy:

1. Create symlinks to /etc/init.d/net.lo called /etc/init.d/net.usb0 and /etc/init.d/net.br0
2. Put the following in /etc/conf.d/net:

CODE
bridge_br0="eth0"
# You need to configure eth0 and usb0 as null so that dhcp is not used,
# we don't want IP addresses etc for these interfaces.
config_eth0=( "null" )
config_usb0=( "null" )
# Could use config_br0=( "dhcp" )
config_br0=( "192.168.2.30" )
depend_br0() {
   need net.eth0
}
gateway="br0/192.168.2.1"
# when hotplug configures usb0, add it to the bridge.
postup() {
   local iface=${1}
   if [[ ${iface} == usb0 ]]; then
       brctl addif br0 ${iface}
   fi
}


Obviously tailor the IP addresses to suit.

3. Configure the TCP/IP connecton on the Zaurus to make it part of the same subnet as your PC, e.g.
IP Address = 192.168.2.50
Subnet Mask = 255.255.255.0
Gateway = 192.168.2.1
First and Second DNS the same as your PC.

4. Test the configuration:

CODE
/etc/init.d/net.eth0 stop
/etc/init.d/net.br0 start


then plug in and switch on the PDA. Check that your PC and PDA have network access

5. Make the new configuration permanent:

CODE
rc-update del net.eth0
rc-update add net.br0 default
Go to the top of the page
 
+Quote Post
Headrush
post Sep 19 2005, 02:11 PM
Post #14





Group: Members
Posts: 4
Joined: 19-September 05
Member No.: 8,147



QUOTE(NickNak @ Sep 14 2005, 11:56 AM)
Using an ethernet bridge to plug your Zaurus into your network seems to me preferable to routing a two-node subnet between your PC and the Z and then using NAT to give the Z access to your network/the internet. Details of how to do it are at the usbnet website. On Gentoo, this is particularly easy:

1. Create symlinks to /etc/init.d/net.lo called /etc/init.d/net.usb0 and /etc/init.d/net.br0
2. Put the following in /etc/conf.d/net:

CODE
bridge_br0="eth0"
# You need to configure eth0 and usb0 as null so that dhcp is not used,
# we don't want IP addresses etc for these interfaces.
config_eth0=( "null" )
config_usb0=( "null" )
# Could use config_br0=( "dhcp" )
config_br0=( "192.168.2.30" )
depend_br0() {
   need net.eth0
}
gateway="br0/192.168.2.1"
# when hotplug configures usb0, add it to the bridge.
postup() {
   local iface=${1}
   if [[ ${iface} == usb0 ]]; then
       brctl addif br0 ${iface}
   fi
}


Obviously tailor the IP addresses to suit.

3. Configure the TCP/IP connecton on the Zaurus to make it part of the same subnet as your PC, e.g.
IP Address = 192.168.2.50
Subnet Mask = 255.255.255.0
Gateway = 192.168.2.1
First and Second DNS the same as your PC.

4. Test the configuration:

CODE
/etc/init.d/net.eth0 stop
/etc/init.d/net.br0 start


then plug in and switch on the PDA.  Check that your PC and PDA have network access

5. Make the new configuration permanent:

CODE
rc-update del net.eth0
rc-update add net.br0 default

*

NickNak, great guide.

I do have a question though: how do eth0 and usb0 get their IP address.
I can manually create the bridge and add the 2 interfaces (eth0 and usb0) to the bridge, but then I have to use ifconfig to give each an IP address.

Is there a way to do this automatically and is it still possible if eth0 uses DHCP to receive it's IP address?
Go to the top of the page
 
+Quote Post
NickNak
post Sep 19 2005, 02:31 PM
Post #15





Group: Members
Posts: 11
Joined: 6-September 05
From: Bedfordshire, UK
Member No.: 8,046



Using this method, usb0 and eth0 do not need IP addresses. There are only two IP addresses involved: the one for the PC, which is assigned to interface br0 by the directive config_br0=( "192.168.2.30" ), and the one for the PDA which I configured using the Network settings GUI to "192.168.2.50". I think both of these could be assigned using dhcp but I haven't tried it. Using a bridge at the ethernet level means that the PDA "looks like" any other device on the same ethernet segment as the PC.
Go to the top of the page
 
+Quote Post

4 Pages V   1 2 3 > » 
Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 13th July 2014 - 05:50 PM