main index Click here for other P900 pages.

I got a message from Malte Schmidt-Tychsen (Germany) about connecting via infrared the P900 to sync with Debian Sarge Linux. Thanks Malte, excellent work!


Hi there,

it took me waaaay too long to set up my Evolution sync between my P900 and my Debian GNU/Linux Sarge laptop because I had to steal from many different pages and unfortunately some info didn't work on my machine. Also the multisync-Evolution plugin changed a bit with Evolution over time. Since I heard of some conversion issue between vCard 2.1 (P900) and 3.0 (Evolution) I used the multisync app and multisync plugins from Debian's unstable. Those are unfortunately incompatible with evolution from Sarge stable (used to be testing a few weeks ago).

These are the full information to get it working.

Step 1

Evolution 2.2 uses a new format/location for address-book and calendar because it relies on evolution-data-1.2 instead of evolution-data-1.0 that Evolution 2.0 relied upon. This results in the evolution-multisync-plugin in the stable packages group, being incompatible with Evolution from the unstable group and vice versa. Usually, Debian packages from unstable and stable can be mixed to a certain degree using apt-pinning and the packaging system handles dependencies gracefully, but here this is not the case since the related packages don't seem to depend upon each other.

Again because this is important:

libmultisync-plugin-evolution 0.82-5 in Sarge/stable only works with Evolution 2.0 from Sarge,

and libmultisync-plugin-evolution 0.82-5.1 in unstable only works with Evolution 2.2 from unstable (!)

The plugin was patched for that reason by the packages maintainer as far as I can tell so I don't know if other distributions even have that patch.

Step 2

The infrared port instructions are chip/laptop specific. By using the irdadump utility one should see:
a) the chip itself putting out lots of stuff and
b) the phone with a couple lines

Mine looks like that without the phone:
01:36:58.008865 xid:cmd fb1ce5b4 > ffffffff S=6 s=2 (14) 
01:36:58.098857 xid:cmd fb1ce5b4 > ffffffff S=6 s=3 (14) 
01:36:58.188851 xid:cmd fb1ce5b4 > ffffffff S=6 s=4 (14) 
01:36:58.278854 xid:cmd fb1ce5b4 > ffffffff S=6 s=5 (14) 
01:36:58.368860 xid:cmd fb1ce5b4 > ffffffff S=6 s=* socrates hint=0400 [ Computer ] (24)

and like this with the P900 infrared connection on (and placed near the PC infrared port, "in line of sight"):
01:37:51.828870 xid:cmd fb1ce5b4 > ffffffff S=6 s=0 (14) 
01:37:51.918860 xid:cmd fb1ce5b4 > ffffffff S=6 s=1 (14) 
01:37:52.008857 xid:cmd fb1ce5b4 > ffffffff S=6 s=2 (14) 
01:37:52.098852 xid:cmd fb1ce5b4 > ffffffff S=6 s=3 (14) 
01:37:52.188853 xid:cmd fb1ce5b4 > ffffffff S=6 s=4 (14) 
01:37:52.278855 xid:cmd fb1ce5b4 > ffffffff S=6 s=5 (14) 
01:37:52.355804 xid:rsp fb1ce5b4 < 574af7d5 S=6 s=5 P900 hint=9325 [ PnP PDA/Palmtop Modem Telephony IrCOMM IrOBEX ] (21) 
01:37:52.368861 xid:cmd fb1ce5b4 > ffffffff S=6 s=* socrates hint=0400 [ Computer ] (24) 

The irdadump utility can be invoked by just issuing irdadump at the command prompt (don't forget to become root user, using su command). Most of the times irda-utils need to be installed first.

Notice the "<" and ">" indicating which system is "talking" on the infrared connection (the computer and the P900).

The above output lets you to verify that the infrared connection is working.

Step 3

You need to install libmultisync-plugin-evolution (for Evolution), libmultisync-plugin-syncml (for the P900), multisync (for the sync) and, of course, Evolution.

Multisync has a real GUI and can be configured easily through that.

After starting multisync it just becomes a little symbol in the taskbar and you need to click on it with the right mouse button to select Main Window and be able to configure it. After clicking on New (Create a new synconization pair) you can select the plugins (Evolution and SyncML in this case). Both need to be configured.

The Evolution plugin needs to know which databases it should sync and the syncml plugin needs to be set to plain http (instead of https) and it needs a login/password pair. You will need to use the same pair on the phone. The SyncML role must be "server".

There is also an "options" tab in the options dialogue of the syncml plugin. There is a time option that says it is agains a bug in P800/P900 phones. I had problems with duplicated entries in evolution after syncing with this option on. The problem disappeard with the option off. So I recommend caution against using it. It might have been solved via a firmware upgrade.

Step 4

Then I used this this old P800-related page to set up the phone:

--- snip ---
...Now start the "Remote Sync" app on your P800. In "Preferences" configure the server address as http://PC_ADDR:5079 (change the PC_ADDR with the address you chose for your PC). Configure the username and password to be the same as you chose in the previous step in Multisync.

Then configure the Calendar/Tasks sync task. Set the server database to be calendar (lower case) and enable it. Do the same for the Contacts task, setting the server database to be addressbook.

OK, you should be ready to rock. Hit the "Sync" button on the P800 and pray.
--- end snip ---

PC_ADDR in this case would be 169.254.1.65 resulting in this entry: http://169.254.1.65:5079 for server address.

Step 5

I mainly used this old P800 page. I set up a /etc/ppp/peers/p900-irda setup file with the following content:
noauth
user ppp
crtscts
lock
local
proxyarp
115200
lcp-echo-failure 10
lcp-echo-interval 86400
/dev/ircomm0
ms-dns 169.254.1.65
169.254.1.65:169.254.1.66

Now you can connect to the P900 via PPP protocol using (while root user) this simple Linux command: pppd call p900-irda

When using infrared, you don't need to set up a "chat script" to connect to the P900; instead, using the USB-cradle (not discussed in this page), most probably you would need one.

Note that /dev/ircomm0 fits my machine and most likely many others, but it depends on the number of infrared ports (I have yet to see a laptop with more than one, but someone using a serial to infrared converter might end up with a completely different one). Calling ifconfig as root user from the command line will confirm ircomm0.

In this case I chose 169.254.1.65 for server and 169.254.1.66 for client address. This must also go into the P900 setup.

This was all pretty straigtforward and easy. Unfortunately for some reason the P900 (as well as the P800 from the docs) need to resolve a certain fixed address. If it can't the phone will disconnect after 90 seconds. This can be witnessed in the /var/log/syslog log file:
Jul  3 00:47:42 socrates pppd[3740]: LCP terminated by peer
Jul  3 00:47:42 socrates pppd[3740]: Connect time 1.5 minutes.
Jul  3 00:47:42 socrates pppd[3740]: Sent 0 bytes, received 534 bytes.
Jul  3 00:47:42 socrates pppd[3740]: Hangup (SIGHUP)
Jul  3 00:47:42 socrates pppd[3740]: Modem hangup
Jul  3 00:47:42 socrates pppd[3740]: Connection terminated.
Jul  3 00:47:42 socrates pppd[3740]: Exit.

That makes it necessary to set up some kind of DNS-service on your Linux box. Since I have no idea how to do that I used the docs and failed with all of them including Brian's suggestions. Instead, this page gave me the best instructions, though my setup is slightly different.

P800 and P900 need to "resolve" a wsockhost.mrouter DNS name, so it becomes necessary to set up some kind of dns service. This makes the whole thing much more complicated for the casual Linux user.

Bind was used in all examples so I used it as well. I am pretty sure that there are many more elegant ways out there, but I don't know enough about DNS to find one myself. Maybe some better geek can set one up with dnsmasq for example. Also publishing a way to limit bind to listen only in the infrared port would obviously be better. Please write to the author of this page if you have successfully implemented some smarter solution and don't forget that some or all parts of the setup might be somewhat specific only to your Linux distribution and might not be applicable to others.

Let's go with bind. Edit /etc/bind/named.conf (may be in a different directory, in some old distributions), and add the following:
  zone "mrouter" {
      type master;
      notify no;
      file "mrouter";
  };

then create the /var/cache/bind/mrouter file containing this:
$TTL 86400
@ IN SOA ns.mrouter. root.mrouter. (
200306012
28800
14400
3600000
86400
)
NS ns
ns A 169.254.1.65
wsockhost A 169.254.1.65

If dns-utils is installed on the machine then that DNS setup can be checked with this command:
dig wsockhost.mrouter @127.0.0.1

shamelessly stolen from this page. Please note that bind needs to be restarted because otherwise it does not associate with the ppp interface and everyone can resolve wsockhost.mrouter except the phone :-( This obviously needs to be done right after the ppp daemon is started ("pppd call p900-irda"), because otherwise the phone disconnects after 90 seconds in which it tries to resolve its fixed address wsockhost.mrouter (yep, this is a P900 issue related to the syncing-with-Windows standard software).

To restart bind, on Debian Sarge I used:
/etc/init.d/bind9 restart
Yes, I've been told that you need to restart manually the bind service every time you want to use "pppd call p900-irda" because bind only listens on the interfaces it finds at startup:

Since we usually don't have the phone connected at startup it won't bind on ppp0 (or pppX, if there are other ppp connections). You can check all network interfaces using "ifconfig" without any parameters. As far as I know bind doesn't listen on ppp0. I haven't really tested it, but I can remember that in the beginning I had problems with disconnects when I forgot to restart bind. It's also in the other docs. If there is a way to set up bind so that it automagically listens on the ppp interface as soon as it comes up it would be easier. As I said before. The solution is far from perfect. In addition to all that we have the compatibility issues.

Note on DNS resolving

I figure that the structure and placement of bind configuration files differs throughout the different distributions of Linux and of Bind. Also bind is not the only DNS-server out there. Maybe this step only applies to Debian GNU/Linux 3.1 Sarge.

The /var/log/syslog should contain useful logging information generated from pppd

Conclusion

Using the above settings I was able to sync my P900. Yeah! And thanks to all the sites involved for posting/spreading useful information.


QuickStart

The order goes:

  1. Switch on infrared on the phone and place it where it needs to sit for infrared communication between the phone and the computer.
  2. Switch on infrared on the computer, one can see if it works, because the symbol for infrared on the phone keeps getting red and then going back to white. Another check would be irdadump.
  3. Switch on ppp with that pppd call p900-irda - You can check if the connection is up anytime, because now it is possible to ping the phone using the IP that you gave it.
  4. Restart bind within 90 seconds, because otherwise the phone will disconnect. If it doesn't ping anymore it obviously disconnected. There will also be an entry in /var/log/syslog
  5. Start multisync on the computer.
  6. Press Sync on the phone (When starting multisync via a console command there is some output on that console).

Oops!

Some extra notes: when exchanging data with the P900, multisync must be already running on the Linux notebook; Evolution, instead, doesn't need to be running alongside, since the Evolution plugin finds the database by itself.

A couple first notes on the syncing - Malte writes me again:

...I first synced my full evolution addressbook to my P900 and had all entries on both sides. Only the P900 does not show some fields like Birthday. After all evolution has LOTS of fields.

But the vCard BDAY entry for example doesn't get lost. I backed up my addressbook and beamed it as a .VCF file via irobex from the P900 back to the computer. The BDAY entry is still there:
BEGIN:VCARD
VERSION:2.1
REV:20050703T010225Z
...
BDAY:19780923T000000Z

the origninal vcf from evolution looks like that:


BEGIN:VCARD
VERSION:3.0
BDAY:1978-09-23
...

In the vcf from evolution I see many fields that seem to be evolution specific starting with X-EVOLUTION-... keywords.

I have no knowledge about the vCard format so maybe someone with some knowledge on it might want to comment.

After my second sync all entries got duplicated in the Evolution addressbook. The entry for birthdays all became 00.00.0, but exporting them from the phone again just to make sure they were still there, just in the weird format.

This all has to do with vCard 2.1/3.0 conversion problems and, as shown with the BDAY example maybe even some nasty quirks.

Mileage may vary, as they say in the states.

IMPORTANT: I've found that old, crusty Evolution addressbooks and old, crusty P800 addressbooks (and same for calendars) do not merge well together. By "not well," I mean that Multisync or the P800, or both, end up crashing and you end up in a mess.

This also applies to the P900.

Syncing your addressbook and calender from Evolution could mess it up really bad, so first make backups. You have been warned!


Monte san Biagio, Italy - shot from a running train

Sony Ericsson P900 index - send e-mail - home page