Using the Motorola A768i smartphone with GNU/Linux

Balázs Bárány balazs@tud.at

2005-03-03
The Motorola A768i smartphone uses Linux as its operating system, so it seems to be a good choice for GNU/Linux users. By default, however, many of its functions can only be used with Windows. This document demonstrates a few ways to fully use the capabilities of the phone. There is a very informative page on using the A768i with GNU/Linux at http://tux.medhas.org/static/a768i.html; you should read it first.

1. Synchronising data with a desktop computer

2. Network access

3. Unresolved things


1. Synchronising data with a desktop computer

1.1 Using sync4j

The sync4j project provides a Java-based SyncML server as Free Software. You can use it to make a backup of the synchronizable data in the phone and then to sync with desktop software like Evolution.

Prerequisites

You need TCP/IP access on your phone. There are two possibilities:

Getting necessary software

Sync4j is available from http://sync4j.funambol.com/main.jsp?main=download. I have successfully tested the "2.1 stable release"; newer releases should also work. You need the following downloads: SyncServer (I used the "bundled version" and that's what will be described here; if you already have a servlet engine installed, you could try the unbundled version) and SyncAdmin. From the documentation page http://sync4j.funambol.com/main.jsp?main=documentation, download the Quick Start Guide and the Admin Guide. Read both for a better understanding of the software; I will only shortly describe what you have to do but not why.

You also need a Java runtime. The Blackdown 1.4 release which should be included in most Linux distributions works well.

Installing the sync4j packages

Unpack the sync4j packages you downloaded into different directories. I put them into /home/bb/bin/SyncServer and /home/bb/bin/SyncAdmin-1.0.

You must set a few environment variables for the software to work. Open a few shells you will be using for testing the sync4j software and type:

export J2EE_HOME=/path/to/SyncServer (e.g. /home/bb/bin/SyncServer)
export JAVA_HOME=/path/to/your_java_installation (e.g. /usr/lib/j2se/1.4)

You can automatize this later when everything works.

Starting the Sync Server

If you use the bundled SyncServer package then you can immediately proceed. Else, you must integrate it with your servlet engine, this is described in the Admin Guide.

Change into the SyncServer directory. Edit the config file syncserver-<version>/config/Sync4j. properties and change the first line (server.uri=) to contain your IP address or domain name (if the name is resolvable by your A768i, e.g. over the USB network or GPRS; the IP address seems safer for testing). If you use a proxy software like Squid or JunkBuster, you also need to change the port 8080 to some other number, this is described in the Admin Guide under "7.2. Changing the HTTP listening port".

The shell scripts are probably not executable in the unpacked directory. You can change this with the command "find . -name '*.sh' | xargs chmod 755". Then change into your syncserver-<version> directory and type "bin/start.sh". If your Java setup including the environment variables is right, you should see messages like "[STDOUT] Server 1.6 is running" and "[STDOUT] Press [Ctrl]+[C] to abort" after a few seconds. Verify that the server is running by opening http://your-ip-or-domain-name:8080/sync4j in a web browser. (Use the other port number instead of 8080 if you changed it.) You should see the page describing the Sync4j Server.

Server administration

When the server is running correctly, you can start the SyncAdmin program. Change into the SyncAdmin directory and type "bin/syncadmin.sh". The GUI should open. Click File and Login. In the login window, enter your server IP address or domain name, "syncadmin" as the user name and "sa" as the password, and click Login. If your server is publicly accessible, it's a good idea to change the administrator password. Click on the "+" before the server address and you will see the different categories that can be administered. Open the Roles/Sync User key, type "s" into the Username: field and click Search. The syncadmin user (and others) will be found, you can edit the user data by clicking on the name in the list and then on Edit.

Add a new user for yourself. Click Add and fill out the fields. You can use anything as the user name and password, you'll enter the same values later in the sync setup on the phone. In the Roles: list box, select "Sync User". Click Add.

Now add your phone under "Devices". ID is the IMEI number which should be somewhere on your phone (e.g. behind the battery) or the box of your phone. Enter the number without any dashes or periods. I entered "Motorola A768i" in the Type field; the description is whatever you want.

The last step is assigning the device to the user. Click Principals, Add and then search for the user and the device using the method you already know. When you found your user and device, click both and then "Add Principal".

Setting up the phone

On the phone, first make sure that TCP/IP access works, e.g. over GPRS or the USB cable.

Select the Settings category and tap Sync. In the menu at the right bottom corner, select "OTA Setup". Enter the following information:

Now, in the Sync menu, click "OTA" ("over the air"). It will probably ask for the Internet connection you want to use (even if you use the USB network) and then write "Connecting to the server". If the setup is right, it should begin to synchronize and after a while give a report "Sync successful" and for each category the updated/added/deleted records. The shell where your SyncServer runs will also print information, e.g. "Subject: Principal: <user> Principal: Roles(members:sync_user) authenticated!" and "Preparing slow synchronization". (The slow synchronization happens only at the first time because everything must be transferred to the server.)

Debugging problems

If you have problems, try to find out which side is causing them. If nothing appears in the SyncServer shell, it's probably a network problem between the phone and your computer. Try using tcpdump or ethereal to identify this problem.

If you see logs in the shell but the synchronization doesn't work, there should be error messages that help determine the cause of the problem. (E.g. if a principal is not found, maybe you entered a wrong device ID.) If you need finer logging, you can configure it as described in the Admin Guide under "6.4 Logging".

1.2 Using Multisync to synchronize the data with other software

The Multisync project (http://multisync.sourceforge.net/) has synchronization plugins for SyncML, Ximian Evolution and more. It has SyncML server functionality but I wasn't able to get that to work with the A768i. However, the SyncML client works and can be used to synchronize the data in the sync4j server e.g. with Evolution.

Start Multisync and click the New... button to create a new synchronization pair. Set the first plugin to SyncML, click Options... and set up the SyncML client:

The second plugin can be anything you can use, e.g. Backup or Evolution.

You must create a new principal for this connection in SyncAdmin. Multisync generates a random device ID and stores it in ~/multisync/<sync pair number>/localsyncmlengine (devID = ...). Just create a new device with that ID and the new principal using the user "guest" (Multisync seems to ignore the entered user name) and the device. Click Sync and the data on the sync4j server should be transferred to your Evolution or backup directory.

2. Network access

2.1 Reading e-mail

The pre-installed e-mail program on the phone is not very good. It doesn't seem to support SSL encryption of the transport layer (IMAPS or POP3S) or at least some secure password exchange method. So it transmits passwords in clear-text over the air and the Internet which is not acceptable for me.

Reading mail over SSH

Using MidpSSH, one can use mutt or some other text-mode mail reader quite well. Text input is a bit messy without number keys on the phone or an always-active on-screen keyboard, so it's a good idea to define some macros for mutt. A few examples:

Webmail

The browser supports SSL. If you have access to a web server with SSL support, or set up your own, it should work (see SSL support for more on SSL).

Frames and complex tables and HTML forms don't seem to work. So two of the more popular webmail solutions, IMP and SquirrelMail didn't work in my test. I've tried a few more webmail programs, about five didn't work at all on the phone, and two others worked but were barely usable because of the limited horizontal screen space. So I'll stay with SSH and mutt.

2.2 SSL support on the phone

In the browser on the phone, you can import X509 certificates which are normally used for SSL (and more). Normal desktop browsers warn before connecting when they encounter a website with a certificate that is not signed by a certificate authority they trust. (You can tell most browsers to trust a certificate, or -- this way is preferred -- import the Certification Authority (CA) certificate into the browser.)

To put a certificate on the phone, it must have the extension ".cer" and be in the DER format. On Unix, the typical certificate format is PEM. You must do the following on a computer where OpenSSL is installed to get a DER version of your PEM-formatted certificate:

openssl x509 -in yourcertificate -out yourcertificate.cer -outform der

(DER certificates are binary files while PEM is text.)

Then transfer the .cer file to the phone and import it in the browser settings.

However, the browser on the phone seems to ignore the certificates sent to it by SSL servers. The pages are opened regardless of the certificate chain.

If you get the error "502 Bad gateway", it might be because you use a proxy and that denies your access to the SSL site with the unknown certificate. Try without a proxy, it worked for me.

2.3 Instant Messaging

The jimm project created an instant messenger with ICQ support for J2ME devices. It works well on the A768i over GPRS despite the phone not being listed on the website.

3. Unresolved things