<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
          "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">

<article lang="en">

  <articleinfo>
    <title>Motorola A920 under GNU/Linux</title>

    <author>
      <firstname>Henrik Brix</firstname>
      <surname>Andersen</surname>
      <affiliation>
        <address><email>henrik@brixandersen.dk</email></address>
      </affiliation>
    </author>

    <copyright>
      <year>2004-2005</year>
      <holder>
        Henrik Brix Andersen
      </holder>
    </copyright>

    <revhistory>
      <revision>
        <revnumber>0.2.1</revnumber>
        <date>2005-04-08</date>
        <authorinitials>HBA</authorinitials>
        <revremark>Added link to the pppd utility</revremark>
      </revision>
      <revision>
        <revnumber>0.2.0</revnumber>
        <date>2005-04-07</date>
        <authorinitials>HBA</authorinitials>
        <revremark>Major rewrite</revremark>
      </revision>
      <revision>
        <revnumber>0.1.4</revnumber>
        <date>2004-09-10</date>
        <authorinitials>HBA</authorinitials>
        <revremark>Updated email address</revremark>
      </revision>
      <revision>
        <revnumber>0.1.3</revnumber>
        <date>2004-05-07</date>
        <authorinitials>HBA</authorinitials>
        <revdescription>
          <itemizedlist>
            <listitem>
              <para>
                Added links to the XML source and a plain text version
              </para>
            </listitem>
            <listitem>
              <para>
                Fixed a couple of small typos
              </para>
            </listitem>
          </itemizedlist>
        </revdescription>
      </revision>
      <revision>
        <revnumber>0.1.2</revnumber>
        <date>2004-05-07</date>
        <authorinitials>HBA</authorinitials>
        <revdescription>
          <itemizedlist>
            <listitem>
              <para>
                Added tip about how to start the DNS server
              </para>
            </listitem>
            <listitem>
              <para>
                Added tip about auto-loading the usbserial module
              </para>
            </listitem>
          </itemizedlist>
        </revdescription>
      </revision>
      <revision>
        <revnumber>0.1.1</revnumber>
        <date>2004-05-04</date>
        <authorinitials>HBA</authorinitials>
        <revremark>Boosted USB connection speed to 460800 baud</revremark>
      </revision>
      <revision>
        <revnumber>0.1.0</revnumber>
        <date>2004-05-04</date>
        <authorinitials>HBA</authorinitials>
        <revremark>Initial revision</revremark>
      </revision>
    </revhistory>

    <abstract>
      <para>
        This document describes the process of getting a Motorola A920
        cell phone to work with GNU/Linux.  So far this document covers
        how to synchronize the contacts, calendar and tasks through the
        USB cable using Multisync.
      </para>
      <para>
        The Docbook XML source of this document is
        also <ulink url="A920.xml">available</ulink>.
      </para>
    </abstract>
  </articleinfo>

  <section id="introduction">
    <title>Introduction</title>
    <para>
      I own a Motorola A920 cell phone.  The phone comes with a USB
      cable and software to synchronize it's contacts, calendar and
      tasks to a PC.  Unfortunately the software supplied only works
      with Microsoft Windows, so you're on your own if you're using
      another operating system, say for instance GNU/Linux.
    </para>
    <para>
      Fortunately I've managed to get the A920 to work with GNU/Linux
      as well.  Read on for all the juicy details.
    </para>

    <section id="copyright">
      <title>Copyright and License</title>
      <para>
        This document is copyrighted &copy; 2004-2005 by
        <emphasis>Henrik Brix Andersen</emphasis>.  Permission is
        granted to copy, distribute and/or modify this document under
        the terms of the GNU Free Documentation License, Version 1.2
        or any later version published by the Free Software
        Foundation; with no Invariant Sections, with no Front-Cover
        Texts, and with no Back-Cover Texts.  A copy of the license is
        available at <ulink
        url="http://www.gnu.org/copyleft/fdl.html">
        http://www.gnu.org/copyleft/fdl.html</ulink>.
      </para>
    </section>

    <section id="disclaimer">
      <title>Disclaimer</title>
      <para>
        No liability for the contents of this document can be
        accepted. Use the concepts, examples and information at your
        own risk. There may be errors and inaccuracies, that could be
        damaging to your system. Proceed with caution, and although
        this is highly unlikely, the author(s) do not take any
        responsibility.
      </para>
      <para>
        All copyrights are held by their by their respective owners,
        unless specifically noted otherwise. Use of a term in this
        document should not be regarded as affecting the validity of
        any trademark or service mark. Naming of particular products
        or brands should not be seen as endorsements.
      </para>
    </section>

    <section id="feedback">
      <title>Feedback</title>
      <para>
        Feedback is most certainly welcome for this document. Send
        your additions, comments and criticisms to the following email
        address: <email>henrik@brixandersen.dk</email>.
      </para>
    </section>
  </section>

  <section id="a920">
    <title>The Motorola A920</title>
    <para>
      The Motorola <ulink
      url="http://www.symbian.com/phones/mot_a920.html">A920</ulink>
      is a 3G cellular phone with integrated PDA (or was it the other
      way around?). It is based on the <ulink
      url="http://www.symbian.com/">Symbian</ulink> operating system
      and includes lots of nice features such as an Assisted GPS
      (A-GPS) and an MP3 player. It is very similar in function and
      design to the Motorola <ulink
      url="http://www.symbian.com/phones/mot_a925.html">A925</ulink>,
      the Motorola <ulink
      url="http://www.symbian.com/phones/mot_a1000.html">A1000</ulink>
      and the Motorola <ulink
      url="http://www.symbian.com/phones/mot_a1010.html">A1010</ulink>,
      and the instructions found in this document should work with
      either of those models.
    </para>
  </section>

  <section id="dns">
    <title>DNS Server</title>
    <para>
      The A920 needs to be able to resolve the address
      <emphasis>wsockhost.mrouter</emphasis> when connected to the PC.
      Otherwise it will drop the connection after approximately 90
      seconds.  To allow the A920 to perform the DNS lookup we need a
      DNS server running on the PC.  The following instructions apply
      to the <ulink
      url="http://www.thekelleys.org.uk/dnsmasq/">dnsmasq</ulink> DNS
      server.
    </para>
    <para>
      Configuration is simple. Add the contents of <xref
      linkend="dns-etc-hosts" /> to <filename>/etc/hosts</filename>
      and start <command>dnsmasqd</command>.

      <figure id="dns-etc-hosts">
        <title>A920 related entries in /etc/hosts</title>
<programlisting>
169.254.1.1  a920
169.254.1.68 wsockhost.mrouter
</programlisting>
      </figure>
    </para>
    <para>
      You should verify the DNS server configuration as shown in <xref
      linkend="dns-verify" />.  Of course, any utility for performing
      DNS lookups will do, I've only used the <command>host</command>
      command as example since most GNU/Linux distributions ship with
      it by default.

      <figure id="dns-verify">
        <title>Verifying the DNS server configuration</title>
<programlisting>
<prompt># </prompt><command>host wsockhost.mrouter 127.0.0.1</command>
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:

wsockhost.mrouter has address 169.254.1.68
</programlisting>
      </figure>
    </para>
  </section>

  <section id="usb">
    <title>USB Cable</title>
    <para>
      The A920 comes with an USB cable for connecting it to a PC.
      This section describes how to set up the connection between the
      PC and the A920 using the USB cable.
    </para>

    <section id="usb-kernel">
      <title>Kernel Modules</title>
      <para>
        To connect to the A920 to your PC using the USB cable you need
        the kernel options listed below. You will also need the
        user-space <ulink url="http://samba.org/ppp/">pppd</ulink>
        utility.

        <itemizedlist>
          <listitem>
            <para>
	      PPP (point-to-point protocol) support (CONFIG_PPP)
            </para>
          </listitem>
          <listitem>
            <para>
	      PPP support for async serial ports (CONFIG_PPP_ASYNC)
            </para>
          </listitem>
          <listitem>
            <para>
	      Support for Host-side USB (CONFIG_USB)
            </para>
          </listitem>
          <listitem>
            <para>
	      USB Modem (CDC ACM) support (CONFIG_USB_ACM)
            </para>
          </listitem>
        </itemizedlist>
      </para>
    </section>

    <section id="usb-local">
      <title>Local Connection</title>
      <para>
        To get pppd to establish a local connection to the A920 you
        need to add the contents of <xref
        linkend="usb-local-pppd-peers" /> to
        <filename>/etc/ppp/peers/A920-USB-local</filename>.

        <figure id="usb-local-pppd-peers">
          <title>/etc/ppp/peers/A920-USB-local</title>
<programlisting>
/dev/ttyACM0
460800
crtscts
local
lock
noauth
passive
nomagic
ms-dns 169.254.1.68
169.254.1.68:169.254.1.1
</programlisting>
        </figure>
      </para>
      <para>
        You should now be able to establish a local connection from
        the PC to the A920 as shown in <xref
        linkend="usb-local-pppd-call" />.  Don't forget to initialize
        the <emphasis>Desktop Suite</emphasis> on the phone as well.
        The <emphasis>Desktop Suite</emphasis> on the A920 should be
        configured to establish link using USB.

        <figure id="usb-local-pppd-call">
          <title>Establishing a connection to the A920</title>
<programlisting>
<prompt># </prompt><command>pppd call A920-USB-local nodetach</command>
Using interface ppp0
Connect: ppp0 &lt;--&gt; /dev/ttyACM0
local  IP address 169.254.1.68
remote IP address 169.254.1.1
</programlisting>
        </figure>
      </para>
      <para>
        Check the output to see if the connection was successful and
        verify that the A920 recognizes the connection to the PC.  You
        should also verify the connection by pinging the A920 from the
        PC as shown in <xref linkend="usb-local-ping" />.

        <figure id="usb-local-ping">
          <title>Verifying the connection using ping</title>
<programlisting>
<prompt># </prompt><command>ping -c 3 a920</command>
PING a920 (169.254.1.1) 56(84) bytes of data.
64 bytes from a920 (169.254.1.1): icmp_seq=1 ttl=69 time=8.73 ms
64 bytes from a920 (169.254.1.1): icmp_seq=2 ttl=69 time=7.56 ms
64 bytes from a920 (169.254.1.1): icmp_seq=3 ttl=69 time=8.75 ms

--- a920 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 7.564/8.348/8.750/0.559 ms
</programlisting>
        </figure>
      </para>
    </section>
<!-- FIXME
    <section id="usb-modem">
      <title>Modem Connection</title>
      <para>

      </para>
    </section>
  </section>
-->
  <section id="irda">
    <title>Infrared</title>
    <para>
      Your A920 might need a software upgrade for the infrared port to
      work. If the infrared port settings are not listed in the
      control panel, contact your service provider for a software
      upgrade.
    </para>

    <section id="irda-kernel">
      <title>Kernel Modules</title>
      <para>
        To connect to the A920 to your PC using the infrared port you
        need the kernel options listed below. You will also need the
        user-space <ulink url="http://samba.org/ppp/">pppd</ulink>
        utility.

        <itemizedlist>
          <listitem>
            <para>
	      PPP (point-to-point protocol) support (CONFIG_PPP)
            </para>
          </listitem>
          <listitem>
            <para>
	      PPP support for async serial ports (CONFIG_PPP_ASYNC)
            </para>
          </listitem>
          <listitem>
            <para>
	      IrDA (infrared) subsystem support (CONFIG_IRDA)
            </para>
          </listitem>
          <listitem>
            <para>
	      IrCOMM protocol (CONFIG_IRCOMM)
            </para>
          </listitem>
          <listitem>
            <para>
	      Cache last LSAP (CONFIG_IRDA_CACHE_LAST_LSAP)
            </para>
          </listitem>
          <listitem>
            <para>
	      Fast RRs (low latency) (CONFIG_IRDA_FAST_RR)
            </para>
          </listitem>
        </itemizedlist>
      </para>
      <para>
        You will also need to enable the specific device driver for
        your PC's infrared port. The following example uses the
        <emphasis>NSC PC87108/PC87338</emphasis> device driver as this
        is the one needed by my <ulink
        url="http://www.brixandersen.dk/papers/X31/X31.html#sect-kernel-irda">IBM
        ThinkPad X31</ulink>.

        <itemizedlist>
          <listitem>
            <para>
	      NSC PC87108/PC87338 (CONFIG_NSC_FIR)
            </para>
          </listitem>
        </itemizedlist>
      </para>
      <para>
        To have the kernel module recognize the hardware correctly I
        had to add the contents of <xref
        linkend="irda-kernel-modules-conf" /> to
        <filename>/etc/modules.conf</filename>.

        <figure id="irda-kernel-modules-conf">
          <title>Infrared port related entries in /etc/modules.conf</title>
<programlisting>
alias irda0 nsc-ircc
options nsc-ircc dongle_id=0x9
</programlisting>
        </figure>
      </para>
      <para>
        You will need to execute the command <command>irattach
        irda0</command> to set up the infrared port. The
        <command>irattach</command> utility is provided by the <ulink
        url="http://irda.sourceforge.net">Linux IrDA Project</ulink>.
      </para>
    </section>

    <section id="irda-local">
      <title>Local Connection</title>
      <para>
        To get pppd to establish a local connection to the A920 you
        need to add the contents of <xref
        linkend="irda-local-pppd-peers" /> to
        <filename>/etc/ppp/peers/A920-IrDA-local</filename>.

        <figure id="irda-local-pppd-peers">
          <title>/etc/ppp/peers/A920-IrDA-local</title>
<programlisting>
/dev/ircomm0
115200
crtscts
local
lock
noauth
passive
nomagic
ms-dns 169.254.1.68
169.254.1.68:169.254.1.1
</programlisting>
        </figure>
      </para>
      <para>
        You should now be able to establish a connection from the PC
        to the A920 as shown in <xref linkend="irda-local-pppd-call"
        />.  Don't forget to initialize the <emphasis>Desktop
        Suite</emphasis> on the phone as well.  The <emphasis>Desktop
        Suite</emphasis> on the A920 should be configured to establish
        link using Infrared.

        <figure id="irda-local-pppd-call">
          <title>Establishing a connection to the A920</title>
<programlisting>
<prompt># </prompt><command>pppd call A920-IrDA-local nodetach</command>
Using interface ppp0
Connect: ppp0 &lt;--&gt; /dev/ircomm0
local  IP address 169.254.1.68
remote IP address 169.254.1.1
</programlisting>
        </figure>
      </para>
      <para>
        Check the output to see if the connection was successful and
        verify that the A920 recognizes the connection to the PC.  You
        should also verify the connection by pinging the A920 from the
        PC as shown in <xref linkend="irda-local-ping" />.

        <figure id="irda-local-ping">
          <title>Verifying the connection using ping</title>
<programlisting>
<prompt># </prompt><command>ping -c 3 a920</command>
PING a920 (169.254.1.1) 56(84) bytes of data.
64 bytes from a920 (169.254.1.1): icmp_seq=1 ttl=69 time=201 ms
64 bytes from a920 (169.254.1.1): icmp_seq=2 ttl=69 time=342 ms
64 bytes from a920 (169.254.1.1): icmp_seq=3 ttl=69 time=138 ms

--- a920 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 138.444/227.499/342.110/85.087 ms
</programlisting>
        </figure>
      </para>
    </section>
<!-- FIXME
    <section id="irda-modem">
      <title>Modem Connection</title>
      <para>

      </para>
    </section>
  </section>

  <section id="bt">
    <title>Bluetooth</title>
    <para>

    </para>

    <section id="bt-kernel">
      <title>Kernel Modules</title>
      <para>
        To connect to the A920 to your PC using Bluetooth you need the
        kernel options listed below.

        <itemizedlist>
          <listitem>
            <para>

            </para>
          </listitem>
        </itemizedlist>
      </para>
    </section>

    <section id="bt-local">
      <title>Local Connection</title>
      <para>

      </para>
-->
    </section>
  </section>

  <section id="multisync">
    <title>Synchronizing using Multisync</title>
    <para>
      The A920 comes with a <ulink
      url="http://www.openmobilealliance.org/syncml/">SyncML</ulink>
      client which enables us to synchronize it's contacts, calendar
      and tasks using the <ulink
      url="http://multisync.sourceforge.net">Multisync</ulink> SyncML
      plug-in.
    </para>
    <para>
      First you need to add a synchronization pair as shown in <xref
      linkend="multisync-synchronization-pair-1" />. I synchronize my
      A920 with <ulink
      url="http://www.novell.com/products/desktop/features/evolution.html">Novell
      Evolution 2</ulink>, but any available plug-in can be selected
      as second plug-in.

      <figure id="multisync-synchronization-pair-1">
        <title>Synchronization pair configuration, I</title>
	<mediaobject>
	  <imageobject>
	    <imagedata fileref="images/synchronization-pair-1.png" />
	  </imageobject>
	  <textobject>
	    <phrase>Synchronization pair configuration, I</phrase>
	  </textobject>
	</mediaobject>
      </figure>
    </para>
    <para>
      I recommend setting the synchronization pair to synchronize on
      changes as shown in <xref
      linkend="multisync-synchronization-pair-2" />.

      <figure id="multisync-synchronization-pair-2">
        <title>Synchronization pair configuration, II</title>
	<mediaobject>
	  <imageobject>
	    <imagedata fileref="images/synchronization-pair-2.png" />
	  </imageobject>
	  <textobject>
	    <phrase>Synchronization pair configuration, II</phrase>
	  </textobject>
	</mediaobject>
      </figure>
    </para>

    <section id="multisync-syncml-server">
      <title>SyncML Server</title>
      <para>
        You need to set up the Multisync SyncML plug-in to accept
        connections through http as shown in <xref
        linkend="multisync-syncml-server-1" />.

        <figure id="multisync-syncml-server-1">
          <title>SyncML server configuration, I</title>
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="images/syncml-plugin-1.png" />
	    </imageobject>
	    <textobject>
	      <phrase>SyncML server configuration, I</phrase>
	    </textobject>
	  </mediaobject>
        </figure>
      </para>
      <para>
	The names of the SyncML databases can be seen as shown in
        <xref linkend="multisync-syncml-server-2" />. These names are
        needed for configuring the SyncML client on the A920.

        <figure id="multisync-syncml-server-2">
          <title>SyncML server configuration, II</title>
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="images/syncml-plugin-2.png" />
	    </imageobject>
	    <textobject>
	      <phrase>SyncML server configuration, II</phrase>
	    </textobject>
	  </mediaobject>
        </figure>
      </para>
      <para>
        Make sure you enable the <option>Interpret UTC as local
        time</option> option as shown in <xref
        linkend="multisync-syncml-server-3" />.

        <figure id="multisync-syncml-server-3">
          <title>SyncML server configuration, III</title>
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="images/syncml-plugin-3.png" />
	    </imageobject>
	    <textobject>
	      <phrase>SyncML server configuration, III</phrase>
	    </textobject>
	  </mediaobject>
        </figure>
      </para>
      <para>
	I recommend setting up Multisync to automatically synchronize
        as shown in <xref linkend="multisync-syncml-server-4" />.

        <figure id="multisync-syncml-server-4">
          <title>Automatically synchronize on changes</title>
	  <mediaobject>
	    <imageobject>
	      <imagedata fileref="images/multisync.png" />
	    </imageobject>
	    <textobject>
	      <phrase>Automatically synchronize on changes</phrase>
	    </textobject>
	  </mediaobject>
        </figure>
      </para>
    </section>

    <section id="a920-syncml-client">
      <title>SyncML Client</title>
      <para>
        Configure the SyncML client on the A920 using the settings
        shown in <xref linkend="a920-syncml-client-1" />.

        <figure id="a920-syncml-client-1">
          <title>A920 SyncML client configuration</title>
<programlisting>
Server address: http://169.254.1.68:5079
Username: syncml
Password: ************

Transport Protocol: HTTP
Use transport login: no
</programlisting>
        </figure>

      </para>
      <para>
	Add the synchronization tasks using the same database names as
        specified in the Multisync SyncML plug-in, see <xref
        linkend="multisync-syncml-server-2" />.
      </para>
      <para>
        After establishing a connection between the A920 and the PC,
        as shown earlier in this document, you should be able to
        synchronize the A920 using Multisync.
      </para>
    </section>
  </section>

  <section id="conclusion">
    <title>Conclusion</title>
    <para>
       The Motorola A920 perfectly well with GNU/Linux. Given the
       instructions in this HOWTO it should be pretty straight forward
       to set up the kernel and Multisync for synchronizing as long as
       you have a bit of experience with GNU/Linux.
    </para>
  </section>

  <section id="sect-links">
    <title>Related Links</title>
    <para>
      This section contains a list of hopefully helpful links to
      various documentation related to the A920 and/or GNU/Linux which
      I've collected during the the writing of this document.
    </para>

    <itemizedlist>
      <title>Miscellaneous</title>
      <listitem>
        <para>
          <ulink
          url="http://www.koeniglich.de/p3nfs.html"><citetitle>P3nfs</citetitle></ulink>:
          Symbian to UNIX/Linux communication program
        </para>
      </listitem>
    </itemizedlist>
  </section>
</article>
