Fedora and the Treo 680

Bluetooth connection between the Treo 680 and Fedora

The Treo 680 is the latest converged device from Palm, and since it came with BlueTooth support built in, I had to get a BlueTooth USB interface and originally set it up in Fedora Core 5.  Note, this should work on Fedora 6, 7, 8, etc..  And other distros with some slight modifications.  I'll also note that this was originally set up for a Treo 650, so it should really work with any Palm with Bluetooth.

I used a lot of references around on the net, most of which should be referenced at the bottom of this page. Below is the condensed information needed to get syncing in Fedora specifically, but it certainly should work for any Linux distribution. To be nice, I'll also link what looks to be a decent site for setting this up on Windows as well, http://www.whizoo.com/bt_setup/

Please note that the following will set up a reasonably fast wireless (400kbit) internet connection inside your house. Of course you could set this up at work, etc. I personally have this set up at home so I don't use slow cellular data and I can use all the bandwidth I want and not worry about going over my limit. I also plan to set it up at work sometime for myself but just haven't gotten around to it. Keep in mind this does not magically make your Treo able to use WiFi (802.11) hotspots or access points.

In setting this up, I purchased a cheap BlueTooth USB adaptor off eBay for a total of $20. I'm not sure about compatability with different BlueTooth hardware, the auction I bid on *specifically* said Linux, so I went with that one. At this point in the guide, don't plug your BT adaptor in yet, we need to set a few things up first.

If you're using the default kernel from Fedora, you shouldn't have to touch any of the following kernel stuff, as they compile all the proper modules in for you already, nice!  Otherwise, if you need to set up your kernel for Bluetooth you can go to the bottom of the page or click here.

Otherwise, the first step is the kernel configuration if you've compiled your own kernel, and this IS assuming you have USB already set up. If not, there are lots of information for that on Google or other resources.

My wife loved my Treo so much she had to have one, so we now both have one. We both share the same bluetooth connection, and I've made notes below where I've changed things to make that happen. Basically make a second rfcomm device and change the ppp script so that the Treo can specify its own IP address, and set the IP on each Treo. It seems to really slow Bluetooth down to have two devices on it, but it works.

After you have the kernel set up, if necessary, you'll need to install some software for Bluetooth and sync software. Some of these might already be installed on your system, and you might have to install a few dependencies, depends on your installation. Some of these might not be necessary, but I installed anything related to BlueZ at this point.

Software required


Using yum, install the following packages:
bluez-hcidump
bluez-bluefw
gnome-bluetooth
bluez-libs-devel
bluez-pin
bluez-utils-cups
bluez-utils
pilot-link
jpilot

or:

yum install bluez-hcidump bluez-bluefw gnome-bluetooth bluez-libs-devel bluez-pin bluez-utils-cups bluez-utils pilot-link jpilot


After installing the software, it's time to plug in the BlueTooth adaptor and get some information from it. If you do a tail -f /var/log/messages with one terminal, you should be able to keep an eye on the kernel messages to make sure things appear to be progressing properly.

In a shell, run the following command:

hcitool dev

This command will give you some of the hardware information on the Bluetooth dongle we need, so keep this in mind when you need to fill in hardware addresses and such below..

Also, do the following command and write down the hardware address of your device, needed below:

hcitool scan

Now that we're sure the BT adaptor is working and we have its hardware address, we'll create/edit a few files on the system, if the file doesn't exist, go ahead and create it. Most of the files below will exist except for /etc/ppp/peers/btpalm. Some of the files I've only listed the things that need changing, don't replace the entire file with the contents below when instructed to just edit the existing lines.

Configuration of Fedora


/etc/bluetooth/hcid.conf (edit existing lines)

options {
security user;
pairing multi;
}

/etc/bluetooth/pin (replace contents, use your own 4 digit pin)
1234

/etc/bluetooth/rfcomm.conf (add at bottom)

rfcomm0 {
bind no;
device 00:07:E0:5B:ED:5F; #that's your palm's bluetooth hardware address (found above)
channel 3; #that't the channel that the T3 seems to be using
comment "t3"; #change that to what you want (no difference)
}
# This is for a second device.. If you have more, create more devices, make
# sure to change the channel and likely the comment. Device will stay the same.
rfcomm1 {
bind no;
device 00:07:E0:5B:ED:5F; #that's your palm's bluetooth hardware address (found above)
channel 1; #that't the channel that the T3 seems to be using
comment "t3-2"; #change that to what you want (no difference)
}

/etc/ppp/peers/btpalm (new file)
115200
# this is hostip:(nothing) so that the Treo's themselves can specify an ip address for themselves.
192.168.0.6:
local
ms-dns 192.168.0.5
noauth
debug
In the above file, these are my values.. In this case, my workstation's internal IP address is 192.168.0.6, the Treo will assign itself an address, and my routers IP address is 192.168.0.5. This will vary based on your configuration.

/etc/sysconfig/pand (replace contents with)
PANDARGS='--listen --role NAP'

/etc/sysconfig/dund (replace contents with)
DUNDARGS='--listen --persist --msdun call btpalm'


Now everything is set up on the PC side. From here we'll pair the Treo 650 with the PC, set up the Treo side of the BT connection, and get Networked and Hotsynced!

Configuration of Treo

Create the network connection settings..

Prefs->Connection->New
Name: BYSync
Connect to: PC
Via: Bluetooth
Speed: 115,200 bps
Flow Ctl: Automatic

Create the network..

Prefs->Network->New
Service: BTSync
User Name:
Password: -Prompt- (leave alone)
Connection: (Pick the connection you made above, BTSync)

Make sure the defaults are correct..

Click Details
Idle timeout: 3 minutes
Query DNS:
IP Address: Automatic
(note: If you have multiple devices, uncheck Automatic IP and set an IP here)

Set up Hotsync config on the Treo for the above settings..

Launch Hotsync
Menu, Options, select Primary PC Setup...
Primary PC Name: (can be left blank)
Primary PC Address: (192.168.0.6 in above config)
Subnet Mask: (likely leave this blank)

Set up Hotsync settings for syncing..

Launch Hotsync
Select Modem
Select BTSync in box below Hotsync icon.

And the Treo should be configured for connecting!

For right now, to test to see if things are working, on the command line type:

pilot-xfer -p net:any -l

Then click Hotsync on the Palm. If all goes well, pilot-xfer will dump the current list of applications/databases in your Treo. If you get here, you should be able to set your hotsync program to sync on the net:any device and it'll work.

One more bit of info here..  If you need to set up Reverse DUN (ie: Connecting to the internet from the Palm using the Linux box as a router) you'll likely need to use the following (or similar) firewall rule.  This isn't really specific to this scenario, but rather routing in general:

iptables -t nat -A POSTROUTING -s 192.168.0.200 -o eth0 -j MASQUERADE

Replace the 192.168.0.200 with your Palm's IP address, and eth0 with your network device on the Linux box. 

I'll try to fill in more details later.. Good luck!

Kernel configuration

If necessary, you can use the following as a guide to set up Bluetooth in the kernel.  Note that the kernel configuration shown below is current as of probably 2.6.19 so it's very likely to have changed since then. 


Begin by compiling the kernel with support for Bluetooth and PPP, found in Device Drivers > Networking Support:
<M>       PPP (point-to-point protocol) support
[ ] PPP multilink support (EXPERIMENTAL)
[ ] PPP filtering
<M> PPP support for async serial ports
<M> PPP support for sync tty ports
< > PPP Deflate compression
< > PPP BSD-Compress compression
< > PPP over Ethernet (EXPERIMENTAL)

Now, under Device Drivers > Networking Support > Bluetooth Support, set:
<M>       Bluetooth subsystem support
<M> L2CAP protocol support
<M> SCO links support
<M> RFCOMM protocol support
[*] RFCOMM TTY support
<M> BNEP protocol support
[*] Multicast filter support
[*] Protocol filter support

Under Device Drivers > Networking Support > Bluetooth Support > Bluetooth Device Drivers, set:
<M>   HCI USB driver
[ ] SCO over HCI USB support
[ ] USB zero packet support
<M> HCI UART driver
[*] UART (H4) protocol support (NEW)
[*] BCSP protocol support (NEW)
<M> HCI BCM203x USB driver

References that helped me get this set up:

http://howto.pilot-link.org/bluesync
http://www.linuxjournal.com/article/8185

You are visitor number 5288







Click here to register.