Tuesday, March 20, 2007

How to sync your Pocket PC with Ubuntu

I have a Dell Axim Pocket PC and want to connect it to Ubuntu. Well here we go.

Connect your pocket PC to your Ubuntu machine using the serial to USB cable and power on the pocket PC.

Open a terminal (Applications -> Accessories -> Terminal).

Load the USB to serial driver by entering the following command in the terminal.

sudo modprobe ipaq

Issue the following command to make sure Ubuntu detects your pocket PC.

dmesg | tail

It showed /dev/ttyUSB0
as the device name. The next step is to install the packages we need. Enter the command as shown below:

sudo apt-get install synce-dccm synce-serial librra0-tools

This command will ask you to enter the IP addresses for your pocket PC, your DNS server etc. Enter the IP address of your router for the DNS server option (where you’ll get a blank field, whereas for other options, you’ll get a default value). It’s usually 192.168.0.1, but then it depends on the router. Leave the defaults for all other IPs.

Once the installation is complete, run the following command to specify the serial port:

sudo synce-serial-config /dev/ttyUSB0

You’ll get a message that

You can now run synce-serial-start to start a serial connection.

Make sure your pocket PC is connected and on. If your pocket PC is setup to sleep after certain minutes, you may have to switch it on again. Now start the dccm daemon.

You can start it in 2 ways.

dccm -d 4 -f

where -d 4 shows debugging is enabled and -f forces the daemon to run in the foreground.

Once you issue the above command, you’ll see the following in the terminal:

dccm[xxxx]: Running in foreground
dccm[xxxx]: Listening for connections on port xxxx

where xxxx stands for some number.

Now open another terminal and issue the following command:

sudo synce-serial-start

This will start the pocket PC synchronization. If you have firewall enabled, then you might see the warning as shown below:

Warning!

You have firewall rules that may prevent SynCE from working properly!
synce-serial-start is now waiting for your device to connect

In that case follow the firewall steps below. If you don’t have a firewall, then go to Continue after Firewall.

Firewall setting:

I user Firestarter as the firewall for front end. If you are using Firestarter, then go to /etc/firestarter/ directory. Change the file permission for user-pre to rw-r—– using the following command:

sudo chmod 640 user-pre

Now edit the file using

sudo gedit user-pre

Enter the following lines in the file:

$IPT -I FORWARD 1 -s 192.168.131.0/24 -d 192.168.131.0/24 -j ACCEPT
$IPT -I OUTPUT 1 -s 192.168.131.0/24 -d 192.168.131.0/24 -j ACCEPT
$IPT -I INPUT 1 -s 192.168.131.0/24 -d 192.168.131.0/24 -j ACCEPT

Save and close the file. Change the file permission back to r–r—– by issuing

sudo chmod 440 user-pre

The above change will work only if you had gone with the default IPs while installing the packages required for syncing.

Restart the computer and open two terminals. Issue the dccm command as given above in one terminal and sudo synce-serial-start on the other terminal. Make sure your Pocket PC is on before you do this.

Continue after firewall:

Once you issue the command sudo synce-serial-start in terminal 2, you’ll see the following messages (or similar messages) in terminal 1 where you issued the dccm command.

dccm[xxxx]: Connection from 192.168.xxx.xxx accepted
info package (88 bytes):
0000: 24 00 00 00 03 00 a3 2b $……+
0008: 11 0a 00 00 00 00 00 00 ……..
0010: 61 05 f3 56 00 00 00 00 a..V….
0018: 24 00 00 00 2c 00 00 00 $…,…
0020: 3e 00 00 00 50 00 50 00 >…P.P.
0028: 43 00 00 00 50 00 6f 00 C…P.o.
0030: 63 00 6b 00 65 00 74 00 c.k.e.t.
0038: 50 00 43 00 00 00 44 00 P.C…D.
0040: 65 00 6c 00 6c 00 20 00 e.l.l…
0048: 41 00 78 00 69 00 6d 00 A.x.i.m.
0050: 20 00 58 00 35 00 00 00 ..X.5…
0058:
dccm[xxxx]: Talking to ‘PPC’, a PocketPC device of type Dell Axim X5

This shows that the system is talking to the pocket PC. The next step is to setup a partnership. You are generally allowed upto 2 partnership. I have setup a partnership with my Windows machine and one more was remaining. I used that for syncing with Ubuntu.

Issue the following command in terminal 2 to establish the partnership:

synce-matchmaker create

You’ll get a message similar to the one shown below if you are able to establish the partnership.

[rra_matchmaker_create_partnership:xxx] Partnership file not found for ID XXXXXXXX
[rra_matchmaker_create_partnership:xxx] Partnership slot 2 is empty on device
Partnership creation succeeded. Using partnership index 2.

Once the partnership is established, then you can issue the following command to list the files in the pocket PC. You’ll get the list of files if the partnership is established.

synce-pls

Archive 5136 Sat 10 Feb 2007 05:04:15 PM CST House materials.psw
Archive 408 Sun 28 Jan 2007 11:10:28 AM CST Note2.pwi
Archive 408 Sun 24 Dec 2006 06:30:38 PM CST Note1.pwi
Directory Mon 31 Dec 2001 06:00:00 PM CST Business/
Directory Mon 31 Dec 2001 06:00:00 PM CST Personal/
Directory Mon 31 Dec 2001 06:00:00 PM CST Templates/

The above list is the list of folders in my pocket PC. Here is the list of command you can use to access the pocket PC files:

synce-pcp - Copy a file

synce-pmkdir - Create a directory

synce-pmv - Move a file

synce-prmdir - Delete a directory.

Once you are done syncing your pocket PC, issue the following command to kill the daemon and then disconnect the pocket PC.

killall -HUP dccm

That’s it. Next we figureout how to do somethinng usefull with this like sync with Evolved