Syncing Sony Ericsson T637/T616s in Linux

I purchased my Sony Ericsson T637 because its the next version of the T616 which was known to be able to sync in linux with Multisync. I was finally going to be able to have my palm pilot in sync with my cell phone!

Well it turns out that the people who have been able to sync a T616 (which turns out to luckily be almost exactly the same under the hood as the T637) were doing it via bluetooth. I don't have bluetooth, and I spent $30 on a special USB cable for my phone, so damnit, I'm gonna make it work!


The Cable

It turns out the cable - a DCU-11 - is a USB device. More specifically its a usb to serial converter. Meanwhile the phone then simply acts as a dumb serial device that can receive AT commands (remember the modem days?).

What does that mean? That means the driver you are looking for in your kernel isn't for the phone, it's for the cable. Specifically you need the pl2303 driver which is available in the kernel (I'm using a 2.6 series kernel, I believe it is also available in 2.4).

However, you also need a patch (which made it into 2.6.9, but not anything earlier), which modifies pl2303 to use a cyclic buffer. The patch was written by Al Borchers and I keep a copy of it diffed against 2.6.7 here. (I also have a very small debug patch that went into 2.6.9 which you can find here if you want to fix one of the debugging message when the driver is in debug mode. This is not necessary). IF YOU ARE ON 2.6.9 OR LATER, YOU DO NOT NEED THESE PATCHES!

Once you've patched the kernel source and rebuilt that driver, modprobe pl2303 and you should see your device attach in your syslog messages, probably to /dev/ttyUSB0 or something similar.


The Software

Ok, you now have a path to get from your linux box to your phone. Now you need some software. There are two packages I know of that will talk to these phones: Multisync and TseMgr. TseMgr will backup, restore, allow you send/receive text message via the phone, etc., but is no longer developed. Multisync allows you to backups, restore, sync between your phone and your palm, your phone and ldap, ldap and your palm, evolution and your phone, etc. Supposedly a thunderbird plugin is also coming soon.

I use Multisync, however, unfortunately it won't sync these phones out-of-the-box. I got it to sync about 20 entries before I would get a transfer-interrupted on the phone or in multisync. I was able to work around this by adding in some latency in the multisync source, with a simple one-line patch. In the obex_cable_write() function, add a sleep(5); before the end of the while(). It should look like this:
gint obex_cable_write(obex_t *handle, gpointer ud,
               guint8 *buf, gint buflen) {
  int written = 0;
  int ret = 0;
  obexdata_t *userdata;

  userdata = (obexdata_t*) ud;

  while (ret >= 0 && written < buflen) {
    ret=write(userdata->fd,buf+written,buflen-written);
    fprintf(stderr,"Written %d bytes out of %d\n",ret,buflen);
    if (ret >= 0)
      written+=ret;
    sleep(5);
  }
  return(written);
}
Recompile, and you're off to the races. Myself, Al Borchers, and the multisync-dev list have all been unable to determine why this is needed. I'd love to find a better solution, as this one is very ugly and slows things down. I've been able to make it work with a sleep(4), but that's as low as I can make it go.


Summary


References


Last modified: 10/27/04

This page is © Phil Dibowitz 2001 - 2004