Search:  
Gentoo Wiki

HOWTO_sync_mobile_phone_with_Gentoo

Merge-arrows.gifIt has been suggested that this article be Merged into one article with Mobile Phone/Synchronization.    (Discuss)

Contents

Description

Mobile phone companies don't usually have ready solutions for syncing or backing up data from mobile phone to Linux OS. However there are great tools available to make it possible. This guide explains how Calendar and Contacts can be synced from Symbian based mobile. Also explained how phone memory and memorycard can be accessed via Bluetooth. Read Mobile Phone/Bluetooth to set up bluetooth connection. USB connection could be used also but I haven't tested it. I have tested the following guidelines with Nokia N73 and N93 over Bluetooth using the syncml method for syncronisation. A Siemens S65 is reported to work with the irmc synchronisation method.

Kernel Support

In order to be able to mount phone memory and memorycard, enable userspace filesystem support:

Linux Kernel Configuration: Fuse support
File Systems --->
  <*> Filesystem in Userspace support


Before activating automounting, read the Autofs guide. In order to mount phone memory and memorycard automatically, enable also Kernel automounter:

Linux Kernel Configuration: automounter support
File Systems --->
  <*> Kernel automounter version 4 support (also supports v3)


Install package(s) for Syncing

Install Opensync to sync contacts and calendar against a directory (file plugin)

echo "app-pda/msynctool ~x86" >> /etc/portage/package.keywords
echo "app-pda/libopensync ~x86" >> /etc/portage/package.keywords
echo "app-pda/libopensync-plugin-file ~x86" >> /etc/portage/package.keywords
emerge -av msynctool libopensync-plugin-file

Install syncml syncronisation plugin (use for syncML capable devices)

echo "app-pda/libopensync-plugin-syncml ~x86" >> /etc/portage/package.keywords
echo "app-pda/libopensync-plugin-syncml obex http" >> /etc/portage/package.use
echo "app-pda/libsyncml ~x86" >> /etc/portage/package.keywords
echo "app-pda/libsyncml bluetooth obex http" >> /etc/portage/package.use
emerge -av libopensync-plugin-syncml

For irmc syncronisation (use for irmc capable devices)

echo "app-pda/libopensync-plugin-irmc ~x86" >> /etc/portage/package.keywords
emerge -av libopensync-plugin-irmc

Create OpenSync group and members

First create a new group mobile preferably as user (you want to sync your contacts and appointments as user - always keep system data and user data separate)

msynctool --addgroup mobile

Then add the file plugin as first member

msynctool --addmember mobile file-sync

Next add the SyncML or IrMC plugin as the second member

msynctool --addmember mobile syncml-obex-client

or

msynctool --addmember mobile irmc-sync

Configure mobile members

First configure the file-sync plugin.

mkdir /home/user/syncdir
msynctool --configure mobile 1

Modify the file:

<config>
 <path>/home/user/syncdir</path>
 <recursive>FALSE</recursive>
</config>

Scan for Bluetooth devices and pick the MAC address of the device you want to sync with

hcitool scan

Check the channel used in SyncMLClient or IrMC Sync

sdptool browse xx:xx:xx:xx:xx:xx

Configure SyncML sync

Skip this section if you will be using IrMC.

Check your mobile phone for contacts database (case sensitive)

msynctool --configure mobile 2

( On N73 you should find your info under "Nokia SyncML Server": Channel 13 )

Fill the acquired data in the fields below in bold

<?xml version="1.0"?>
<config>
  <bluetooth_address>xx:xx:xx:xx:xx:xx</bluetooth_address>
  <bluetooth_channel>xx</bluetooth_channel>
  <interface>0</interface>
  <identifier>PC Suite</identifier>
  <version>1</version>
  <wbxml>1</wbxml>
  <username></username>
  <password></password>
  <type>2</type>
  <usestringtable>1</usestringtable>
  <onlyreplace>0</onlyreplace>
  <recvLimit>0</recvLimit>
  <maxObjSize>0</maxObjSize>
  <contact_db>Contacts</contact_db>
</config>

Configure IrMC sync

Skip this section if you configured SyncML

Check your mobile phone for contacts database (case sensitive)

msynctool --configure mobile 2

Fill the acquired data in the fields below in bold

<config>
  <connectmedium>bluetooth</connectmedium>
  <btunit>xx:xx:xx:xx:xx:xx</btunit>
  <btchannel>xx</btchannel>
</config>

Syncronize

Sync the contacts:

msynctool --sync mobile

Install package(s) for mounting

Install ObexFS to access phone memory and memorycard

echo "sys-fs/obexfs ~x86" >> /etc/portage/package.keywords
echo "sys-fs/fuse ~x86" >> /etc/portage/package.keywords
emerge -av obexfs

Mount obexfs:

mkdir /mnt/mobile
mount -t fuse "obexfs#-bxx:xx:xx:xx:xx:xx -Bxx" /mnt/mobile

You can add a line in /etc/fstab. To include the -B option, escape the space with a backslash sequence:

obexfs#-bxx:xx:xx:xx:xx:xx\040-Bxx      /mnt/mobile     fuse    allow_other     0 0

If you want to automount the device, add the following line to /etc/autofs/auto.auto.

mobile  -fstype=fuse,allow_other        :obexfs#-bxx:xx:xx:xx:xx:xx -Bxx

Troubleshooting

If running the command

msynctool --sync mobile

fails, it may be permission problems. You should create a new udev rule for this:

File: /etc/udev/rules.d/99-user.rules
ATTRS{idVendor}=="0xID_VENDOR", ATTRS{idProduct}=="0xID_PRODUCT", MODE="660", GROUP="plugdev"

where ID_VENDOR and ID_PRODUCT need to be set to the mobile device you are synchronizing.

As root, run

lsusb

and read off the vendor and product IDs from the output,

Bus 001 Device 001: ID ID_VENDOR:ID_PRODUCT NAME_OF_MOBILE_DEVICE
Retrieved from "http://www.gentoo-wiki.info/HOWTO_sync_mobile_phone_with_Gentoo"

Last modified: Thu, 09 Oct 2008 21:49:00 +0000 Hits: 14,840