Skip to content

Syncing Treo650 with Google Contacts using CompanionLink for Google

In preparation for a possible move from my Treo 650 to the new Palm Pre, I’ve decided to try and synchronise my contacts between the Treo and Google Contacts.

So I’m evaluating CompanionLink for Google as a possible tool to achieve this. Another option might be GooSync.

I tried syncing some sample contacts in both directions, with the following results:

  1. Google Contacts to PalmOS Contacts
  2. Syncing a new contact from Google Contacts to PalmOS Contacts results in the following fields being synched correctly:

    • Name
    • Title
    • Company
    • Home Phone
    • Work Phone
    • Mobile Phone
    • E-mail (synched with the Work Email field in Google Contacts)
    • Fax (synched with the Work Fax field in Google Contacts)
    • Home Address
    • Work Address
    • Other Address
    • Notes

    The following Google Contacts fields are not synched:

    • Home Email
    • Other Email
    • Home Fax
    • Pager
    • Other Phone
    • IM Fields (Google Talk, Skype, Jabber, etc)
    • Custom Field

  3. PalmOS Contacts to Google Contacts
  4. Syncing a new contact from PalmOS Contacts to Google Contacts results in the following fields being synched correctly:

    • Name
    • Title
    • Company
    • Work Email (synched with the first E-mail field in PalmOS Contacts)
    • Home Phone
    • Work Phone
    • Mobile Phone
    • Home Address
    • Work Address
    • Other Address
    • Google Talk (synched with the IM field in PalmOS Contacts)
    • Notes (synched with a combination of the Custom and Note fields in PalmOS Contacts)

    The following PalmOS Contacts fields are not synched:

    • Secondary E-mail entries
    • Other Phone
    • AIM
    • MSN
    • Web site

I then tried duplicating contacts to see if I could determine the primary synchronisation key. Duplicating a contact in PalmOS Contacts and then synchronising did not result in a duplicated contact in Google Contacts. However, changing the E-Mail field in the duplicated contact in PalmOS Contacts was enough to cause it to be created as a second separate record in Google Contacts. So it seems that the PalmOS E-Mail field (which syncs with the Google Work Email field) is the primary key.
Interestingly, even while the PalmOS Contacts HotSync conduit is set up to sync with Google Contacts, the syncing with the Palm Desktop still happens. Indeed, the deletion of a record in the Palm Desktop is reflected in PalmOS Contacts on each sync, but it seems does not trigger a corresponding deletion in Google Contacts (perhaps there is some QuickSync vs SlowSync thing happening here). Modifying the record in Google Contacts which had already been deleted in PalmOS Contacts (through the Palm Desktop) did cause it to be reinstated in PalmOS Contacts on the next sync.
Adding a new E-Mail field to the PalmOS Contacts record (before the existing field) causes that new field to be the one that is synched with the Google Contacts Work Email field. So it seems that synchronisation happens between the first E-Mail field in PalmOS Contacts and the Work Email field in Google Contacts, and that only one Email address is ever synchronised between the two. If there is no Work Email field in Google Contacts, then all E-Mail fields in PalmOS Contacts are deleted. Additional Email fields in Google Contacts are not replicated in PalmOS Contacts. If an additional E-Mail field is added to PalmOS Contacts, then synchronisation exits with an error on the first attempt (”Can have at most one primary email address, found 2″), and prevents other fields being synchronisedbut then succeeds on the second attempt.  As long as a Work Email field is synching properly, other non-synching Email fields on both sides are retained (but not synched, even though other non-Email fields are synched).

Connecting a Treo650 to a Freecom DataTank 2

  1. Install bluez2-utils from Optware
  2. Install the following kernel modules: bluetooth, hci_usb, l2cap, bnep, rfcomm, hidp
  3. Create /dev/rfcomm0 as follows:
    mknod /dev/rfcomm0 c 216 0
  4. Enable routing from ppp0 to eth1 (don’t do this if you use ppp for your internet connection):
    /etc/init.d # diff -u routing.orig routing
    --- routing.orig        Sat Mar 22 18:57:23 2008
    +++ routing     Sat Mar 22 15:14:29 2008
    @@ -37,6 +37,7 @@
    
            # lo & eth0 always accepted (also if WAN port IP not set)
            /sbin/iptables -A INPUT -i $INIF -j ACCEPT
    +       /sbin/iptables -A INPUT -i ppp0 -j ACCEPT
            /sbin/iptables -A INPUT -i lo -j ACCEPT
    
            # get IP address from WAN port
    @@ -150,6 +151,7 @@
              /sbin/iptables -A FORWARD -j TCPMSS -o $EXIF --clamp-mss-to-pmtu -p tcp --tcp-flags SYN,RST SYN
            fi
            /sbin/iptables -A FORWARD -i $EXIF -o $INIF -m state --state ESTABLISHED,RELATED -j ACCEPT
    +       /sbin/iptables -A FORWARD -i $EXIF -o ppp0 -m state --state ESTABLISHED,RELATED -j ACCEPT
    
            grep -q ^proxy_server=checked /etc/master.conf
    @@ -163,6 +165,7 @@
              fi
            else
              /sbin/iptables -A FORWARD -s $SUBNET -i $INIF -j ACCEPT
    +         /sbin/iptables -A FORWARD -s $SUBNET -i ppp0 -j ACCEPT
            fi
    
            # port forwarding
    

  5. Edit /etc/ppp/options as follows:

    noauth
    crtscts
    lock
    local
    proxyarp
    ktune
    192.168.1.XX:192.168.1.YY
    ms-dns 192.168.1.ZZ

    (edit the last two lines to suit your network topology, the first IP address
    is your gateway device, the second IP address will be assigned to the client,
    and the third IP address is your DNS server)
  6. Add the following line to /etc/dnsmasq.conf:
    interface=eth0,ppp0

Five new NSLU2 firmware releases in five days

In the last five days, we have made five new NSLU2 firmware releases:

2007-12-31 – Unslung 6.10-beta Release
2007-12-30 – SlugOS 4.8-beta Release
2007-12-29 – OpenWrt/NSLU2 Kamikaze 7.09 Release
2007-12-28 – Angstrom/NSLU2 2007.12 Release
2007-12-27 – Debian/NSLU2 Stable 4.0r2 Release

All of these new releases are available at

http://www.slug-firmware.net/

See http://article.gmane.org/gmane.comp.misc.nslu2.linux/20610 for
an explanation of the pros and cons of each different firmware
distribution, and the installable packages available for each.

Thanks to everyone in the NSLU2-Linux, OpenWrt, Angstrom, OpenEmbedded
and Debian projects who contributed to these releases.

Remember, if you find any of the firmware or packages that the
NLSU2-Linux project provides useful, feel free to make a donation to
the project at

http://www.nslu2-linux.org/wiki/Main/Donate

We are currently in need of about $500 to buy a RAID controller card
and some disks for our autobuild machine to support all this new
firmware with up-to-date package feeds …

Android Internals

Here are some links to various pieces of information (not published by Google) about the internals of the new Android OS:

http://benno.id.au/blog/2007/11/13/android-under-the-hood
http://benno.id.au/blog/2007/11/13/android-native-apps

A script to list the contents of the root filesystem: http://pastebin.ca/771989
(Yes, this is almost unreadable perl, and the regexps were created by trial and error until there were no more unmatched lines.)

The output of that script: http://pastebin.ca/771988

http://benno.id.au/blog/2007/11/14/android-filesystems
http://benno.id.au/blog/2007/11/14/android-busybox

Graphical console programming: http://groups.google.com/group/android-developers/msg/ace258af92fff692?dmode=source

Dynamic linking: http://groups.google.com/group/android-developers/msg/3d68334a74a9bab2?dmode=source

DEX format documentation: http://groups.google.com/group/android-developers/msg/d150de1d97f829be?dmode=source

Dalvik VM benchmarking vs native code: http://groups.google.com/group/android-developers/msg/69729d17c013452f?dmode=source

Setting the OpenMoko timezone

If you want to set the timezone on your phone correctly, do the following:

  1. ipkg install tzdata
  2. ipkg install your desired tzdata-* packages.  For instance, I use “tzdata-australia“.
  3. Enable your desired timezone by symlinking it to “/etc/localtime“.  Adjust the following example command line for your locality.
    • ln -s /usr/share/zoneinfo/Australia/Adelaide /etc/localtime
  4. The “date” command should now show the correct time for your timezone.  If it is not correct, then install the “ntpclient” package, and use it to set your clock.

Note that this technique should work on any OpenEmbedded-based Linux distribution.

    Intercepting hotplug on the Freecom FSG-3

    The Freecom FSG-3 wireless storage router has four USB ports, and has support for hotplug built into the kernel.  This makes it ideal for use as a docking station for OpenMoko phones.

    Unfortunately, it does not have the normal hotplug agent scripts that you expect to find on a desktop Linux distribution.

    So you have to roll your own:

    1. Run “mv /sbin/hotplug /sbin/hotplug.freecom
    2. Create a new “/sbin/hotplug” shell script (the following is an example of how to automatically enable USB networking for an OpenMoko phone):
      #!/bin/sh
      
      case $1 in
        ( usb )
          case $PRODUCT/$INTERFACE in
            ( 1457/5122/212/2/6/0 ) # OpenMoko GTA01 cdc-ether
              case $ACTION in
                ( add )
                  ifconfig usb0 192.168.0.200 up
                  ;;
                ( remove )
                  ifconfig usb0 192.168.0.200 down
                  ;;
              esac
              ;;
          esac
          ;;
      esac
      
      /sbin/hotplug.freecom "$@"
      

    3. Run “chmod ugo+x /sbin/hotplug” to ensure that your new hotplug script is executable.
    4. See http://linux-hotplug.sourceforge.net/?selected=usb for the list of environment variables you can use to distinguish different devices.

    Replacing dropbear with openssh

    I prefer to use OpenSSH rather than Dropbear on my devices.  The main reason is to get sftp support (which is required by sshfs).  Another reason is to get better support for agent forwarding (which is essential for bouncing from one machine to another without leaving your private keys all over the internet).

    To do this on OpenMoko (or any other OpenEmbedded-based distribution for that matter, for instance SlugOS or Angstrom):

    1. Edit /etc/init.d/dropbear by replacing “DROPBEAR_PORT=22” with “DROPBEAR_PORT=2222” (or any other unused port).
    2. Run “ipkg install -force-depends openssh” to install openssh.
    3. Make sure you have set a root password before rebooting (use “passwd” to set it).
    4. Reboot (dropbear will restart on the new port, and openssh will start on the normal ssh port).
    5. Check that openssh is now serving on port 22 by logging into the device over ssh.
    6. Run “ipkg remove -force-depends dropbear” to remove dropbear.
    7. Then run “ipkg install openssh-sftp” to install support for the sftp protocol which sshfs uses.

    Debugging gsmd failures on OpenMoko

    If you’re having problems making phone calls on OpenMoko 2007.2, and wish to see what gsmd is doing, then look in /tmp/gsm.log for the gory details …
    Mine fails to register automatically, as documented in http://lists.openmoko.org/pipermail/gsmd-devel/2007-August/000205.html – this seems to be a problem where libmokogsmd2 is not handling a GSMD_NETREG_UNREG_BUSY event correctly.

    Update: this problem with UNREG_BUSY has now been fixed with the patch that I submitted.

    Stopping the OpenMoko startup sound

    OpenMoko 2007.2 makes a very loud startup sound.  To mute it, do the following:

    In /etc/pulse/session, replace:

     load-sample startup /usr/share/openmoko/sounds/startup_openmoko.wav

    with:

     load-sample startup /usr/share/openmoko/sounds/touchscreen_click.wav

    (or any other subdued wav file you wish to upload onto the device).

    Update: The OpenMoko team has sensibly replaced the load startup sound with a much more unintrusive sound.

    Connecting a Treo650 to an OpenEmbedded-based firmware distribution

    The following should work for an NSLU2 running SlugOS or Angstrom, or a device running OpenMoko.

    • Install the required kernel modules for bluetooth
      • ipkg install kernel-module-hci-usb kernel-module-l2cap kernel-module-rfcomm
      • depmod -a
      • ipkg install bluez-utils
    • Edit /etc/default/bluetooth to enable hcid and dund.
    • Change the pin and host settings in /etc/bluetooth/hcid.conf, and make sure that the class is 0×3e0100 (not the default value, which is for a PDA like a Zaurus, not a “Computer” device like the Neo which can accept and route tcp/ip network connections coming in over dund or pand on the bluetooth network)
    • Reboot and test with ‘hciconfig’ with a bluetooth dongle plugged in.
    • Install the required kernel modules for ppp
      • ipkg install kernel-module-ppp-async kernel-module-bsd-comp kernel-module-ppp-deflate
      • depmod -a
      • ipkg install ppp
    • Edit /etc/ppp/options as follows:

      noauth
      crtscts
      lock
      local
      proxyarp
      ktune
      192.168.1.XX:192.168.1.YY
      ms-dns 192.168.1.ZZ

      (edit the last two lines to suit your network topology, the first IP address
      is your gateway device, the second IP address will be assigned to the client,
      and the third IP address is your DNS server)