We have introduced how to synchronize Palm via IrDA, let’s move on to the next level: Synchronize Palm via Bluetooth.
Linux kernel has built-in support for Bluetooth devices, you could build it into kernel or modules. The following configuration also includes the optional bluetooth headphone support, it does not hurt since everything is built into modules.
— 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
<M> HIDP protocol support
Bluetooth device drivers —>
<M> HCI USB driver
[*] SCO (voice) support
<M> HCI UART driver
In the user land, we need to install BlueZ, the Linux Bluetooth protocol stack, in Gentoo, just
We need to modify /etc/bluetooth/hcid.conf to make it fit into our needs:
name "BlueZ (%d)";
iscan enable; pscan enable;
bluepin is a PyGTK-based dialog to prompt the password, if you don’t install X or do not change the PIN whenever a new device is connected, you could just feed the pin directly like this :
OK, plugin the bluetooth adpater. Enable your Palm’s Bluetooth for the first test drive:
00:07:E0:0E:B6:CC My Palm
OK, at least the Bluetooth adapter works, kernel modules loaded, and BlueZ take actions for the new device.
NOTE: For the curious users, please check /etc/udev/rules.d/70-bluetooth.rules to demystify the magic.
Tie a knot
In Palm side, create a new connection named “Bluetooth to PC” in Preference | Connection | New … like this, then click Device: Tap to find. If this is the first time to bind the handheld and desktop, bluepin would popup to ask for the authentification token.
Then create a new Network in Preference | Network | New , click Details …, then click Script …, and delete all scripts, like this:
The light of the tunnel
Bluetooth synchronization is quite different than the previous two local HotSync, it is a Modem HotSync via dial-up network on bluetooth tunnel. We need to build the dail-in server in Linux side:
Build the kernel modules 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)
In the userland, install the ppp package and enable the ip forwarding:
echo 1 > /proc/sys/net/ipv4/ip_forward
Set up the peer-to-peer network, /etc/ppp/peer/dun
# Host IP: target IP
Gentoo’s magic bluetooth service would launch the following service for us:
- hcid: the Host Control Interface daemon to talk with L2CAP kernel module.
- sdpd: the Service Discovery Profile daemon to discover nearby bluetooth devices.
- pand: the Personal Arean Network daemon to organize an Ad-Hoc PAN.
- dund: Dial-up Network daemon to build a virtual serial link for dial-up network.
- pppd: Point-to-Point Protocol daemon
Edit the /etc/conf.d/bluetooth:
# Start of hcid (allowed values are "true" and "false")
# Config file for hcid
# Start sdpd (allowed values are "true" and "false")
# Start hidd (allowed values are "true" and "false")
# Arguments to hidd
# Run hid2hci (allowed values are "true" and "false")
# Bind rfcomm devices (allowed values are "true" and "false")
# Config file for rfcomm
# Start dund (allowed values are "true" and "false")
# If you want to use dund, you must install: net-dialup/ppp .
# Arguments to dund
DUND_OPTIONS="–listen –persist –msdun call dun"
# Start pand (allowed values are "true" and "false")
# Arguments to pand
PAND_OPTIONS="–listen –role NAP"
Once the bluetooth adpater is plugged in, the corresponding services are launched, you can test the connection with either Merge Ping, or use the command line: Preference | Network | Option | View Log, then write ping www.foo.com
The last, but not the least
In HotSync | Options | Modem Sync Prefs…, hightlight Network
In HotSync | Options | Primary PC Setup…
Primary PC Name: leave blank
Primary PC Address: IP Address of the computer
Subnet Mask: Netmask of your network
NOTE Primary PC Name is parsed by the DNS, the best practice is to leave it blank.
When HotSync, select, Modem and Unix as the network. In the desktop side, use net:any to replace /dev/pilot in the previous HotSync settings.