This document describes how to connect the A780 Linux smartphone with a Linux desktop computer
either via USB with the Belcarra USBLAN driver or with LEOPPP via Bluetooth.
It was tested with the German version of the A780 phone and Debian Sarge OS.

For nearly everything mentioned here you will need the linloader script properly installed on your phone.
Linloader makes it possible to execute programs or scripts on the phone. Follow these steps to get it done.

1. Get root

2. Connect the phone using the USB cable

3. mount /dev/sdb1 /mnt mount the transflash card of the phone using the MassStorage driver.
(sda1 is the phones internal memory, sdb1 is the memory of the transflash card.)

4. Download and unzip loader.zip. it contains 4 files.
Connect usb mass storage and make new folder 'loader' in /mnt/.system/QTDownLoad.
Make sure you can view hidden files. Send these 3 files to the loader folder.
You should now have:

7. Restart the phone.
You should now see a down arrow icon in tools with the name ``LinLoader''.
open file manager and tap and hold test.lin -> open with select 'LinLoader',
it should be at the end of the list. Check the 'always use the program to open this filetype'.
Close and reopen file manager. If a new file 'test1.txt' has been created, your lin loader is installed successfully.

There are 2 different ways to get USBLAN running on the phone.
The way described here is for you if you have successfully installed Linloader like described before.
Otherwise you can download the usbmode.mpkg file, copy it to the phone i.e. using Mass Storage mode and
invoke the file from file manager to install this native application. A new icon will be created where you can
switch between different USB-Modes .
Detailed instructions can be found in the motorolafans.com forum, search for ``USBMode application''

For Kernel 2.6 just load the ``usbnet.ko'' module into the kernel modprobe usbnet, it is already included.
(Marcus tested it with Kernel 2.6.12 - prior Kernel versions might fail)

For Kernel 2.4 download, unpack and compile the USB-Lan module source usblan.1.0.0.7-linux-2.4.x.tar.
Unpack the sources.
Change to the directory of the sourcecode and enter make.
Install the module by typing

insmod -f ./usblan.o vendor_id=0x22b8 product_id=0x600c

Check the lofgile /var/log/syslog, to make sure the driver loaded successfully.

I use insmod and option 'force' here because the driver has some problems loading with modprobe.

On the phone - use the explorer to click LeoPopUp.jar file to install this java application.
It is used to show messages to the user on the phone - select clickme.sh file use ``open with''
to permanently associate it with Linloader.

Accessing the phone's file system from a Linux host.
Establish a PPP connection via bluetooth (or USB). Brows the SMB Filesystem by typing smb://192.168.1.4/system for /ezxlocal
or smb://192.168.1.4/home for /diska in Konqueror.

Or use smbclient //192.168.1.4/home or smbclient //192.168.1.4/system to enter the interactive shell. For password
just hit enter.

Switch the phone to ``Modem'' mode and connect the USB cable. Watch the log file /var/log/syslog.
A device called /dev/ttyACM0 should have been attached. This is the modem device which accepts AT commands.

Enter this device into the configuration of the ``gscmxx, gnokii, gammu or wammu'' or the software you want to use to control the phone.
Unfortunately none of the mentioned programs fully support the Motorola command set because they are written for Siemens and Nokia phones.
Just sending SMS seems to work for the moment.

Enable bluetooth and discoverable mode on the phone. Enter hcitool inq to recognize the bluetooth address ($btaddr)of the phone.
Use spdtool search to get the channel for the SP service ($sp_channel). hcitool cc and hcitool con connects to the phone.
rfcomm binds the channel to rfcomm0. Now you can send AT commands i.e. with one of the above mentioned programs
on device /dev/rfcomm0.

You can also use this steps instead of dund to establish a PPP connection.
pppd /dev/rfcomm0 noauth local & starts PPP connecion on the host in background and waits for response from the phone.
Then select BTPPP icon on the phone to enable PPP over Bluetooth.

A description to sync with the Java program Sync4j can be found here: http://tud.at/programm/a768i.html Using the Motorola A768i smartphone with GNU/Linux .
However I wasn't successful, the sync stops after a certain amount of records.

Multisync is a GTK+ program to sync different devices. It is possible to sync with KDE Adressbook,
Evolution, and others. However the syncml plugin of the standard distributions seem to be not compatible to A780 and according to www.multisync.org the used wbxml library (Wap Binary XML) seems to be bugy as well.
A pached wbxml can be downloaded from multisync.org, see Documentation - HowTos - SyncML-HowTo.
Alexandre d'Alton wrote a patch for the syncml plugin for Multisync Version 0.82. The patch can be found here:
http://cache.gmane.org//gmane/comp/gnome/apps/multisync/user/2627-001.bin
The mentioned files are also in my files section http://www.troodon.org/a780/files.
I tested it and it works great.

Here is my setup to sync over bluetooth (Leoppp and Mack's connectivity pack is required)

The second synchronistation pair is up to your requirements, maybe you want to start testing with the backup plugin.
Enable Data types Calendar, Addressbook and tasks. Now save and activate the setup. Multisync status for this synchronistation pair will indicate Waiting for changes.
Now start synchronistation on the phone pressing SyncML OTA.

If you have problems, start multisync from a console and enable debug mode export MULTISYNC_DEBUG=1

Cross-compiling the Perl interpreter for A780 is still work in progress.
You can download microperlhttp://www.troodon.org/a780/files/microperl from the files section, rename it to perl and copy it to /diska/bin/ on the phone.
Microperl is a single executable minimalistic perl interpreter.

If someone has working perl scripts using microperl on the phone, please let me know!.