# Zaurus syncing

## jackrabbit123

I recently bought a Z SL-5600 and have been trying to connect to it through the USB cradle. I followed the instructions on docs.zaurus.com and gentoo.org and have been unable to have the device load the usbdnet driver on startup. I'm running gentoo kernel version 2.4.20 patched for xfs and downloaded the usbdnet patch from http://www.ruault.com/Zaurus/patches/.

 When I have th cradle plugged in and turn on the zaurus I get in my /var/log/message: 

 Oct 31 16:09:07 jackrabbit kernel: hub.c: new USB device 00:07.2-1, assigned address 13 

 Oct 31 16:09:07 jackrabbit kernel: usb.c: USB device 13 (vend/prod 0x4dd/0x8006) is not claimed by any active driver. 

 Oct 31 16:09:10 jackrabbit usb.agent: ... no modules for USB product 4dd/8006/0 

 I noticed that the address is 0x04dd/8006 not 8004 so I tried changing that in the kernel setup but it still didn't work. 

 When I try to modprobe usbdnet I get: 

 Warning: /lib/modules/2.4.20-xfs-r3/kernel/drivers/usb/usbdnet.o symbol for parameter echo_tx not found. 

 Module usbdnet loaded, with warnings. 

 Neither the "USB Communication Class Ethernet device support" or the "USB-to-USB Networking cable device support" modules are compiled into the kernel. 

 I really appreciate any help, 

 Chris

----------

## paroneayea

Hey, I don't know if it helps you out, but following the suggestion of a fellow named porkyspine, I was able to get mine to recognize my device when I plugged it in.... here's how.

* I added this line to /etc/conf.d/net (underneath my ethernet card settings, but I doubt it matters where you put it)...

```
iface_usb0="192.168.129.1 broadcast 192.168.129.255 netmask 255.255.255.0"
```

* Then I changed directory to /etc/init.d and copied neth.eth0 to net.usb0

* Next, I entered the command:

```
rc-update net.usb0 default
```

though I really honestly am not sure if that did any good...

Though honestly, I already had hotplug set up properly before this.... hm.... and it appears that your problem really is with the driver usbdnet itself.  You know what?  I suggest that you don't use usbdnet at all.  I know there's that annoying patch thing you have to go through and everything for your kernel, and there's a far superior and more effective way to go about this.  Try emerging the "vanilla-sources" kernel and use that.  The newest version has a module built into it that replaces the old usbdnet problem, and it's just called plain old usbnet.  You'll find it where the usbdnet option used to be.

Hope this helps!  If it doesn't, feel free to give me an IM... my screen name is iamcreat0r on (g)aim

----------

## NorthGoingZax

 *jackrabbit123 wrote:*   

> 
> 
>  When I have th cradle plugged in and turn on the zaurus I get in my /var/log/message: 
> 
>  Oct 31 16:09:07 jackrabbit kernel: hub.c: new USB device 00:07.2-1, assigned address 13 
> ...

 

I had a heck of a time getting my zaurus to work, and there are so many parts to it - USB, ssh/samba (for newer roms), the kernel, networking, etc - so that lately I have just copied stuff on and off with a CF reader, plus I just upgraded to the 2.6 kernel and I haven't tried it yet. 

But when it did work, I had some of the same problems. I think I had to modprobe usbdnet first, then plug in the cradle usb plug, then hit the sync button.

The message:  *Quote:*   

>  Oct 31 16:09:07 jackrabbit kernel: usb.c: USB device 13 (vend/prod 0x4dd/0x8006) is not claimed by any active driver. 

 

is a result of hotplug checking the file /etc/hotplug/usb.distmap and not finding what it wants. The file lists pairing of modules to vendor/product codes and a few other things. The error means that the product ID's for your Zaurus are missing. IIRC, I had to hand edit the file with my Zaurus. If your copy of usb.distmap does not have any listings for usbdnet, then something didn't go right when you installed it.

On my computer with Mandrake, I had to add in the listings. The instructions from Sharp at [usr]www.docs.zaurus.com[/url] give the following instructions for Mandrake, which might be relevant to you:

No patch is needed at all. The usbdnet driver is already installed. The only thing needed to do from the default mandrake install was change two value in the modules.usbmap and add the /etc/sysconfig/network-scripts/ifcfg-usb0 file.

The ifcfg-usb0 file should contain the following:

BOOTPROTO=static

BROADCAST=192.168.129.255

IPADDR=192.168.129.1

NETMASK=255.255.255.0

NETWORK=192.168.129.0

DEVICE=usb0

In the /lib/modules/`uname -r`/modules.usbmap file one line needs to be changed.  Look for a line that starts with the following:

usbdnet              0x0193      0x40dd   0x8004    0x0000

or

usbdnet              0x0193      0x04dd   0x8004    0x0000

and change one of them to this:

usbdnet              0x0003      0x04dd   0x8004    0x0000

Note that you need to put an entry in the /etc/hotplug/usb.handmap file and it will be reflected in the /lib/modules/`uname -r`/modules.usbmap file upon the rebuilding of the file.

Only one line in the file needs to be changed as far as I can tell (the other usbdnet lines are for different hardware, maybe?).  I did find that after two days my modules.usbmap file reverted back to it's original version.  I had to just change the one line again to get things working once more.  I don't know if that is just something flaky with my system, or something more.  Any ideas are welcome.  Enjoy.

Followup:

I searched a little on the web and found the reason! /lib/modules/.../modules.usbmap file is created by "depmod -a" (on 2.4 kernels).  The correct way to add a device is to use the /etc/hotplug/usb.handmap file and add a line there: (dont forget the linefeed if its the last line in the file)

usbdnet 0x0003 0x04dd 0x8004 0x0000 0x0000 0x02 0x00 0x00 0xff 0x01 0x00 0x00000000

I hope this helps a little   :Exclamation: 

----------

## incabolocabus

Just my notes on making a zaurus work with linux-2.4.20-gentoo-r6...

I'm working off info from these two links:

http://www.gentoo.org/doc/en/gentoo-pda.xml

http://docs.zaurus.com/index.php?id=lc_generic

First off, you shouldn't need to patch this particular kernel with the usbdnet patches (as the sharp zaurus and the gentoo link suggest), but you will have to enable the modules and rebuild the kernel unless you can modprobe usbdnet already...

Make sure that you add the vendor and product ids in the kernel config:

"04dd in USBD Network idVendor and 8004 in USBD Network idProduct" (from the gentoo guide)

As the previous post mentioned, you will have add the following to the /etc/hotplug/usb.handmap file:

usbdnet 0x0003 0x04dd 0x8004 0x0000 0x0000 0x02 0x00 0x00 0xff 0x01 0x00 0x00000000

(and make sure you put the extra newline)

To automate things, I followed the instructions in the sharp site by creating a /etc/hotplug/usb/usbdnet script...(taken from the sharp site)

```

#!/bin/bash

typeset -i num

num=`ifconfig | grep usb0 | wc -l`

if [ $num -eq 0 ] ; then

  ifconfig usb0 192.168.129.1 netmask 255.255.255.0 up

  route add -host 192.168.129.201 usb0

fi

#iptables -t nat -F

#iptables -t nat -A POSTROUTING -j SNAT -o eth0 --to 192.168.1.100

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

```

The last part enables masquerading for enabling networking on the zaurus. You may also need a script on the zaurus to bring up the usbnetwork. Its commented out because I don't have the pieces enabled in my kernel (and IMHO, accessing the network through a pda which is plugged into your desktop just doesn't make sense)

I had all this working nicely on redhat9 following the instructions at the zaurus site. Again, its always nice to have things just work, but it is sometimes a bit more enjoyable when you figure out how they work.

The usbd module vendor and product ids map into the hotplug.agent which then looks up the appropriate modules for the usb device. The hotplug.agent then has a hook for post-module initialization, hence the cryptic lines in the handmap file. If you notice, the vendor and product numbers show up there along with "usbdnet". Hotplug then tacks together some strings and invokes the script...

Heres the tail of my log...

Nov 25 20:46:15 mackdaddy default.hotplug: invoke /etc/hotplug/usb.agent ()

Nov 25 20:46:16 mackdaddy kernel: hub.c: new USB device 00:1f.2-2, assigned address 24

Nov 25 20:46:16 mackdaddy kernel: Manufacturer: Sharp

Nov 25 20:46:16 mackdaddy kernel: Product: SL Series

Nov 25 20:46:16 mackdaddy default.hotplug: arguments (usb) env (DEVFS=/proc/bus/usb OLDPWD=/ PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=add PWD=/etc/hotplug HOME=/ SHLVL=2 DEVICE=/proc/bus/usb/001/024 PRODUCT=4dd/8004/0 TYPE=2/0/0 DEBUG=kernel _=/usr/bin/env)

Nov 25 20:46:16 mackdaddy default.hotplug: invoke /etc/hotplug/usb.agent ()

Nov 25 20:46:19 mackdaddy usb.agent: Setup usbdnet acm CDCEther for USB product 4dd/8004/0

Nov 25 20:46:19 mackdaddy usb.agent: Module setup usbdnet for USB product 4dd/8004/0

Nov 25 20:46:19 mackdaddy usb.agent: Setup usbdnet for USB product 4dd/8004/0

Nov 25 20:46:19 mackdaddy usb.agent: Module setup usbdnet for USB product 4dd/8004/0

It works pretty darn well I must say, and syncing seems somehow faster than on redhat.

BTW, I'm pretty sure the message:

 *jackrabbit wrote:*   

>  Oct 31 16:09:07 jackrabbit kernel: usb.c: USB device 13 (vend/prod 0x4dd/0x8006) is not claimed by any active driver. 

 

has nothing to do with hotplug, more the actual kernel module config... Before I had hotplug setup right, I got similar messages as my above log, but without the "usb.agent: Module setup" stuff...

something like this

```

Nov 25 09:03:14 mackdaddy default.hotplug: arguments (usb) env (DEVFS=/proc/bus/usb OLDPWD=/ PATH=/bin:/sbin:/usr/sbin:/usr/bin ACTION=remove PWD=/etc/hotplug HOME=/ SHLVL=2 DEVICE=/proc/bus/usb/001/003 PRODUCT=4dd/8004/0 TYPE=2/0/0 DEBUG=kernel _=/usr/bin/env)

Nov 25 09:03:14 mackdaddy default.hotplug: invoke /etc/hotplug/usb.agent ()

Nov 25 09:12:10 mackdaddy dhcpcd[6442]: infinite IP address lease time. Exiting

```

Thanks for the help everyone, gentoo, sharp, and NorthGoingZax.

Amended 10 minutes later...

Crap it always happens when you speak too soon. During syncing it started to lock up on me. HELP... please before I sit here for 3 more hoursLast edited by incabolocabus on Wed Nov 26, 2003 4:33 am; edited 1 time in total

----------

## polin8

Once you get the Zaurus on the network, multisync (in portage) is a great way to sync it.

----------

## incabolocabus

Oh well, I did spend a couple more hours working on this only to find the most painless solution was to migrate to 2.4.22 where support for the zaurus is built right in. Even automagically bringing up the network. And lo and behold, I was happy - it works and works well.

----------

## pbienst

Could you elaborate a bit on how you got it woking with 2.4.22?

Here's what I did. I installed gentoo-test-sources, and activated "USB-to-USB Networking cables, Linux PDA's" is the kernel config. This builds usbnet, which I assume is the successor to usbdnet. I couldn't find any options there to set ID.

I can modprobe usbnet just fine, but there's no new network interface created. /var/log/messages just shows

Dec  6 18:26:37 pbienst usb.c: registered new driver usbnet

I tried pushing the sync button, turning the zaurus on and off, messing with hotplug, but to no avail.

I've also tried the CDCEther module, which the docs say should work for a Zaurus 5000, but no luck there. Perhaps because I've got a 5500?

----------

## pbienst

To follow up on my own post, I finally got it working, but only after upgrading my Zaurus to OpenZaurus 3.3.5.

I didn't get it to work with hotplug, but I achieved similar functionality by hacking the net.usb0 script. Here'a a mini-howto of what I did:

-build the kernel module usbnet from gentoo_test_sources. No need to have it autoload at boot.

-add iface_usb0="dhcp" to /etc/conf.net

-cp /etc/init.d/net.eth0 to /etc/init.d/net.usb0 and add whatever you need to do to setup the network interface to the setup_env() function. In my case:

```

setup_env() {

        # No reason to check these multiple times in the file

        iface="${1/\./_}"

        iface_IFACE="$(eval echo \$\{iface_${iface}\})"

        dhcpcd_IFACE="$(eval echo \$\{dhcpcd_${iface}\})"

        inet6_IFACE="$(eval echo \$\{inet6_${iface}\})"

        alias_IFACE="$(eval echo \$\{alias_${iface}\})"

        status_IFACE="$(ifconfig | gawk -v IFACE="${iface}" '/Link/ { if ($1 ==$

        vlans="$(eval echo \$\{iface_${IFACE}_vlans\})"

        # Set up interface

        ifconfig usb0 192.168.129.1 netmask 255.255.255.255 up

        route add -host 192.168.129.201 usb0

        iptables  -t nat -F

        iptables  -t nat -A POSTROUTING -j SNAT -o eth0 --to 192.168.2.37

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

}

```

I don't have hotplug running, but the network interface still gets set up correctly whenever I plug in the Z.

----------

