FreeBSD/USB PPP solution (need testers)

  • Previous message: Repeating events with install-datebook
  • Next message: FreeBSD/USB PPP solution (need testers)
  • David A. Desrosiers hacker at gnu-designs.com
    Wed Feb 26 13:02:52 EST 2003

     

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1
    
    
    	For those wishing to sync their USB Palm devices under BSD, I think
    we have a tempoarary workaround that will satisfy your needs for now..
    
    	After a great deal of testing, I believe we've worked out a solution
    that will enable users to sync their Palm USB handheld devices with FreeBSD
    using pilot-link until the pilot-link team and the BSD team figure out what
    exactly the issue is that causes this process to fail "natively".
    
    	Feel free to email me back privately if you have anything you'd wish
    to add or comment on that may not be useful on the lists.
    
    	This may also work for ColdSync users who wish to use the same sort
    of process. I'm not familiar with the innards of how ColdSync handles the
    equivalent of pi-csd for network connections, so I hope someone can fill me
    in on that and get back to me with some details.
    
    	At this point, we need some testers to verify that this works.
    
    	So far we've tested it on both OHCI and UHCI platforms (Intel/Via
    and SiS chipsets on both desktop and laptop machines) with systems using
    ugen, ucom, and a combination of both of them.
    
    	Here's what you'll need to do:
    
    	In your BSD kernel config, you'll need at least the following:
    
    ##############################
    pseudo-device   ppp     1       # Kernel PPP
    pseudo-device   tun             # Packet tunnel.
    device          uhci            # UHCI PCI->USB interface
    device          ohci            # OHCI PCI->USB interface
    device          usb             # USB Bus (required)
    device          uvisor		# For Palm->USB interface
    device          ucom		# Generic serial layer
    ##############################
    
    	Rebuild your kernel with that, using 'make buildkernel' and then
    'make installkernel' and make sure you 'make world' to ensure that your usbd
    and other userland tools are current with the changes in your kernel.
    
    	Now, in /etc/ppp/ppp.conf, add the following:
    
    ##############################
    palm:
     set device /dev/ucom0
     set cd off
     set dial
     set speed 230400
     set timeout 300
     set redial 5 0
     set reconnect 3 5
     set ctsrts on
     set ifaddr 10.0.1.30 10.0.1.40
     enable dns
     add default HISADDR
     open
     bg "/usr/local/bin/pi-sync.sh"
    ##############################
    
    	Note that in ppp.conf, 10.0.1.30 is my actual BSD machine's IP
    address, and 10.0.1.40 is the IP I wish to assign to my Palm when it
    connects to the BSD machine using ppp.
    
    	The last line of the 'palm' section in ppp.conf references one
    script, pi-sync.sh. This script consists of the following two lines:
    
    ##############################
    #!/bin/sh
    /usr/local/bin/pi-csd -H ler -a 10.0.1.30 -n 255.255.255.0
    ##############################
    
    	This roughly translates to
    
    pi-csd -H <hostname of BSD machine> -a <IP of BSD box> -n 255.255.255.0
    
    	In my case 'ler' is the hostname of the BSD machine and 10.0.1.30 is
    the IP of the interface on this machine. This is NOT the hostname of the
    Palm or the IP of the Palm device.
    
    	NOTE: The hostname you present here with pi-csd with -H must match
    *EXACTLY* what the hostname you use in the "Primary PC Setup" section on the
    Palm below. If you use 'ler' with pi-csd, you must use 'ler' on the Palm,
    not 'ler.domain.com'.
    
    	On the Palm itself, you'll have to make some changes as well.
    
    	Follow these steps exactly:
    
    	- Tap the HotSync icon in the application launcher.
    	- Select [Modem] from the two options above the center icon
    	- Tap 'Select Service' below the icon, and pick an unused one or
    	  create a new one.
    		- Service   : Unix
    		- User Name : <leave blank>
    		- Password  : [- Prompt -]
    		- Connection: Cradle/Cable
    
    	- Tap Details...
    		- Connection type: PPP
    		- Idle timeout: Never
    		- Query DNS: [X]	# checked
    		- IP Address [X] 	# checked
    
    		- Tap Script...
    			- Set the first value to 'End'
    			- Tap Ok
    		- Tap Ok
    	- Tap Done
    
    	This will bring you back to the HotSync screen.
    
    	- Tap Menu
    		- Modem Sync Prefs: Network
    		- LANSync Prefs: LANSync
    		- Primary PC Setup
    			- Primary PC Name: <hostname of BSD machine>
    			- Primary PC Address <IP of BSD machine>
    			- Subnet Mask (optional): <optional>
    		- Connection Setup: Cradle/Cable
    			- Tap Edit...
    				- Name: Cradle/Cable
    				- Connect to: PC
    				- Via: Cradle/Cable
    
    			- Tap Details...
    				- Speed: 230,400 bps
    				- Flow Ctl: On
    				- Tap Ok
    			- Tap Ok
    		- Tap Done
    
    	In your /etc/usbd.conf, you should have something similar to the
    following:
    
    ##############################
    device "Palm Handheld Device"
            devname "ucom0"
            vendor  0x0830
            product 0x0002
            attach "/usr/sbin/ppp -auto palm"
    ##############################
    
    	The important part here is the attach line. This will spawn ppp
    every time the Palm handheld connects, which then launches the pi-sync.sh
    script, which attaches ppp to the Palm. From here, you can run any of the
    various pilot-link conduits you wish, as long as you pass it the port of
    'net:any' or 'net:10.0.1.30' (the local IP of the BSD box itself).
    
    	To find out your Palm vendor_id and product_id, you should be able
    to hit HotSync on the Palm (local HotSync this time, not modem) and then run
    'usbdevs -v' and look for it. If you get stuck, there's also some help on
    the pilot-link wiki here:
    
    	http://wiki.pilot-link.org/index.pl?DeviceMatrix
    
    	Feel free to check that list and modify as needed. If yours is not
    listed, please report back, or add it to the wiki, so others can benefit
    from your data and results.
    
    	You will then need to kill usbd and restart it ('killall -9 usbd &&
    usbd') to re-read the /etc/usbd.conf file, or kill it and run the following
    for debugging purposes:
    
    	/usr/sbin/usbd -c /etc/usbd.conf -vv -d
    
    	To run this as a normal user, you will need to also be added to the
    'network' group. You can add yourself to this group manually by adding it in
    /etc/group.
    
    	Now open up a term and run the following:
    
    	pilot-xfer -p net:any -b /tmp/backup
    
    	You can change the path to the backup if you wish, this is just one
    example of how to use this over the ppp connection. In this case, it will
    connect to your Palm handheld and back it up into /tmp/backup, creating the
    'backup' directory if it doesn't already exist. Feel free to point this
    elsewhere. It will sit there waiting for a connection. If you get this far
    without any major errors, you're doing well.
    
    	Tap the HotSync icon in the HotSync applet (do NOT use the HotSync
    button on the cradle or cable, this will default to a local (non-net) USB
    connection, which is not what you want).
    
    	Then pilot-xfer should wake up and begin sync'ing your data.
    
    	Good luck, and let us know how you fare. If this proves useful, I'll
    drop it into a more concise HOWTO with some screenshots to guide you along,
    and drop it on http://howto.pilot-link.org with the others.
    
    
    d.
    
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.2.1 (GNU/Linux)
    
    iD8DBQE+XQFOkRQERnB1rkoRAs5QAJ9LZKgj6yEgZxZdn3de9eBDiZc4SwCfRaH6
    WcgNXtIDfiInP1a/iKOvSIQ=
    =qKCu
    -----END PGP SIGNATURE-----
    
    

     

     

    More information about the pilot-link-general mailing list