p910i and SyncML hell

I managed to get my p910i synced against my kde desktop pim. i wrote a little script so setup a ppp conection via bluetooth to my p910i mobile.I used multisync as application wich is able to use my kde addressbook resource.

Here is a list of the gentoo packages i have used

  • net-wireless/bluez-utils
  • net-wireless/bluez-libs
  • app-pda/multisync (USE="kdepim")
  • net-dialup/ppp
  • net-analyzer/ngrep

How it works:

  • turn on the USB Bluetooth on your computer. Stop any daemon like kbluetoothd because this will interfere the communication

  • create a sync pair in multisync:

    1. first plugin is KDE Addressbook
    2. second plugin is SyncML
    3. goto SyncML plugin option and select http as transport protocol
    4. enter some password for the connection
  • setup the sync profile on your p910i

    1. open Remote Sync application
    2. goto preferences dialog and enter username syncml and the passwd you used in the multisync plugin config
    3. enter the server address http://169.254.1.65:5079 and quit the dialog
    4. goto the main window click the sync task calendar
    5. enable this task and assign the database name addressbook
  • turn on the P900 Bluetooth and connect to your computer

  • look up baddr of the p910i: hcitool scan

  • run sdptool to add a serial port service: sdptool add SP

  • run rfcomm to listen on channel 1: rfcomm listen 0 1

  • run rfcomm to connect to the P900 bluetooth serial cable: rfcomm connect 2 xx:xx:xx:xx:xx:xx 1

  • the latter rfcomm will connect to the P900 but the P900 will disconnect immediately;

  • the P900 will then initiate a connection to the computer to connect to the rfcomm listening on channel 1;

  • run the as root /usr/sbin/pppd server using: pppd rfcomm0 noauth debug nodetach 169.254.1.65:169.254.1.1

  • just say connect on the p910i if you are asked to select an account for a new internet connection. i just used my standard gprs account. don’t worry this connection won’t be used actually for syncing. just to keep the symbian os happy.

  • as root start ngrep to watch network interface: ngrep -d ppp0

  • finally you click the sync button in the Remote Sync application

  • you should see immediately some http packets on console where you have started ngrep.if not there is something wrong.

    1. check if the pppd daemon is still runing and connected
    2. double check all ips in the mobile phone setttings

Known problems:

  • KDE Address plugin doesn’t handle uft-8 encoding correct, so contacts with special chars will be broken on your phone but will not
    yield an sync conflict on the secound or third sync.Current CVS version of multisync should address this problem, but a didn’t try the most
    recents checkouts.
  • pppd connection seemed to be a little unstable, try you tweak connection settings
    using this pppd flasgs: lcp-echo-failure 10 lcp-echo-interval 86400

if you are familiar with all tools and settings you can use this script so that can avoid using 4 open terminal windows to sync your mobile ๐Ÿ™‚

#!/bin/sh

baddr="00:0F:DE:85:E8:E1"
ip_local="169.254.1.65"
ip_remote="169.254.1.1"

cleanup()
{
        kill -TERM $pid_2
        sleep 0.1
        kill -TERM $pid_1
        ps ax | grep "rfcomm"
        exit -1
}

debug()
{
        echo "########################################################"
        echo $*
        echo "########################################################"
}

trap cleanup 2
sdptool add SP
debug "Listen RFCOMM"
rfcomm listen 0 1 &
pid_1=$!
sleep 0.2
debug "Connect RFCOMM  ${baddr}"
rfcomm connect 2  ${baddr} 1
pid_2=$!
sleep 4
failed=0
while true
do
        debug "try PPPD $failed"
        sudo  /usr/sbin/pppd rfcomm0 noauth debug nodetach ${ip_local}:${ip_remote}
        failed=$[$failed+1]
        if [ $failed -eq 10 ]
        then
                break
        fi
        sleep 1
done
cleanup

p910i and SyncML hell Read More ยป