# [HOWTO] Bluetooth and Palm (or PocketPC) Network and Sync

## Steven Robertson

NOTE: This guide is being supplanted.  Go here for a gentoo-wiki.com version of this article.  If you're really nice, you'll help copy some of this information from this thread to the wiki page.  However, this thread stays put until the Wiki page is done.

This is a quick guide to getting Bluetooth PAN (Personal Area Networking) up and running on Gentoo for access by a PDA such as a Palm or PocketPC.  It also includes details on how to get HotSync synchronization working for a Palm, as well.  As I do not own a PocketPC, I can't report more specifically on PocketPC usage, but I have been told that this method works for PocketPCs, too.

Requirements:

A Bluetooth-enabled PDA

A recent Linux kernel

A Bluetooth adapter 

What I used: 

Palm Tungsten T

gentoo-dev-sources-2.6.1-r1

An IOGear GBU301

1.	Emerge the required packages.

The following packages are required:

net-wireless/bluez-libs 

net-wireless/bluez-bluefw

net-wireless/bluez-utils 

net-wireless/bluez-sdp 

net-wireless/bluez-pan 

net-dialup/ppp

Note that <net-wireless/bluez-utils-2.3-r1 do not include the /etc/init.d/hotplug script.  This script is necessary for proper operation of bluetooth in Gentoo Linux, and so it is highly reccomended that you emerge the unstable versions of bluez-libs and bluez-utils:

```
ACCEPT_KEYWORDS="~x86" emerge bluez-libs bluez-utils
```

The use of hotplug is optional, but highly reccomended, as it automatically handles firmware loading for bluetooth dongles that need it.  However, it has been known to break for some people.  See this thread for details.

2.	Configure your kernel to support bluetooth.  

You need to have the following options configured.  (It doesn't matter whether the options are compiled in or modularized, just as long as they are there.)

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)

...

```

Device Drivers->Networking Support->Bluetooth Support:

```
<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

```

Device Drivers->Networking Support->Bluetooth Support->Bluetooth Device Drivers:

```
<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

```

NOTE: This last option may not exist in your kernel.  If it's not, don't worry about it (although you might want to patch to the latest version of the kernel, see this page for details).

ALSO NOTE: I'm using a 2.6 series kernel; 2.4 series users may have to hunt around a bit.

Recompile the kernel, and reboot if necessary.  However, if you decided to modularize everything, rebooting shouldn't be necessary.

3.	Configure.

3.1.	/etc/bluetooth/hcid.conf

The file should look like the following, with comments omitted.  In the case of the name field, it may be whatever you like; the pin_helper value is reccomended but you can change it if you know what you're doing.  Lines preceeded by an asterisk are the important changes.  Effect the changes, if necessary, but don't include the asterisk.

```
options {

        autoinit yes;

*       security user;

        pairing multi;

*        pin_helper /etc/bluetooth/pin;

}

device {

        name "%h (%d)";

*        class 0x100; 

        iscan enable; pscan enable;

*        lm accept,master;

        lp hold,sniff,park;

*        auth enable;

*        encrypt enable;

}
```

3.2.	/etc/bluetooth/pin

Edit this file to contain the desired PIN for your bluetooth devices.  This is also called a password or passkey by some.  For a PIN of "changeme", you should edit the file to look like:

```
#!/bin/sh

echo "PIN:changeme"

```

3.3.	/etc/ppp/peers/dun

This file doesn't exist, so you'll need to create it.  Here's mine (you should change yours to match your settings):

```
noauth      # Don't require authentication

local         # This is needed because it's not a real serial line

noipdefault   # Don't use the local hostname to determine the local IP used

proxyarp      # Proxy ARP connections

nodefaultroute   # Don't use the default route

noipx      # Don't use the IPX protocol

idle 0      # Set an unlimited disconnect timeout

# Change the next three lines for your setup

# <Host IP Address>:<Client IP Address>

192.168.0.7:192.168.0.6

# ms-dns <DNS Server>

ms-dns 192.168.0.1

# netmask <Netmask for your network>

netmask 255.255.255.0

```

3.4.	/etc/init.d/bluetooth_pan

I created this script by modifying the /etc/init.d/bluetooth script.  You'll need to create a copy of your own, like so:

```
#!/sbin/runscript

# Distributed under the terms of the GNU General Public License, v2 or later

depend() {

        need bluetooth

}

start() {

        local RETVAL

        ebegin "Starting Bluetooth PAN"

        [ -x /usr/bin/pand ] && \

                start-stop-daemon --start --quiet --exec /usr/bin/pand --\

                --listen --role NAP

        RETVAL=$?

        [ $RETVAL -a -x /usr/bin/dund ] && \

                start-stop-daemon --start --quiet --exec /usr/bin/dund --\

                --listen --msdun call dun

        RETVAL=$?

        eend ${RETVAL}

}

stop() {

        local RETVAL

        ebegin "Shutting down Bluetooth PAN"

        [ -x /usr/bin/pand ] && \

          start-stop-daemon --stop --quiet --exec /usr/bin/pand

        RETVAL=$?

        [ -x /usr/bin/dund ] && \

                start-stop-daemon --stop --quiet --exec /usr/bin/dund

        RETVAL=$?

        eend ${RETVAL}

}

```

BE SURE to make the script executable.  Do this like so:

```
# chown root:root /etc/init.d/bluetooth_pan 

# chmod 755 /etc/init.d/bluetooth_pan

```

3.5.	/etc/conf.d/local.start

We need to enable kernel forwarding of IP packets.  Adding the following line to your /etc/init.d/local.start file will take care of that.

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

```

You might also want to execute that line now, as root, in order to enable forwarding should you not want to reboot in 3.7.

3.6.	rc-update

The last step in the configuration section.  Run, as root, the following commands:

```
# /sbin/depscan.sh

# rc-update add hotplug default

# rc-update add bluetooth default

# rc-update add bluetooth_pan default

```

You should perform a reboot at this point to start the scripts.  Alternately, you may start each one individually.  Doing this should eliminate the need for rebooting.

```
# /etc/init.d/hotplug start

# /etc/init.d/bluetooth start

# /etc/init.d/bluetooth_pan start

```

Note that the lines in both sections are not required if you have decided not to use hotplug.

4.	Testing the host configuration

4.1.	Testing hardware

Ensure the bluetooth adapter is properly configured and initialized by typing the "hciconfig" command.  It is similar in many ways to the traditional "ifconfig".  (Output shown is for my system; yours may be the same or similar.)

```
# hciconfig

hci0:   Type: USB

        BD Address: 00:03:C9:2E:5F:61 ACL MTU: 377:10  SCO MTU: 16:0

        UP RUNNING PSCAN ISCAN AUTH ENCRYPT

        RX bytes:240530 acl:8730 sco:0 events:2653 errors:0

        TX bytes:1199359 acl:7417 sco:0 commands:35 errors:0

```

If, instead of being in the UP RUNNING state, your output says DOWN, enable your HCI interface like so.

```
hciconfig hci0 up
```

If no output is displayed, you have a problem with your setup.  Ensure that everything above is correctly set up, then check the logs and dmesg for errors.  If that doesn't help, feel free to PM me.

4.2.	Test Bluetooth connectivity

Next we'll test that the PDA and the host computer can communicate using Bluetooth.  Ensure Bluetooth is activated on the PDA, and that the PDA is on.  (On a Palm Tungsten T, you can do this through Preferences->Communications->Bluetooth.)

Run the following command on the host computer.  Again, output shown is specific to my setup, and will be similar but not identical to yours.

```
# hcitool scan

Scanning ...

        00:07:E0:0E:E9:EE       Steven Robertson

```

The 12-digit hexadecimal sequence listed is the Bluetooth address of your device, and the string next to it is the name of the device.

Next, ensure that the PDA responds to pings from the Bluetooth adapter.  Use a ^C to terminate the command after the first few pings.

```
# l2ping 00:07:E0:0E:E9:EE

Ping: 00:07:E0:0E:E9:EE from 00:03:C9:2E:5F:61 (data size 20) ...

20 bytes from 00:07:E0:0E:E9:EE id 200 time 81.82ms

20 bytes from 00:07:E0:0E:E9:EE id 201 time 44.97ms

20 bytes from 00:07:E0:0E:E9:EE id 202 time 52.82ms

3 sent, 3 received, 0% loss

```

If your output looks similar, your bluetooth setup and PDA are both working great.

5.	PDA configuration

The following instructions are for Palm-compatible devices only.  Similar steps should be followed on the PocketPC.  PM me if you can get it to work and I'll extend this list.

5.1.	Bluetooth configuration

Go to Prefs->Communication->Bluetooth.  Set like so:

Bluetooth:		On.

Device Name:		<Desired Device Name>

Discoverable:		Yes

Allow Wakeup:		No

After setting that, tap the Trusted Devices button, then tap the Add Device button.  The system will search for Bluetooth devices, then present a list of devices detected.  Choose the one corresponding to the name you gave your adapter in step 3, then tap OK.  The Palm will then ask you for a passkey; enter the value you set in the /etc/bluetooth/pin file in step 3.  Tap OK.  The Trusted devices list will reappear, with your computer newly added.  Tap Done, then Done again.

5.2.	Connection configuration

Go to Prefs->Communications->Connection.  Tap New..., and fill in as follows.

Name:		<Whatever you like>

Connect to:	PC

Via:			Bluetooth

Device:		Tap to Find

Then, of course, tap "Tap to Find".  It will go through the discovery process again, then present you with a list of Bluetooth nodes in range.  Select your host's node (now with a key next to it indicating that it is a trusted device), and tap OK.  Tap Details... and fill in:

Speed:		115,200 bps

Flow Ctl:		Automatic

Tap OK, then OK a second time, then Done.

5.3.	Network Configuration

Go to Prefs->Communications->Network.  Tap New, and fill in the following.

Service:		<Whatever you like>

User Name:	<Leave Blank>

Password:	-Prompt-

Connection:	<What you named the connection in 5.2.>

Tap Details..., and set as following:

Connection Type:	PPP

Idle timeout:		3 minutes

Query DNS:		<Checked>

IP Address:		<Checked> Automatic

Tap Script..., and ensure that it merely says "End:".  Tap OK, OK. 

Finally, tap Connect, and watch as your Palm inserts itself into your network!  When an application needs to access the network, it should automatically connect to your network.  

Test out the connectipn by going to the Options->View Log menu.  This log functions as a mini-terminal, as well as giving important diagnostic information.  Use Graffiti to enter the text "ping google.com", and watch the packets fly.  If it works, everything is set up perfectly, and you're ready to start using the network.

6.	Network HotSync setup

To use Network HotSync, you need to use a synchronization suite based on pilot-link, such as jpilot, gnome-pilot, kpilot, or pilot-xfer itself.

6.1.	Palm synchronization suite configuration

As long as the software is based on pilot-link, only one step is necessary: change the "Port" device setting to read "net:any".  That's it!

6.2.	Palm Configuration

Launch the HotSync app.  In each of the menu entries below, make sure the settings match those listed.

Options->Modem  Sync Prefs...

	Network is highlited

LANSync Prefs...

	LANSync is highlighted

Primary PC Setup...

	Primary PC Name:*		<Hostname of the computer>

	Primary PC Address:	<IP Address of the computer>

	Subnet Mask:			<Netmask of your network>

* The Primary PC Name field overrides the value in the Primary PC Address field.  If you are behind a firewall or NAT router, you will need to forward port 14238 to the host computer, even if that host computer is behind the firewall or NAT router.  This is because the Palm will attempt to contact the address resolved, which is probably on the internet rather than in the local network.

In the main HotSync page, highlight the Modem button.  If the dotted box at the bottom of the screen does not display the name of the Network Service you configured in step 5, tap it and change it so that it does.  After that, click HotSync, and everything should work out great.

7.	Tips

This is just a list of all the random things I encountered when trying to get this to work.

First off, install the latest patch available at http://www.bluez.org/patches.html for your kernel.

If you compiled as modules in step 2, try as builtin, and vice versa.

Try upgrading your bluez packages to the latest available.  Gentoo sometimes lags a version or two behind.  In that case, just copy the ebuilds over to your overlay dir, move them to the appropriate version, and have a go at it.  Small edits may be required for a successful emerge.  Be warned that this is unsupported, although it did help me.

If you have any sort of extension between your adapter and your USB port on your computer, remove it.  I've seen (and confirmed personally) that the USB extension cables provided with Broadcom USB dongles (and dongles with Broadcom chips in them) tend to be unstable under Linux, and can cause timeout errors.

If all else fails, post a topic and link to it from this thread.  Often, others will either have seen the problem or will benefit from the solution.

Hope you find it useful!

Steven Robertson

ChangeLog:

20040121 - Updated section 7 with tips.  Thanks, ozonator, for your tips!

20040116 - Updated sections 1, 3.4 (old, removed), 3.6; added section 7 placeholder.

20040106 - Updated section 3.4 to reflect the closure of Bug #36762.

20040104 - Minor cosmetic changes, and a few clarity checks.  One change to the bluetooth_pan script.Last edited by Steven Robertson on Tue Sep 14, 2004 7:58 pm; edited 4 times in total

----------

## cuban

Damn. Now I have no reason to buy that palm!!! I can't wait to try this out. Thanks Steven!

----------

## ozonator

Steven, many thanks for your immensely helpful instructions.  Having just given things a try, with 2.6.1 (development-sources) and a D-link DBT-120 usb dongle, I have a few things to add.

First, I had a pile of trouble getting the dongle to work; I've described that in a separate thread, since it and problems I and others are having with gphoto2 seem to point to a problem with USB and/or hotplugging in 2.6.1.  The short version of the story:  I had to disable hotplugging in the kernel to get the bluetooth dongle to work.  The side-effect, of course, is that I had to make sure the appropriate modules are loaded (put them in /etc/modules.autoload.d/kernel-2.6 for loading at boot) -- hci_usb and rfcomm, in that order, will do it (loading those will autoload other needed modules, like bluetooth).

Re. step 1:  the unmasked version of bluez-utils does not seem to install an /etc/init.d/bluetooth script; having seen this message, I emerged the latest masked version (2.3-r2 as of yesterday), and sure enough, the script appeared.  Just to be safe, I made sure I was using all the most recent bluez packages before continuing.

Re. step 3.3:  I changed 'auth' to 'noauth' in the dun file -- otherwise, pppd would require a password.

Re. step 3.7:  not having hotplug enabled, I did not, of course, run the hotplug init script.  Also, I had to unplug and re-connect the dongle after running the init scripts before everything was recognized correctly.

Re. step 5.2:  though I could pair my Palm with my linux box, and set the linux box as a 'trusted device' on the Palm, I had one mysterious problem: in the connection configuration, nothing I tried could make the linux box appear as an available bluetooth device.  The problem was that although the device class is set properly in /etc/bluetooth/hcid.conf, for some reason, hciconfig -a reported a class of '0x000000'.  Thus, I had to set this manually:  "hciconfig hci0 class 0x100".  After doing that, the linux box appeared as an available connection on the Palm, and I was able to connect to the net from the Palm!  (Somehow, that statement always requires an exclamation point.  :Smile:  )

I intend to experiment some more later, but those are the things I can remember from the first successful try.  Many thanks again for the howto!

----------

## Steven Robertson

ozonator:  I made changes to steps 1, 3.3, 3.7 (well, now 3.6, 'cause I removed 3.4), but I didn't get around to finishing 7 (to include the step you mentioned for 5.2), because I moved my bluetooth stuff to a server box closer to my bedroom so my Palm would be in better range, but the box (an old secondhand PII) was having kernel panics, so I couldn't test it out and make detailed instructions.  After I get it fixed, I'll finish it.

Thanks for trying it out, and I'm glad I could help!

Steven

----------

## ozonator

An update:  thanks to this post, I found out about a kernel patch for 2.6.1 that provides even more up-to-date bluetooth support.  I've applied it, and am using the new kernel now; all seems well so far.

One thing the patch seems to fix:  I no longer need to set the device class with hciconfig, as I described in my previous post; just load the modules and run the bluetooth and bluetoot_pan scripts in init.d, and everything works fine.

----------

## Paradoxx

Can u help my when i start /etc/init.d/bluetooth_pan i get this error

bash-2.05b# /etc/init.d/bluetooth_pan start

 * Starting Bluetooth PAN...

/sbin/runscript.sh: line 11:  : command not found

start-stop-daemon: unrecognized option `-- '

Try `start-stop-daemon --help' for more information.

/sbin/runscript.sh: line 13: --listen: command not found

/sbin/runscript.sh: line 15:  : command not found

start-stop-daemon: unrecognized option `-- '

Try `start-stop-daemon --help' for more information.

/sbin/runscript.sh: line 17: --listen: command not found                              [ !! ]

bash-2.05b#

----------

## ozonator

 *Paradoxx wrote:*   

>          [ -x /usr/bin/pand ] && \
> 
>                  start-stop-daemon --start --quiet --exec /usr/bin/pand --\
> 
>                  --listen --role NAP

 

The error messages are reporting a problem with this bit (all of which is line 11), particularly the start-stop-daemon part.  Just a hunch -- are there any spaces or other non-printing characters after the '\' at the end of the second line?  If there are, the '\' might not be correctly interpreted as 'continue on the next line'.

Otherwise, what you've got matches what I've got here, which works for me.

----------

## Paradoxx

Tanks it whos meney spaises in the faile but i removd them now so it works.

 but now i haw ater problem when im  HotSync and starting sync i get this error  ( Unable to Initiate HotSync operation because The port is in use by another application ) do eney bodey cnown how i fix this?

and im olso wondering how do i setup jpilot so i can us it on blue?

----------

## Steven Robertson

Regarding the HotSync error:

Where does this error occur? (On the palm?  On your desktop sync program?)

If on the palm:

Which palm model/manufacturer?

When does the error occur? (Just after hitting hotsync, or after it tries to connect?)

Can you get regular net access (i.e. not hotsync)?

Is there any weirdness in the Linux kernel logs (run 'dmesg | tail -n 25') or in the system logs (run 'less /var/log/everything/current'), such as PPP errors or pan/dun errors?

If on the desktop:

What sync program are you using?

What 'port' setting have you configured it to use?

Do you have any program running which blocks port 14238?  (You can figure this out by running 'netstat -tlp | grep 14238' as root; the last column (if any output is returned) is the program name and PID of the process using that port.)

Regarding jpilot: The only step you should have to take is to change the "Port" setting to "net:any".  But I don't use jpilot; more steps may well be required.

----------

## Paradoxx

i haw now traid to connect to internet but it dount work. but i can connect to my blue server but when i start  Web pro and tray to connect to internet i get error  DNS lookup timed out. please check coverage, and try agin. [Comm. 8]

and when i go to Network log i get info

local it name 192.168.0.10

gateway addres 192.168.0.7

DNS addresses:    192.168.1.1

			     192.168.1.1

my   /etc/ppp/peers/dun

 noauth      # Don't require authentication

 local         # This is needed because it's not a real serial line

 noipdefault   # Don't use the local hostname to determine the local IP used

 proxyarp      # Proxy ARP connections

 nodefaultroute   # Don't use the default route

 noipx      # Don't use the IPX protocol

 idle 0      # Set an unlimited disconnect timeout

 # Change the next three lines for your setup

 # <Host IP Address>:<Client IP Address>

 192.168.0.7:192.168.0.10

 # ms-dns <DNS Server>

 ms-dns 192.168.1.1

 # netmask <Netmask for your network>

 netmask 255.255.255.0

my ifconfig

bash-2.05b# ifconfig

eth0      Link encap:Ethernet  HWaddr 00:50:70:92:20:37

          inet addr:192.168.1.199  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:686 errors:0 dropped:0 overruns:0 frame:0

          TX packets:640 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:475313 (464.1 Kb)  TX bytes:84725 (82.7 Kb)

          Interrupt:20 Base address:0x6000

lo        Link encap:Local Loopback

          inet addr:127.0.0.1  Mask:255.0.0.0

          UP LOOPBACK RUNNING  MTU:16436  Metric:1

          RX packets:6 errors:0 dropped:0 overruns:0 frame:0

          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:300 (300.0 b)  TX bytes:300 (300.0 b)

im usin tungsten t3

----------

## Steven Robertson

Paradoxx:

```
# <Host IP Address>:<Client IP Address> 

 192.168.0.7:192.168.0.10 
```

Judging from your IP address and subnet mask, you're on a private network with a DHCP server assigning addresses.  You probably have an internet gateway/firewall running at either 192.168.1.1 or 192.168.1.254.  Either way, it appears that the network address is in the 192.168.1.x range, but that you've set the above code to reflect a network in the 192.168.0.x range.

I probably wasn't specific enough when I wrote this the first time, but <Host IP Address> is the IP address of the Linux box with the Bluetooth adapter, and <Client IP Address> is the IP address of the Palm.  Using the values from your ifconfig, recommended settings for this should be something like:

```
# <Host IP Address>:<Client IP Address> 

 192.168.1.199:192.168.1.210 
```

The second number doesn't really matter, as long as it isn't the IP of a computer that's already on your network and it's between 192.168.1.2 and 192.168.1.253.  The first, however, should reflect your current IP address of the Linux box.

HTH.

Steven

----------

## Paradoxx

internet works grate now meney tanks   :Smile: .  now my new problem im traing to sync now but im using jpilot but when i go to jpilot¨s setup it neds somting in /dev/pilot or somting to us so it can sync do u cnown  eney beter sync prog i kan us?

/im using kde-2.3.0 and kernel 2.6.4-rc2

----------

## Steven Robertson

On JPilot: Go to File->Preferences.  Open Settings tab.  Under Serial Port, set the value to "net:any" (no quotes).  That's all you should need.  However, if that doesn't work, you can try and use KPilot.  Note, however, that I encountered instability with version 3.2 and net:any.  I'm emerging 3.2.1 now, and I'll see if it's fixed there.

Steven Robertson

----------

## Paradoxx

 *Steven Robertson wrote:*   

> On JPilot: Go to File->Preferences.  Open Settings tab.  Under Serial Port, set the value to "net:any" (no quotes).  That's all you should need.  However, if that doesn't work, you can try and use KPilot.  Note, however, that I encountered instability with version 3.2 and net:any.  I'm emerging 3.2.1 now, and I'll see if it's fixed there.
> 
> Steven Robertson

 

wher did u find kpilot ebuld?

----------

## Steven Robertson

KPilot is part of the kde-base/kdepim package.  However, you must have the "pda" flag enabled in your USE flags for it to build.  Try:

USE="pda" emerge kdepim

to build and merge it.

----------

## Paradoxx

 *Steven Robertson wrote:*   

> KPilot is part of the kde-base/kdepim package.  However, you must have the "pda" flag enabled in your USE flags for it to build.  Try:
> 
> USE="pda" emerge kdepim
> 
> to build and merge it.

 

did u get it to work?

so u can synk it and backup and install progs?

----------

## bemarnet

Hi all !

I have installed bluez in my Gentoo and now I'm able to download mail and browse the web using my Tungsten T3 and a ppp conection to the Gentoo box (conected to Internet through ADSL router).

I want to sync using bluetooth to a Windows machine located in the same network (is installed in the linux host using vmware) but I don't now how to do it. I have installed Palm desktop and configured the IP address of this PC in the palm, but it does'nt works.

Can you help me ?

Thanks in advance.

----------

## Steven Robertson

Bemarnet:

Without VMWare, I can't give you any personal advice.  However, this howto might help:

http://howto.pilot-link.org/netsync/

Steven

----------

## bemarnet

Thanks Steven.

I've looking at http://howto.pilot-link.org/netsync/  but there is no information about doing hotsync via Bluetooth (only using USB Craddle).

----------

## Steven Robertson

Bemarnet:  Sorry for not being clear.  Ignore everything about the Palm; just follow the instructions for setup on the desktop side of things.  The only thing you'll need to change on the Palm is the address of the host computer.  Make it match the address assigned to the VMWare network device.

----------

## Paradoxx

 *Steven Robertson wrote:*   

> Regarding the HotSync error:
> 
> Where does this error occur? (On the palm?  On your desktop sync program?)
> 
> If on the palm:
> ...

 

i haw reley raid now to find out what is wrong but i get the same error stil

this works

i can sync whit my usb

but when im traing to sync ower blue i get error ( Unable to initiate HotSync operation because the port is in us by anoter application when my palm is traing to connect i get this error on my palm tungsten T3

i haw traid dmesg | tail -n 25  i oley get 

 bash-2.05b$ dmesg | tail -n 25

 [<c0157b52>] get_vm_area+0x32/0x40

 [<c011a7fc>] __ioremap+0xbc/0x110

 [<c011a87b>] ioremap_nocache+0x2b/0xb0

 [<e0bc67ab>] os_map_kernel_space+0x68/0x6c [nvidia]

 [<e0bd8e07>] __nvsym00568+0x1f/0x2c [nvidia]

 [<e0bdaf26>] __nvsym00775+0x6e/0xe0 [nvidia]

 [<e0bdafb6>] __nvsym00781+0x1e/0x190 [nvidia]

 [<e0bdca3c>] rm_init_adapter+0xc/0x10 [nvidia]

 [<e0bc2f44>] nv_kern_open+0x11b/0x261 [nvidia]

 [<c0167f2c>] chrdev_open+0x11c/0x290

 [<c015eab8>] get_empty_filp+0x68/0xe0

 [<c015cd82>] dentry_open+0x152/0x220

 [<c015cc22>] filp_open+0x62/0x70

 [<c015d17b>] sys_open+0x5b/0x90

 [<c010762b>] syscall_call+0x7/0xb

agpgart: Found an AGP 2.0 compliant device at 0000:00:00.0.

agpgart: Putting AGP V2 device at 0000:00:00.0 into 4x mode

agpgart: Putting AGP V2 device at 0000:03:00.0 into 4x mode

atkbd.c: Unknown key released (translated set 2, code 0x7a on isa0060/serio0).

atkbd.c: This is an XFree86 bug. It shouldn't access hardware directly.

atkbd.c: Unknown key released (translated set 2, code 0x7a on isa0060/serio0).

atkbd.c: This is an XFree86 bug. It shouldn't access hardware directly.

CSLIP: code copyright 1989 Regents of the University of California

PPP generic driver version 2.4.2

bash-2.05b$

bash-2.05b# netstat -tlp | grep 14238

tcp        0      0 *:14238                 *:*                     LISTEN      5659/kpilotDaemon

bash-2.05b#

im using kpilot 

im wondering how do i setup  "net:any"   on kpilot??

----------

## Markrian

Excellent guide!

But I encountered a problem that took quite a bit of googling to solve.

I was constantly encountering timeout errors on the Palm when trying to connect to the PC, with messages like "Error: PPP timeout (0x1231)". Anyway, to cut a long story short, I use udev, and evidently it doesn't create certain device nodes that are necessary for all this to work. These device nodes must exist:

```
# ll /dev/rf*

crw-r--r--    1 root     root     216,   0 Apr 29 22:09 /dev/rfcomm0

crw-r--r--    1 root     root     216,   1 Apr 29 22:00 /dev/rfcomm1

crw-r--r--    1 root     root     216,   2 Apr 29 22:00 /dev/rfcomm2
```

They can be created with the following commands:

```
mknod /dev/rfcomm0 c 216 0

mknod /dev/rfcomm1 c 216 1

mknod /dev/rfcomm2 c 216 2
```

After creating these nodes, I could connect my T3 to my PC no problem. Now, I didn't work all of this out myself  :Wink:  In fact, I didn't work ANY of it out. I found the info here: http://www.grinta.net/howto/bluez-ipaq.html

Hope that helps anyone having similar problems.

----------

## ozonator

An update that's pertinent to the guide here:  as of version 2.7 (still masked, as of the time of this post), bluez-libs includes the components of bluez-sdp, and bluez-utils includes the components of bluez-pan.  So, if you're emerging 2.7 or later of bluez-[utils|libs], bluez-[sdp|pan] no longer need to be emerged; in fact, they're now blocked by the newer [utils|libs] ebuilds.  (See bug 50620.)

If you're upgrading, bluez-sdp and bluez-pan can be unmerged before emerging 2.7 or later of bluez-utils and bluez-libs.  I just did that myself (upgraded from 2.5 of [utils|libs]), and the new versions work nicely with my T3 (and kernel 2.6.6), no changes needed to any configs or scripts.   :Smile: 

----------

## meulie

Will this have consequences for the bluetooth_pan script?

----------

## ozonator

 *meulie wrote:*   

> Will this have consequences for the bluetooth_pan script?

 

Not as far as I can tell.  I didn't change anything in the script: after unmerging the no-longer-needed bluez-sdp and bluez-pan, and emerging the new versions of bluez-libs and bluez-utils, the bluetooth_pan script works just as well as it did before.

----------

## meulie

My mistake...  Something had gone wrong with the emerge-ing here and I had no pand & dund...    :Cool: 

Well, I've now been able to follow your tutorial all the way to point 5. Since I have a HP iPAQ 2210 instead of a Palm, I'm getting a bit lost here...    :Confused: 

Is there anybody out there who has gotten this to work with an iPAQ?

----------

## dhabersa

 *meulie wrote:*   

> Is there anybody out there who has gotten this to work with an iPAQ?

 

Why, yes.  I just got it working on my hp 2200 a few minutes ago!  I take it you're having problems configuring the iPAQ to communicate properly?  I'll try to list what I did to get mine working, though I haven't yet tried syncing it, just internet.

1.  Go to the bluetooth manager (one way is by clicking on the bluetooth taskbar icon).

2.  Follow the directions and tap "New > Connect!"

3.  Select "Connect to the Internet" and click next.  I don't think you can just use the explore option, otherwise you don't get the dialog to setup a bluetooth null modem (needed for IE to connect).

4.  Choose the default "Connect via a LAN access point..." and hit next.

5.  Click on the device box to scan for available devices.  Your PC, when properly configured, should register.  Just select it and contiune.

6.  If you haven't already setup a paired connection (Tools>paired devices from bluetooth manager), go ahead and enter the PIN you setup earlier.  Click okay in the top right corner.

7.  You need to create a shortcut at this next screen, just call it want and then enable secure, encrypted connection (recommended!).

8.  Next, the PDA should attempt to log on, prompting you with username, password, and domain.  leave these all blank and hit okay.

9.  You're all done now.  Go ahead and test the connection by browsing the web or doing whatever you'd like.

Hope that helps!

----------

## Steven Robertson

 *Quote:*   

> I'll try to list what I did to get mine working, though I haven't yet tried syncing it, just internet.

 

If you manage to get syncing working, and are willing to write instructions, I would be happy to add them (plus the above steps) to the howto.  Thanks!

Also, I just updated the howto to reflect the removal of bluez-(pan|sdp) for >2.7, fyi.

----------

## dhabersa

I should probably point out for people that I'm running PPC 2003; I don't know how any of the os-specific setup changes for other versions.

I was able to get my iPAQ to open an ActiveSync connection with my linux box over bluetooth by following the directions at http://synce.sourceforge.net/synce/setup.php.  

There's only a few additional steps from what you've already supplied listed there, which I'll repeat here for clarity.

1.  Changed device class in /etc/bluetooth/hcid.conf from 0x100 to 0x114.  I don't know if this was actually necessary.  I believe 0x114 is the class for my PDA (I think 0x110 would be for a 'clam-shell' style PDA, if you follow their link on the topic).

2.  Start dund.  

```
dund --listen --msdun call dun
```

3.  Advertise the serial profile.  

```
sdptool add SP
```

4.  To make it resume upon startup, add the following lines to your /etc/conf.d/local.start:

```
/usr/bin/dund --listen --msdun call dun

/usr/bin/sudo -u [i]username[/i] /usr/bin/dccm
```

5.  In the Bluetooth Manager on the PDA, click on "New>Connect!"

6.  Select "ActiveSync via Bluetooth"

7.  Tap through until you see the device selection screen.  Click in the box and you should see your desktop on the list.  Select it and the PDA should try to make a quick connection to it.

8.  On the next screen, go ahead and name your connection and check the secure and encrypted box (recommended).

9.  Setup is done.  Your PDA should now be able to connect to your dekstop with ActiveSync over bluetooth.

From here, you should be able to use the simple synce tools to transfer files to and from your PDA.

When I get a chance, my next goal is to get my iPAQ syncing with Ximian Evolution.  I'll be happy to post the steps I take once I've figured them out.

Later!

----------

## Stubbs

Is there any way to make DUN use DHCP?

----------

## meulie

 *dhabersa wrote:*   

>  *meulie wrote:*   Is there anybody out there who has gotten this to work with an iPAQ? 
> 
> Why, yes.  I just got it working on my hp 2200 a few minutes ago!  I take it you're having problems configuring the iPAQ to communicate properly?  I'll try to list what I did to get mine working, though I haven't yet tried syncing it, just internet.
> 
> 1.  Go to the bluetooth manager (one way is by clicking on the bluetooth taskbar icon).
> ...

 

Hmm, I do not get the username/password/domain mentioned at #8. At the end when trying to browse I get: Unable to connect: You have no modem entries created, and no network card present'.

(at this moment I DO have a functioning bluetooth-link. l2ping works fine)

Who knows how to fix this...?

----------

## meulie

addition: this is what the server-side shows when I connect from the iPAQ. Does it look ok/normal?

```

Aug  4 13:35:20 sb62g2 hcid[7415]: link_key_request (sba=00:03:C9:28:8E:3B, dba=00:04:3E:61:10:56)

Aug  4 13:35:21 sb62g2 net.agent[6581]: add event not handled

Aug  4 13:35:21 sb62g2 pand[6579]: New connection from 00:04:3E:61:20:66 bnep0

```

----------

## Trejkaz

I got everything working for about 30 seconds of bliss, and it hasn't worked since.

Now, I hit connect, and the Palm (Tungsten T3) sits on "Initializing" forever, with nothing appearing in my system logs.

Native bluetooth stuff still works fine, as far as I can tell, except I don't actually have any apps on the PC which would be sane to hook up with any of the apps on the Palm... yet.  But each machine can see the other, and they paired with no trouble.

So I restarted bluetooth and bluetooth_pan, and kept watch on the logs again.

This time I hit connect, and the Palm still sits on "Initializing" but there is one line in the logs:

```

Aug  6 22:48:13 [hcid] link_key_request (sba=00:0B:0D:40:14:0D, dba=00:07:E0:3A:21:AC)_

```

Has anyone encountered this before, and do you know how to fix it?

----------

## ozonator

 *Trejkaz wrote:*   

> This time I hit connect, and the Palm still sits on "Initializing" but there is one line in the logs:
> 
> ```
> 
> Aug  6 22:48:13 [hcid] link_key_request (sba=00:0B:0D:40:14:0D, dba=00:07:E0:3A:21:AC)_
> ...

 

That line looks normal to me -- I see the same thing when connecting with my T3.  In my logs, the hcid log entry is followed by an entry from dund ("new connection from ... "), then a bunch of entries from pppd indicating that the ppp connection is starting, including that local and remote addresses have been assigned.

If all you're seeing is that link_key_request line, but nothing from dund and/or pppd, that's probably the best clue re. where to start looking for the problem:  is dund running?  It should be started by the bluetooth_pan init script, but does it stay running, or exit unexpectedly?

----------

## Sebi

Hello,

nice HowTo! Got my Tungsten connected via BlueTooth. Great!

I had some trouble getting the HotSync to work. Network connection was just fine, but HotSync failed (the Palm connected, but then gave an error message saying it couldn't create a connection to the host). On another page I found a hint: in the "primary PC setup" leave blank the PC name and netmask, only type the IP of the host pc. I tried out - and it works perfectly now (using pilot-xfer as well as KPilot, didn't try out JPilot but should work as it depends on pilot-link).

Sebi

----------

## Trejkaz

It was running the whole time. :-/

But I just did a kernel upgrade which fixed some other things, so maybe I'll get lucky and it will "fix itself."

Edit: and yes, it's pretty stable now.  Excellent.  So if you're on 2.6.5 and random problems are occurring, try upgrading.  I'm on 2.6.7 now and everything seems to be dandy.

There's something perverse about using BitchX from a Palm unit via SSH though.   :Wink: 

----------

## TheRealYoda

Hi all,

Does anyone here know how to configure bluetooth in gentoo so that it creates a virtual serial port that I can connect to with my PDA (iPAQ 2210).

Basically, I just want to be able to launch the Bluetooth Manager on the PDA, do a search and connect to my gentoo box over a serial connection.

So far I have recompiled my kernel with Bluetooth support and have emerged bluez-utils and bluez-sdp.

I have got my Bluetooth dongle working, and the PDA can "see" the gentoo box, but currently the gentoo box is not "advertising" any services.

Modules that are currently loaded relating to bluetooth:

```

rfcomm                 32764  0

l2cap                  19236  5 rfcomm

hci_usb                10752  2

bluetooth              39716  7 rfcomm,l2cap,hci_usb

```

Output from hciconfig -a:

```

hci0:   Type: USB

        BD Address: 00:10:60:A7:D5:8C ACL MTU: 192:8  SCO MTU: 64:8

        UP RUNNING PSCAN ISCAN

        RX bytes:4825 acl:89 sco:0 events:197 errors:0

        TX bytes:2942 acl:83 sco:0 commands:53 errors:0

        Features: 0xff 0xff 0x0f 0x00

        Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3

        Link policy: HOLD SNIFF PARK

        Link mode: SLAVE ACCEPT

        Name: 'BlueZ (0)'

        Class: 0x000100

        Service Classes: Unspecified

        Device Class: Computer, Uncategorized

        HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d

        Manufacturer: Cambridge Silicon Radio (10)

```

Any help, or url's pointing to howto's is greatly appreciated.

Cheers,

Steve

----------

## Trejkaz

Did you do the "sdptool add SP" bit?

----------

## TheRealYoda

 *Trejkaz wrote:*   

> Did you do the "sdptool add SP" bit?

 

Yeah, I actually did try starting sdpd and doing a "sdptool add SP" and the service did show up on the PDA, however I couldn't connect to it. It gave up trying to connect pretty well straight away and MS PocketPC gave a really useful error along the lines of "An error occurred while trying to connect".

I suspected this would fail as I assume there has to be another step where you configure the virtual serial port in gentoo (eg /dev/ttyXX)?

I have search these forums and googled for ages, but havent found anything. I found heaps about setting up PPP, etc, but nothing on simply creating a virtual serial port.

Just a little background info on what i'm ultimately trying to achieve.  I've setup an SBC running uCLinux that connects to a GPS. Im going to write a little daemon that forwards NMEA messages to the virtual serial port.  The PDA running some mapping software will connect to the virtual serial port and use the NMEA messages to determine a location.

Anyway, has anyone else setup a virtual serial port before?

Cheers,

Steve

----------

## Trejkaz

I think I remember having to go "mknod rfcomm0 c 216 0" to create /dev/rfcomm0 when I first did it, but the damnedest thing is that file doesn't seem to exist on my system right now (looking at it remotely), yet I know that I can can still connect to the network via Bluetooth from my Palm, which requires this port to be open (since we use PPP via that to get networking.)  Maybe it gets created automagically.(?)

The annoying glitch which still happens on my connection is that it will deny all connections randomly after being off for a while, but pulling out the bluetooth adapter and putting it back makes things start working again.  So maybe this auto-creation happens at insert time.  Or maybe there is a kernel bug that hasn't been squashed yet.  :Smile: 

----------

## TheRealYoda

Thanks for your help Trejkaz!!

I now have it working, and it wasn't very hard at all!

For everyone else, this is how I created a Bluetooth Virtual Serial Port for my iPAQ to connect to:

1) Enabled BT support in the kernel

2) Emerged ver. 2.7 of bluez-utils and bluez-libs

3) /etc/init.d/bluetooth start

4) mknod /dev/rfcomm0 c 216 0

5) sdptool add SP

6) rfcomm listen /dev/rfcomm0 1

and it's as simple as that!

Cheers,

Steve

----------

## meulie

Hmm, it still doesn't work on my H2210...   :-/

----------

## CTU-Butler

Great guide but I'm having some difficulty getting my T3 to connect. I can get as far as hitting 'Connect' on the Palm to test the network connection, the Palm gets as far as "signing on..." while

Sep  6 15:33:36 akuma dund[9134]: New connection from 00:07:E0:2F:77:BB

is displayed in my /var/log/messages, but then I get the PPP 0x1231 timeout error on the Palm and nothing else happens. The Network Log doesn't show anything, and I've double checked everything and cant see anything wrong (the rfcomm0 node is created by udev, I can ping the PDA etc.). Any ideas from anyone?

----------

## ozonator

 *CTU-Butler wrote:*   

> I can get as far as hitting 'Connect' on the Palm to test the network connection, the Palm gets as far as "signing on..." while
> 
> Sep  6 15:33:36 akuma dund[9134]: New connection from 00:07:E0:2F:77:BB
> 
> is displayed in my /var/log/messages, but then I get the PPP 0x1231 timeout error on the Palm and nothing else happens.

 

On your Linux box, is pppd running and properly configured?  On my machines, after the message from dund, I see a bunch of entries from pppd indicating that the ppp connection is starting, including that local and remote addresses have been assigned.

----------

## Steven Robertson

Hey.  Sorry I haven't been updating; somehow I stopped watching this thread and as I no longer sync with bluetooth (I use an SD card; faster and simpler for my needs) it's not been on my mind.

I'm going to keep this as a discussion/help thread, and maybe ask the mods to move it to a more appropriate forum, and move the howto to the gentoo-wiki soon.  That way you won't rely on forgetful old me for updates. :)

Steve

----------

## CTU-Butler

 *ozonator wrote:*   

> On your Linux box, is pppd running and properly configured?  On my machines, after the message from dund, I see a bunch of entries from pppd indicating that the ppp connection is starting, including that local and remote addresses have been assigned.

 

It's always the simple things isn't it  :Smile:  thank you sir, here's a virtual beer for you!

However I still have a problem, the connection can now be established but on trying to sync pilot-link gives me the incredibly useful error:

```
Listening to port: net:any

Please press the HotSync button now... Connected

Error read system info on net:any
```

and JPilot the slightly more descriptive:

```
****************************************

 Syncing on device net:any

 Press the HotSync button now

****************************************

dlp_ReadSysInfo error

Exiting with status SYNC_ERROR_READSYSINFO

Finished
```

Has anyone bumped into these and if so how did you solve them?

----------

## ozonator

Glad to hear getting ppp running helped!  Now...

 *CTU-Butler wrote:*   

> However I still have a problem, the connection can now be established but on trying to sync pilot-link gives me the incredibly useful error:
> 
> ```
> Listening to port: net:any
> 
> ...

 

I don't recall ever seeing that error before, but my guess is that it's a way of saying that the communication with the Palm wasn't properly established.  What did you see on the Palm?  Was it a normal-looking 'timeout' error?

One thing that you can do to help debug this is to try to use a networked application on the Palm other than HotSync.  The key part of the sync-over-bluetooth method is to get the Palm online -- i.e., with its own TCP/IP settings (assigned by pppd, settings in /etc/ppp/peers/<name>, where name is the service name that dund is told to use in the init scripts.  Thus configured, the Palm can use the internet through the machine to which it's connected over bluetooth; hotsync'ing is just one thing that's done over that network connection. 

If the network connection is working properly, you should be able to use WebPro on the Palm to surf, or pssh to ssh somewhere, etc.  Also, you should see info in syslog that indicates that the Palm has been assigned an IP address when it connects, and a ppp interface in the output of '/sbin/ifconfig -a'.  If that all looks good, then you can focus on hotsync-related settings (e.g., 'primary pc setup' in the hotsync app on the Palm).  If not, then getting that networking going is the key -- messages in syslog will be useful for that.

So:  is your T3 getting on the net successfully?  If not, what are you seeing in syslog, and what are your pppd settings for the connection used by dund?  If so, what are the settings in the Palm's HotSync app?

----------

## CTU-Butler

Firstly thanks again for your patient help!

OK, I can browse on WebPro fine from the Palm so it looks like the networking is fine.

My Palm HotSync prefs are:

Modem Sync Prefs : Network

LANSync Prefs : LANSync

Primary PC Setup : PC Name (I left this blank as I want it to use the IP below)

Primary PC Setup : PC Address 192.168.0.254 (internal IP of my Linux box)

Primary PC Setup : Subnet Mask 255.255.255.0

Am I wrong on the whole PC Name thing?

----------

## CTU-Butler

Woohoo, problem solved by a hard reset of the Palm.

Thanks again for all the help!

----------

## meulie

 *Steven Robertson wrote:*   

> 
> 
> 3.3.	/etc/ppp/peers/dun
> 
> This file doesn't exist, so you'll need to create it.  Here's mine (you should change yours to match your settings):
> ...

 

A newbie-question: the Host IP Address, should that be the same as the IP address of the machine that has the bluetooth unit connected, or should '<Host IP Address>:<Client IP Address>' be its own little 2-node network?

----------

## ozonator

 *meulie wrote:*   

> A newbie-question: the Host IP Address, should that be the same as the IP address of the machine that has the bluetooth unit connected, or should '<Host IP Address>:<Client IP Address>' be its own little 2-node network?

 

It's its own little 2-node network.  I've set mine to be two otherwise unused IPs on my home net -- e.g., with a home net of 192.168.0.0/24, I would use 192.168.0.100:192.168.0.101 for host:client, assuming neither is already in use on your subnet.  I'm not completely sure, but I don't think you have to use IPs on an existing subnet, since I assume ppp will handle routing through the host computer appropriately; I did it that way just to make things a bit simpler to remember.

----------

## rcxAsh

Thanks for the guide!

Still can't hotsync, but even before that, I'm trying to get the network connection going.

I have to continually do the:

```
mknod /dev/rfcomm0 c 216 0
```

Before I can ever connect (else I get the PPP timeout).  Interestingly... I think that when I first start the daemons, rfcomm0 is created.  However, I can't connect initially.  After failing the first time, the node disappears.  Then I create it manually and I can connect.  Disconnecting will cause the node rfcomm0 to disappear again.  The next time when I try to connect again, rfcomm0 is created automagically again.  However, the connection times out and rfcomm0 disappears again.  I must create rfcomm0 before initializing a connection, or the connection will timeout.  

But anyways.  I can connect.  The problem is that the only connection I get is between my PDA (Sony Clie UX40) and my computer.  I can ping my computer and ssh into it.  However, once I try to ping anything outside of my network from my Clie, I get nothing.  

And for later, regarding the hotsyncing.  It seems like the way described in the howto is more of a network sync.  However, is there no way to do it directly like in Windows?  Eg, in Windows, the Hotsync manager will listen on a bluetooth serial port.  I tried setting pilot-link (jpilot) to listen to /dev/rfcomm0, but it didn't work.  It would fail to bind as follows:

```
****************************************

 Syncing on device /dev/rfcomm0

 Press the HotSync button now

****************************************

pi_bind Permission denied

Check your serial port and settings

Exiting with status SYNC_ERROR_BIND

Finished
```

Incidentally, I couldn't get the method described in the howto working either.  My Clie just gives me a Fatal Exception when I tap the hotsync button.  (It seems that my Clie doesn't like network syncs.. I tried to use a WiFi memory stick connection to sync using pilot-link's net:any.. fatal exception as well).  

(Wah, on another note.. my USB syncing just seemed to die.  Not sure if it's because I just plugged in the USB bluetooth adapter?)

----------

## rcxAsh

Ahh, got it working.  This is so great.  Syncing over bluetooth!  Yay.  

My problems were solved by installing iptables, and then adding the rule:

```
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
```

This was from another howto here:

http://www.harbaum.org/till/palm/bluetooth/index.html

I could then access things outside my network.  

Then for the syncing, I found two things:

1) I had entered the wrong IP address into the Primary PC Setup.  

2) I personally should connect via bluetooth first, and then hotsync.  Rather than letting hotsync connect for me.  (This way, I get no fatal exception).

/dev/rfcomm0 still has to be created manually, but at least everything else is working!

----------

## momerath

I've followed the directions in the first post as well as the steps someone posted for making the connection from a pocketpc.  On the pocketpc side the connection seems to go smoothly, but I'm unable to get anywhere with IE (all I really want to connect to is the host's own web server).  On the linux side, the only seemingly relevant log messages I get are: "[pand] New connection from MACADDY bnep0" followed by "[net.agent] add event not handled".  I can l2ping the ipaq (2215), and I've tried a few things on my own (like ipconfig bnep0 192.168.0.101 (which is what I have set as host ip in /etc/ppp/peers/dun)

I'm stuck- does anyone have a hint?

Edit:

Actually when I've got the bluetooth pan device on the ipaq set to the right ip and I connect and then ifconfig bnep0 with its ip, I'm able to connect to the host's web server.  Unfortunately the whole point of my setup is to not have to whip the notebook out of my bag every time I want to change tunes.  Should ppp be handling this or something else?  "/etc/init.d/net.ppp0 start" errors out saying that /dev/ttyS1 is an unrecognized option.  I see in /etc/conf.d/net.ppp0 where this is set, but I dont know what to configure it with, or whether it needs to be (seeing as how its not in the howto)

----------

## cylgalad

Hi, nice howto but I can't get it to work, here's what the log says :

```

Mar  7 12:29:23 cathy dund[16813]: New connection from <mac-addr hidden ;)>

Mar  7 12:29:23 cathy pppd[16820]: pppd 2.4.3 started by root, uid 0

Mar  7 12:29:23 cathy pppd[16820]: Using interface ppp1

Mar  7 12:29:23 cathy pppd[16820]: Connect: ppp1 <--> /dev/bluetooth/rfcomm/0

Mar  7 12:29:53 cathy pppd[16820]: LCP: timeout sending Config-Requests

Mar  7 12:29:53 cathy pppd[16820]: Connection terminated.

Mar  7 12:29:53 cathy pppd[16820]: Using interface ppp1

Mar  7 12:29:53 cathy pppd[16820]: Connect: ppp1 <--> /dev/bluetooth/rfcomm/0

Mar  7 12:29:53 cathy pppd[16820]: tcflush failed: Bad file descriptor

Mar  7 12:29:53 cathy pppd[16820]: tcsetattr: Invalid argument (line 1027)

Mar  7 12:29:53 cathy pppd[16820]: Exit.

```

----------

## cylgalad

Adding debug in the ppp dun file give me :

```

pppd 2.4.3 started by root, uid 0      │=6

07│Mar 11 12:22:57 cathy pppd[18054]: using channel 3                        │

Ma│Mar 11 12:22:57 cathy pppd[18054]: Using interface ppp1                   │11

4 │Mar 11 12:22:57 cathy pppd[18054]: Connect: ppp1 <--> /dev/pts/7          │=6

07│Mar 11 12:23:00 cathy pppd[18054]: rcvd [proto=0x7eff] 7d 23 c0 21 7d 21 7│

Ma│d 22 7d 20 7d 2e 7d 22 7d 26 7d 20 7d 20 7d 20 7d 20 7d 27 7d 22 7d 28 7d │9

DS│22 ...                                                                    │50

54│Mar 11 12:23:00 cathy pppd[18054]: Discarded non-LCP packet when LCP not o│

Ma│pen

```

With pppdump :

```

time  3.7s

rcvd "~\ff}#\c0!}!}\"} }.}\"}&} } } } }'}\"}(}\"\87:~"

time  4.0s

rcvd "~\ff}#\c0!}!}#} }.}\"}&} } } } }'}\"}(}\"*?~"

time  4.0s

rcvd "~\ff}#\c0!}!}$} }.}\"}&} } } } }'}\"}(}\"i'~"

time  4.0s

rcvd "~\ff}#\c0!}!}%} }.}\"}&} } } } }'}\"}(}\"\c4\"~"

time  4.0s

rcvd "~\ff}#\c0!}!}&} }.}\"}&} } } } }'}\"}(}\"3,~"

time  4.0s

rcvd "~\ff}#\c0!}!}'} }.}\"}&} } } } }'}\"}(}\"\9e)~"

time  4.0s

rcvd "~\ff}#\c0!}!}(} }.}\"}&} } } } }'}\"}(}\"\b5}<~"

time  4.0s

end recv

```

So it's receiving data it doesn't seem to handle

----------

## Stolz

 *dhabersa wrote:*   

>  *meulie wrote:*   Is there anybody out there who has gotten this to work with an iPAQ? 
> 
> Why, yes.  I just got it working on my hp 2200 a few minutes ago!  I take it you're having problems configuring the iPAQ to communicate properly?  I'll try to list what I did to get mine working, though I haven't yet tried syncing it, just internet.
> 
> 1.  Go to the bluetooth manager (one way is by clicking on the bluetooth taskbar icon).
> ...

 

I get it working following your steps and the ones of the first post. Thank you guys  :Smile: 

The only problem I've had is the error

May 10 03:01:36 azul pppd[12532]: pppd is unable to open the /dev/ppp device. You need to create the /dev/ppp device node by executing the following command as root:    mknod /dev/ppp c 108 0

And as it suggests, mknod did the job  :Wink: 

```
mknod /dev/ppp c 108 0
```

Cheers

----------

## birkinshawc

I am getting the following error on connection attempt:

Jun 25 11:12:20 router hcid[17604]: link_key_request (sba=00:11:67:02:C3:37, dba=00:02:C7:19:78:03) 

Jun 25 11:12:23 router dund[2737]: New connection from 00:02:C7:19:78:03 

Jun 25 11:12:23 router pppd[2745]: Plugin /usr/lib/pppd/2.4.2/pppoatm.so loaded. 

Jun 25 11:12:23 router pppd[2745]: unrecognized option '/dev/rfcomm0' 

The node /dev/rfcomm0 exists, and the output of the rfcomm command shows: 

rfcomm0: 00:11:67:02:C3:37 -> 00:02:C7:19:78:03 channel 1 connected [reuse-dlc release-on-hup ] 

Any ideas?

Chris

----------

## asyr

Folks,

I'm following the guide here, but I do not have full success...

I can communicate my Palm Zire 72 to my laptop thrue bluetooth to exchange files and to get internet connection, but I do not get sync to work.

When I put 'net:any' to the kpilot, it gets crazy and not sync performed from the pilot device...

The sync works file true the USB cable...

Any ideas?

----------

## lixantrope

 *momerath wrote:*   

> On the linux side, the only seemingly relevant log messages I get are: "[pand] New connection from MACADDY bnep0" followed by "[net.agent] add event not handled".  I can l2ping the ipaq (2215), and I've tried a few things on my own (like ipconfig bnep0 192.168.0.101 (which is what I have set as host ip in /etc/ppp/peers/dun)
> 
> I'm stuck- does anyone have a hint?
> 
> Edit:
> ...

 

I had the same problem and the solution is quite easy. The "net.agent: add event not handled" message is from hotplug. The hotplug script (located at /etc/hotplug/net.agent) tries to run script /etc/init.d/net.INTERFACE_NAME (where INTERFACE name is bnep0 in this case). So all you need to do is to create a script /etc/init.d/net.bnep0 (and make it executable and owned by root):

```

#!/sbin/runscript

start() {

        ebegin "Bringing bnep0 up"

        /sbin/ifconfig bnep0 192.168.10.1 up

        eend $?

}

stop() {

        ebegin "Bringing bnep0 down"

        ifconfig bnep0 down

        eend

}

```

The only important line is the ifconfig line, it brings the interface up when you connect from PDA. Just put an IP that suits your situation.

----------

## Elijah

*bump

I tried the guide numerous times now with some success, I could ping google.com but for some reason blazer(my treo web browser) simply won't connect, it's stuck at 'Sending..'

Can anyone lend a hand please?   :Sad: 

----------

## tightcode

I am suffering the same problems as Elijah.

I can ping local and non local hosts from the View Log mini-term, but Blazer, the Treo web browser, appears to be unable to reach anything. It also can't load a site from the IP of the gateway through which it is connecting, it is as if it is not using the connection we just established.

I followed the instructions here: http://gentoo-wiki.com/HOWTO_Palm_Bluetooth_Reverse_DUN and again it makes the connection, can ping outside the local network, simply the builtin Blazer browser appears to not be able to.

The device is a Palm Treo 700p. Any and all help is welcome!

Cheers,

TightCode

----------

## fuzion

Hopefully someone can help me as I've spent many hours running around in circles like a dog chasing his own tail.

I get to this point:

 *Quote:*   

>  tux linux # hcitool scan
> 
> Scanning ...
> 
>         00:06:56:xx:xx:xx       devin
> ...

 

 *Quote:*   

> tux linux # l2ping 00:06:56:xx:xx:xx
> 
> Ping: 00:06:56:xx:xx:xx from 00:11:67:yy:yy:yy (data size 44) ...
> 
> 44 bytes from 00:06:56:xx:xx:xx id 0 time 42.79ms
> ...

 

Then the palm displays  *Quote:*   

> Devices pair successfully

 

hcidump shows:

 *Quote:*   

> tux bluetooth # hcidump
> 
> HCI sniffer - Bluetooth packet analyzer ver 1.30
> 
> device: hci0 snap_len: 1028 filter: 0xffffffff
> ...

 

Now I try to set the discovered bluetooth device as the default device on my palm and it displays:

 *Quote:*   

> Getting services...

 

At which point hcidump displays:

 *Quote:*   

> < HCI Command: Disconnect (0x01|0x0006) plen 3
> 
> > HCI Event: Command Status (0x0f) plen 4
> 
> > HCI Event: Disconn Complete (0x05) plen 4
> ...

 

Then the palm times out and displays  *Quote:*   

> Bluetooth timeout (0x803C)

 

My *guess* is that I don't have ppp setup properly as none of the howtos really describe clearly how to do that.  From the top of my head I think that I need to have a virtual serial port (ttySx?) pointing to a pppd?  It also looks like something is wrong with my Linux setup as there seems to be a request from the palm that is received by the Linux computer but no corresponding response is sent out back to the palm.

Any and all help would be greatly appreciated!

Here are my config files:

/etc/bluetooth/hcid.conf

```
#

# HCI daemon configuration file.

#

# great bluetooth howto with palm/gentoo:

# forums.gentoo.org/viewtopic-t-121109-highlight-sdpd.html

# HCId options

options {

        # Automatically initialize new devices

        autoinit yes;

        # Security Manager mode

        #   none - Security manager disabled

        #   auto - Use local PIN for incoming connections

        #   user - Always ask user for a PIN

        #

        security auto;

        # Pairing mode

        #   none  - Pairing disabled

        #   multi - Allow pairing with already paired devices

        #   once  - Pair once and deny successive attempts

        pairing multi;

        # PIN helper

        pin_helper /etc/bluetooth/pin;

        # D-Bus PIN helper

        #dbus_pin_helper;

}

# Default settings for HCI devices

device {

        # Local device name

        #   %d - device id

        #   %h - host name

        name "%h (%d)";

        # Local device class

        #class 0x3e0100; # original class

        class 0x100;

        # Default packet type

        #pkt_type DH1,DM1,HV1;

        # Inquiry and Page scan

        iscan enable; pscan enable;

        # Default link mode

        #   none   - no specific policy 

        #   accept - always accept incoming connections

        #   master - become master on incoming connections,

        #            deny role switch on outgoing connections

        lm accept,master;

        # Default link policy

        #   none    - no specific policy

        #   rswitch - allow role switch

        #   hold    - allow hold mode

        #   sniff   - allow sniff mode

        #   park    - allow park mode

        lp hold,sniff,park;

        # Authentication and Encryption (Security Mode 3)

        auth enable;

        encrypt enable;

}

```

/etc/bluetooth/rfcomm.conf 

```
#

# RFCOMM configuration file.

#

rfcomm0 {

        # Automatically bind the device at startup

        bind yes;

        # Bluetooth address of the device

        device 00:06:56:xx:xx:xx;

        # RFCOMM channel for the connection

        channel 1;

        # Description of the connection

#       comment "Example Bluetooth device";

}

```

/etc/bluetooth/pin

```
#!/bin/sh

echo "PIN:123456"

```

/etc/conf.d/bluetooth 

```
# Config file for hcid

HCID_CONFIG="/etc/bluetooth/hcid.conf"

# Start sdpd (allowed values are "true" and "false")

SDPD_ENABLE=true

# Start hidd (allowed values are "true" and "false")

HIDD_ENABLE=false

# Arguments to hidd

HIDD_OPTIONS=""

# Run hid2hci (allowed values are "true" and "false")

HID2HCI_ENABLE=false

# Bind rfcomm devices (allowed values are "true" and "false")

RFCOMM_ENABLE=true

# Config file for rfcomm

RFCOMM_CONFIG="/etc/bluetooth/rfcomm.conf"

# Start dund (allowed values are "true" and "false")

# If you want to use dund, you must install: net-dialup/ppp .

DUND_ENABLE=true

# Arguments to dund

DUND_OPTIONS="--listen --persist --msdun call palm"

# Start pand (allowed values are "true" and "false")

PAND_ENABLE=true

# Arguments to pand

PAND_OPTIONS="--listen --role NAP --master --autozap"

```

----------

## fuzion

It's a miracle (for me).  I ran the following:

 *Quote:*   

> tux linux # sdptool add DUN
> 
> Dial-Up Networking service registered
> 
> tux linux # sdptool add LAN
> ...

 

and then magically the Dial-Up Networking service showed up on my palm! Woohaaa...  unfortunately now when I tried to connect to the network through Prefs -> Network I get this error on my palm:

 *Quote:*   

> Error: Bluetooth connect failed SDP conect error (0x801F)

 

but at least I'm at the next step.  Anyone know why DUN/LAN need to be added to sdptool manually?

----------

## NightMonkey

Hrm. Most of this howto is way out of date, and now gentoo-wiki.com is in tatters. I think that this thread should be retired from this forum, since it not only has no value, but is giving people false hope.

Sad posts like this show why an in-house Gentoo Wiki would be quite useful, and how useful gentoo-wiki.com was.

----------

## lysergicacid

 *NightMonkey wrote:*   

> Hrm. Most of this howto is way out of date, and now gentoo-wiki.com is in tatters. I think that this thread should be retired from this forum, since it not only has no value, but is giving people false hope.
> 
> Sad posts like this show why an in-house Gentoo Wiki would be quite useful, and how useful gentoo-wiki.com was.

 

here here i 2nd that :-/ sick of reading these outdated howto's   :Sad:  sadly the same can be said for most of the official gentoo docs too  :Sad: 

----------

