ubuntu下与Windows Mobile手机同步

在Ubuntu下面用的是SynCE同步的。
1、首先添加源
sudo gedit  /etc/apt/sources.list
在末尾添加
deb http://ppa.launchpad.net/synce/ubuntu hardy main
deb-src http://ppa.launchpad.net/synce/ubuntu hardy main
保存,关闭
sudo apt-get update
2、更新usb驱动(仅内核在2.6.24-19之前的,如果比这个新请跳过本步骤)
sudo rmmod rndis_host cdc_ether usbnet
sudo rm /lib/modules/`uname -r`/kernel/drivers/net/usb/{rndis_host,cdc_ether,usbnet}.ko
sudo apt-get install usb-rndis-source cdbs
sudo module-assistant auto-install usb-rndis
sudo apt-get install synce-hal librra0-tools librapi2-tools
3、安装SynCE-GNOME
sudo apt-get install python-setuptools
下载
synce-gnome-0.11.tar.gz
解压,在终端进入其目录,运行
python setup.py build
sudo python setup.py install
安装notification-daemon(如果没有安装过的话,用新得立软件包管理器搜索一下就可以了)
4、连接好手机,运行
synce-sync-engine/sbin/ifconfig -a | grep 80:00:60:0f:e8:00  | cut -d " " -f 1
记下他输出的东西
sudo gedit  /etc/network/interfaces
在末尾添加
iface inet dhcp
ps:""里面的是我在上面那步里输出的,你应该更换成你自己的,不带““
保存并关闭,然后运行
sudo /etc/init.d/networking restart
5、安装OpenSync
sudo apt-get install multisync-tools opensync-plugin-evolution opensync-plugin-synce
6、现在该安装的都安装好了,就可以开始同步了
synce-sync-engine
如果出现如下错误
File "/usr/bin/sync-engine", line 84, in
    configObj = Config.Config(progopts)
  File "/usr/lib/python2.5/site-packages/SyncEngine/config.py", line 292, in __init__
    oldconf = os.path.join(self.path,"config.xml")
AttributeError: Config instance has no attribute 'path'
请下载
config.xml
,保存为~/.synce/config.xml(提示:"~"为自己的家目录)
创建同步项目
synce-create-partnership "Linux desktop" "Contacts,Calendar"
ps:还有别的,可自行选择Contacts, Calendar, Tasks, Files 等
创建OpenSync group
msynctool --addgroup synce-sync
msynctool --addmember synce-sync synce-opensync-plugin
msynctool --addmember synce-sync evo2-sync
然后同步
synce-sync-engine
msynctool --sync synce-sync
他会同步到evolution里面
        以上就是我的同步方法,我用的是多普达586w,刷了wm6.1的系统,同步成功了,可是并不是很完美,
其中,他会把全天事件都同步得提前一天。
        当插上数据线后,会多出一块网卡,我的这块网卡ip是169.254.2.2,手机上ActiveSync会显示已连接。
但是“Linux desktop”显示的还是上次同步时间,此时(一般开机后只需要运行一次)需要运行一下
synce-sync-engine(可以在alt+f2里运行,因为如果是终端运行的话这个终端就不能关了),然后手机上的
ActiveSync里面“Linux desktop”就会显示已连接,而电脑里面出现一个synce-sync-engi的进程,这时就说明连
接成功了(可以用手机上网了噢),如果需要同步,就运行msynctool --sync synce-sync。

SynCE on Ubuntu Hardy (8.04 LTS)
(For 8.10 Intrepid the necessary commands can also be found in a tutorial
here
)
Prerequisites
You will need:


  • Ubuntu 8.04 LTS (Hardy Heron)
  • A windows mobile 5/6/6.1 device
    Note: If you are using WM5 or above: Your device should be setup to use RNDIS:

    • WM5: Microsoft doesn't supply a program to change the behaviour, but it is set by default to RNDIS. In case of problems, check for the existence of a program regarding USB settings on your device (some vendors supply a third-party tool with the device for this).

    • WM6: Go to Start -> Settings -> Connections -> USB and make sure the checkbox Enable enhanced network functionality is checked.
  • USB Cable (This guide is not for bluetooth)


This guide is NOT for wm2003 devices, please use the guide for legacy devices as is shown on the


FrontPage

Important note:

When you have enabled KDE4 PPA's in ubuntu, there is a big chance things will not work for you with opensync part for the actual syncing. The reason for this is that in those repositories, KDE4 depends on an experimental version of opensync which is not backwards compatible.


Add the necessary package repositories




  • Go to System -> Administration -> Software Sources
  • Click on Third Party software
  • Click Add...
  • Paste the line:

      deb http://ppa.launchpad.net/synce/ubuntu your_ubuntu_version main

        where you replace your_ubuntu_version with hardy or intrepid, depending on which version you are running.
  • Click Close
  • Click Reload


Advanced users can just add the following lines to their /etc/apt/sources.list (and run sudo apt-get update afterwards):


deb http://ppa.launchpad.net/synce/ubuntu hardy main


deb-src http://ppa.launchpad.net/synce/ubuntu hardy main


(Note, in the above please replace

hardy

by

intrepid

if you are running ubuntu intrepid)


SynCE for Windows Mobile 5/6


Kernel module (for Kernel


Note: for Kernel 2.6.24-19 (at the moment available in hardy-proposed) and newer this step should be skipped.


Get the USB driver *YOU MUST DO THIS* - there are critical fixes here not yet in the kernel.


Unload the current modules:


sudo rmmod rndis_host cdc_ether usbnet


Now we have to delete the old drivers, such that the kernel will not reload them next time:


sudo rm /lib/modules/`uname -r`/kernel/drivers/net/usb/{rndis_host,cdc_ether,usbnet}.ko


Now we have to get and compile the new drivers:


sudo apt-get install usb-rndis-source cdbs


sudo module-assistant auto-install usb-rndis


Two connection schemes


There is actually two connection schemes you can use: newer rndis and legacy serial-over-usb; rndis is taken care of by the rndis_host driver, while the legacy is taken care by the ipaq driver. Furthermore, there are two ways of making the connection: using older but stable odccm and newer and less tested synce-hal which should essentially do everything odccm did, but in a simpler and cleaner way.


The scheme described below is essentially an rndis connection via odccm. This is why you will be asked to blacklist the ipaq driver and to turn Enable enhanced network functionality on. The serial connection via odccm will be hopefully documented some time later and synce-hal when it gets more stable.


Please note, that not all devices supporting rndis follow the same naming. E.g. for Asus P535 instead of turning Enable enhanced network functionality on you need to select ActiveSync (Turbo mode) in the USB Setting dialogue. Please refer to your device documentation on how to enable rndis on your particular PDA or smartphone.


Core libraries


Get the core libraries


sudo apt-get install synce-hal librra0-tools librapi2-tools


Connect your device and run


synce-pls


You should see a list of files on your device. Congratulations, you have a working connection to your device!


If you see the following Message, your device is password protected:


. WARNING **: synce_info_from_odccm: Failed to get a connection for : Not authenticated, you need to call !ProvidePassword with the correct password. pls: Could not find configuration at path '(Default)'


Install synce-trayicon or


SynCE-KPM

to provide a password prompt on device connect.


If you have the Gnome Network Manager running on Ubuntu, it will setup your device as the new default network connection. Check what ethernet device was given to your device with by running the following command in a terminal after you have connected your device:


/sbin/ifconfig -a | grep 80:00:60:0f:e8:00  | cut -d " " -f 1


then add the next line to /etc/network/interfaces:


iface  inet dhcp


This will make Gnome Network Manager ignore the interface. Then restart the networking with the command:


sudo /etc/init.d/networking restart


If you get an error that no devices are connected to odccm you should probably blacklist ipaq module, by adding


blacklist ipaq


to your /etc/modprobe.d/blacklist (recommended


here

)


After that you can remove any currently active ipaq modules with


sudo rmmod ipaq


Another thing to check out when you are having connection problems is your firewall configuration (if, of course, you are using a firewall). For instance, if you are using Ubuntu's default ufw you can check out whether it is running and what the rules are by issuing the following command:


sudo ufw status


If the firewall is running it might be blocking your connections. You might want to disable it completely by running


sudo ufw disable


and if it is, indeed, the source of your problems add a rule to allow connections from your PocketPC device:


sudo ufw allow from 169.254.2.0/24 to any


and it should do the trick.


Syncing with OpenSync


In order to sync your device you need to use OpenSync.


sudo apt-get install multisync-tools opensync-plugin-evolution opensync-plugin-synce


KDE users can use opensync-plugin-kdepim instead of the evolution2 plugin. There is no Thunderbird support in any stable opensync release.


Now you have all the software you need to sync your device on Ubuntu. Please see


SynceSetup

for information on how to use it.


NB: For using the evolution-sync plugin, the disabling of the calendar sync made it work. If the calendar sync is enable it seems the opensync plugin reports a "broken-pipe" error.

Tags: 同步 , mobile , ubuntu , windows

« 上一篇 | 下一篇 »

相关文章

发表评论

评论内容 (必填):

点击获得Trackback地址
My E-mail