Networking on a Tungsten

This one’s more for my reference than anything else. I’m not using this in general right now, but I may want to again in the future. There are several pages to be found out there on this subject, and they all are a little different. This worked for me in the fewest steps.

Note bene (note very well): This stuff has caused both my Tungsten and both of my RedHat (Phoebe beta 3) systems to lockup numerous times. If you get pppd crosswise when trying to connect from the Tungsten, it can happen. I’d love to find out that I’m causing it by doing something incorrectly. If you know what that is, please let me know what that might be. My suspicion is that it’s purely hardware related, something like noise on the USB line being interpreted incorrectly in the serial stream. Things like this aren’t supposed to take down operating systems, and it annoys me greatly.

  • Turn on IP forwarding in your kernel. The example should be generic to any modern Linux kernel, regardless of distro.
    echo "1" > /proc/sys/net/ipv4/ip-forward 

    Note that if you’re going to be doing this a lot, you ought to make this a permanent part of your setup. This is specific to your distro. On RedHat, you need to toggle the setting in /etc/sysctl.conf.

    # Controls IP packet forwarding
    net.ipv4.ip_forward = 1 
  • Load the kernel module for USB-connected Palm handhelds. It’s called “visor” (because the Visor was the first USB PalmOS PDA), but it’s been patched to support all succeeding USB PDA’s, including the Tungsten. At least, RedHat has backported the patch; your distro may vary.
    modprobe visor 

    You may want this to be permanent as well. In RedHat, the best way I’ve found to load miscellaneous kernel modules at boot time is to simply add the preceeding command to the bottom of /etc/rc.local. If anyone knows a more “proper” way of doing this, please let me know; I’ve wondered about this for years. Under SuSE 8.2, you’d add it in the obvious place in /etc/sysconfig/kernel.

  • Start a pppd to relay the packets from the Palm through your PC to the network at large. Some people say that you need to set up a getty to provide the channel upon which pppd runs, and I would have said that was true before I started, but it’s obviously not. I’ve been working with Linux (and therefore ppp) for about 8 years now, and I guess I still don’t understand it.
    pppd /dev/ttyUSB0 57600 proxyarp nodetach noauth persist local 192.168.4.10:192.168.4.11 ms-dns 192.168.4.254 

    Notes:

    • The device I found to work is /dev/ttyUSB0, not 1, as many people have referenced in their pages.
    • I couldn’t sustain a speed of more than 57600. I think it ought to go higher, but I don’t know why it won’t. If you want to try for a higher speed, remember that you’ll have to create a new “Connection” in your Preferences that has a higher speed on the Palm side as well.
    • Obviously, my IP addresses are suitable for me; you’ll need to tailor them for your setup. Note that whatever you do, you’ll need IP’s distinct from everything else on the network, including your PC’s main network connection. (The other stuff is explained at length in other pages.)
    • You may want to configure ppp authentication, and set it up to run all the time via /etc/inittab. That exercise is left to the reader. (Man! I hate that saying. I’ve come to realize that it means that the author knows how to do it, but is too lazy to write it down. And, it’s not that hard. And, it’s all covered in the HOWTO’s.)
  • On your Tungsten, in the “Network” setup under Preferences, you’ll need to select “Unix” as the “service.” Then choose “Cradle/Cable” as the “connection” (or your custom connection if you want to go for the burn). At this point, if you have not configured authentication in pppd, you’ll need to tap the “Details…” button, then the “Script…” button, and change the very top action to “End” which will clear the whole script. (I personally found that the script setup would have taken a bit of work, so I created a new “Network” with a cleared login script so that I wouldn’t loose the nice, pre-defined setup.) Again, if you’ve left out pppd authentication, you can leave the “User Name” blank. One last thing: you’ll probably want to tap the “Details…” button, and set the “Idle timeout” to “Never.” Well, as long as you’re connecting to the computer through a USB connector, and getting power… This setup could be modified to get a connection through a serial cable or a Bluetooth trasnmission, and you’d have to watch your battery life under those conditions.
  • This is critical. Set your Tungsten in the cradle, and tap the “Connect” button on your network connection. About a half second later, start the pppd session. The thing you must remember is that, even though the filesystem object, /dev/ttyUSB0, might exist, the actual kernel device doesn’t until something happens on the USB line. That’s just USB, and there’s nothing to be done about it. So if you start pppd before the USB line goes “off-hook,” it will bomb out. (Come to think of it, I don’t know what this implies for trying to set up pppd to run at startup via /etc/inittab…) You should see some on-screen handshaking stuff, and then it should tell you that you’re online. At that point, you can browse the net or configure your email program.

Note that if you can’t get through to the network (e.g. IP forwarding isn’t working) or if you can’t resolve DNS queries, it will appear that you’ve locked up. However, it’s just timing out the connection, like every good TCP/IP application. The timeout for the PalmOS TCP/IP stack seems to be about 60 seconds.

Once you get this configured and running, you may want to install some new programs to experiment with while it’s still connected. I didn’t want to disconnect and reconnect (and risk another lockup) while playing with this, so I took it one step further. You need to run a separate daemon called `pi-csd’. Then you can use pilot-link to do it’s thing as usual by changing the “port” argument. I can’t find this anywhere in it’s documentation (and that really annoys me as well); I just found it on someone else’s web page:

pilot-xfer -p "net:any" -i foo.prc bar.pdb 

And once you get that running, you might want to do an actual sync over the network. You’ll need to change your “Modem Preferences” on your Palm to “Network,” and your “Lansync Preferences” to “LANSync.” After this, you’ll need to set your “Primary PC Setup” appropriately. Although the name of the PC is listed as required, it’s not. In fact, if you specify it, you need to make sure that the name will resolve through the DNS server information you’ve passed to the Palm through pppd, otherwise the sync will fail. After this is all done, you can sync as usual with the front end of your choice.

  • You may use these HTML tags: <a> <abbr> <acronym> <b> <blockquote> <cite> <code> <del> <em> <i> <q> <strike> <strong>

  • Comment Feed for this Post
Go to Top