Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Forum Archive > Main Support Categories > General Help
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Hello, Unregistered You are browsing a READ only archive of the main support categories pre 4/21/2008. You will not be able to post or reply any threads in this section.
Ubuntu 9.10 is out!!!

When downloading Ubuntu 9.10 please consider using bittorrent to get your copy of Ubuntu.

The Ubuntu Developers Summit for Lucid Lynx will be held the week of 16-Nov-2009 till 20-Nov-2009 in Dallas, TX USA. Visit the the Ubuntu wiki for more information about UDS and how to participate remotely.

General Help
All your general support questions for Ubuntu, Kubuntu, Edubuntu and Xubuntu.

 
Thread Tools Display Modes
Old January 24th, 2007   #1
edmondt
A Carafe of Ubuntu
 
Join Date: Jun 2005
Beans: 101
How to Connect to a WM5/WM6 Device with USB and sync with Evolution or Kontact

For Feisty Users:

* After upgrading to Feisty my rndis no longer works when I connect my device I get ipaq instead of rndis so I used this guide to compile the latest kernel (2.6.22)

Remember to patch your kernel:

Code:
cd /usr/src/linux
wget http://synce.svn.sourceforge.net/svnroot/synce/trunk/patches/linux-2.6.22-rndis_host-wm5.patch
patch -p1 < linux-2.6.22-rndis_host-wm5.patch
This patch is optional which may increase performance on desktops as discussed on the guide :

Code:
wget http://www.kernel.org/pub/linux/kernel/v2.6/patch-2.6.22.1.bz2
bzcat patch-2.6.22-1.bz2 |patch -p1
make xconfig

You would get a window will lots of options about the kernel, remember to select your processor type etc for better performance.

If you have nvidia card:
Under "Processor type and features" turn "Paravirtualization Support" OFF


http://www.synce.org/index.php/Conne...-rndis-lite%29 - Reminds us to enable these options:
CONFIG_USB_USBNET=y
CONFIG_USB_NET_CDCETHER=y
CONFIG_USB_NET_RNDIS_HOST=y

Search for "ipaq" and disable it, its for older pocket pc like WM 2002, 2003...

Follow the instruction on this guide to finish compiling the kernel and install...

Reboot and reinstalled nvidia or ati drivers using a program called envy (works for both nvidia and ati cards).

... Hope it works for you too... Follow the rest of the guide...

The purpose of this guide is to allow newer WM5 devices like HTC Wizard, Prophet to connect to Ubuntu Edgy 6.10 and be able to share files, install stuff. This guide will take about one hour to complete, depending on your skills etc.


First, let's install synce-trayicon. It won't work yet, but when we're done, it will give you a tray icon like this:



When you connect your device, you should see this:



Code:
wget http://kuci.org/~teddy/ubuntu/synce-software-manager_0.9.0-2_i386.deb
wget http://kuci.org/~teddy/ubuntu/synce-trayicon_0.9.0-2_i386.deb

sudo dpkg -i synce-software-manager_0.9.0-2_i386.deb
sudo dpkg -i synce-trayicon_0.9.0-2_i386.deb

sudo ln -si /usr/lib/libgtop-2.0.so.7 /usr/lib/libgtop-2.0.so.2
Now the tray icon should be installed, and we need to put it in the startup; so goto System, Preference, Sessions, Startup Programs, Add New:

Code:
synce-trayicon
Now let's find out the device you have:

unplug your device and run this command:

Code:
ls /dev > /tmp/before
now plug in your device and run this:

Code:
ls /dev > /tmp/after
diff /tmp/before /tmp/after
If you see something like ttyUSB0, then you should go here:

http://ubuntuforums.org/showthread.php?t=136257

Otherwise

Code:
sudo lshw -businfo | grep usb

I have a Prophet and before connecting my device it gives me:

Code:
usb@1        usb1       bus            UHCI Host Controller
usb@2        usb2       bus            UHCI Host Controller
usb@2:2                 bus            Logitech BT Mini-Receiver
usb@2:2.2               input          Logitech BT Mini-Receiver
usb@2:2.3               input          Logitech BT Mini-Receiver
usb@3        usb3       bus            UHCI Host Controller
usb@4        usb4       bus            EHCI Host Controller
After connecting my device and run the same code again it gives me:
Code:
usb@1        usb1       bus            UHCI Host Controller
usb@1:2                 generic        Generic RNDIS
usb@2        usb2       bus            UHCI Host Controller
usb@2:2                 bus            Logitech BT Mini-Receiver
usb@2:2.2               input          Logitech BT Mini-Receiver
usb@2:2.3               input          Logitech BT Mini-Receiver
usb@3        usb3       bus            UHCI Host Controller
usb@4        usb4       bus            EHCI Host Controller
So I have a Generic RNDIS... I would need compile some stuff to get the rndis driver:

Code:
sudo apt-get install libglib2.0-dev libusb-dev build-essential autoconf automake1.9 libtool libgnet-dev libhal-dev libhal-storage-dev libdbus-glib-1-dev subversion linux-headers-`uname -r` python-dbus
Now let's grab some stuff driver using terminal command, do this:

Code:
cd
svn checkout https://synce.svn.sourceforge.net/svnroot/synce/trunk/libsynce
svn checkout https://synce.svn.sourceforge.net/svnroot/synce/trunk/librapi2
svn checkout https://synce.svn.sourceforge.net/svnroot/synce/trunk/odccm
svn checkout https://synce.svn.sourceforge.net/svnroot/synce/trunk/synce-gnome
Compile libsynce, enter the commands line by line:

Code:
cd libsynce/
./bootstrap
./configure --enable-desktop-integration
make
sudo make install
cd ..
If you get any errors in ./configure, then search for the missing library, say you're missing gcc, then search like this:

Code:
apt-cache search packagename
or:
Code:
apt-cache search packagename | grep packagename
then install any missing packages:

Code:
sudo apt-get install packagename

Next:

Code:
echo "/usr/local/lib" | sudo tee -a /etc/ld.so.conf
sudo ldconfig
cd librapi2/
./bootstrap
./configure
make
sudo make install
cd ..
Compile odccm:

Code:
cd odccm/
autoreconf -i
./configure
make
sudo make install
sudo cp data/dbus/odccm.conf /etc/dbus-1/system.d/
cd ..
Next the usb driver: you should find out which driver will work by going to:

http://www.synce.org/index.php/Windows_Mobile_2005_HCL

I have a Prophet (Dopod 818 Pro) usb-rndis should work, but usb-rndis-lite is the newer driver and that's what I will be using:

Code:
svn co https://svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-lite
cd usb-rndis-lite/
make
sudo ./clean.sh
sudo make install
cd ..
If you need the usb-rndis-ng, do this:

Code:
sudo apt-get install libhal-dev libhal-storage-dev
svn co https://svn.sourceforge.net/svnroot/synce/trunk/usb-rndis-ng
cd usb-rndis-ng/
./autogen.sh
./configure --enable-hal
make
sudo make install
cd ..

If it all works out, unplug and plug in your device, then do this:

Code:
sudo dhclient3 rndis0
And I got:

DHCPREQUEST on rndis0 to 255.255.255.255 port 67
DHCPACK from 169.254.2.1
bound to 169.254.2.2 -- renewal in 1267550 seconds.

I got an ip, great! now test out odccm by entering this:

Code:
sudo odccm -f

then enter:

Code:
pls
It should list your directory on your pocket pc.

If it doesn't work, or you have firestarter installed, do this:

Code:
sudo chmod u+w /etc/firestarter/user-pre
gksudo gedit /etc/firestarter/user-pre
Add this to the file:

Code:
$IPT -A INPUT -i rndis0 -j ACCEPT
$IPT -A OUTPUT -o rndis0 -j ACCEPT
Save and exit. Then:

Code:
sudo chmod u-w /etc/firestarter/user-pre
...and it should work. For a list of commands, goto:

http://www.synce.org/index.php/SynCE_Tools


So we have a connection, but we still need to make this useful, we need to install synce-gnome, which displays a bubble when your device is connected and disconnected, and you can also execute commands etc...


Code:
svn co https://synce.svn.sourceforge.net/svnroot/synce/trunk/oleavr-files/synce-gnome
cd synce-gnome/src
python test.py
Now when you unplug your device, you should see a bubble saying device disconected, plug it in and it will say device connected. This will be useful later on...

We want enable browsing via nautilus, so we need to do this:

Code:
sudo apt-get install librapi2 librapi2-dev librapi2-tools librra0 librra0-dev librra0-tools libsynce0 libsynce0-dev synce-dccm synce-serial libgnomevfs2-dev gcc-3.3
then:

Code:
cd /usr/lib
sudo ln -s libsynce.so.0.0.0 libsynce.so
sudo ln -s librapi.so.2.0.0 librapi.so
then to compile:

Code:
cd ~
export CC=/usr/bin/gcc-3.3
svn co https://svn.sourceforge.net/svnroot/synce/trunk/gnomevfs
cd gnomevfs/
./bootstrap
./configure
make
sudo make install
Code:
ls /usr/bin/gcc-*
export CC=/usr/bin/gcc-4.1
sudo gedit /etc/gnome-vfs-2.0/modules/default-modules.conf
Add this at the end of the file:

Code:
synce: libsyncevfs
Save and exit. You should then be able to browse your files by entering
Code:
synce:///
Don't worry if it doesn't work now, it should be good after a restart when we finish the rest; we need to automatically start odccm:

Code:
gksudo gedit /etc/init.d/odccm
Copy and paste this in:
Code:
#! /bin/sh
# /etc/init.d/odccm
#
# Script d'initiation du daemon odccm
# http://www.synce.org

PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin

test -x /usr/local/sbin/odccm || exit 0

. /lib/lsb/init-functions

case "$1" in
  start)
    log_daemon_msg "Starting odccm service"
    if start-stop-daemon --start --exec /usr/local/sbin/odccm ; then
        log_end_msg 1
        exit 1
    fi
    log_end_msg 0
  ;;
  stop)
    log_daemon_msg "Stopping odccm service"
    start-stop-daemon --stop --exec /usr/local/sbin/odccm ;
    log_end_msg 0
  ;;
  restart)
    $0 stop
    sleep 2
    $0 start
  ;;
    *)
    log_action_msg "Usage: /etc/init.d/odccm {start|stop|restart}"
    exit 1
    ;;
esac

exit 0
then:
Code:
sudo chmod +x /etc/init.d/odccmsudo
update-rc.d odccm defaults

Next we copy that synce-gnome to:

Code:
cd
sudo cp synce-gnome /usr/src/
sudo chown -R root.root /usr/src/synce-gnome
Put this in the System, Preference, Session, Startup Programs, add:

Code:
python /usr/share/synce-gnome/src/test.py
Next we modify test.py:

Code:
gksudo gedit /usr/share/synce-gnome/src/test.py
Clear everything and paste this in:

Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import dbus
import dbus.glib
import gtk
import os

class TestApp:
    def __init__(self):
        self.devices = {}

        bus = dbus.SystemBus()
        self.bus = bus
        proxy_obj = bus.get_object("org.synce.odccm", "/org/synce/odccm/DeviceManager")
        mgr = dbus.Interface(proxy_obj, "org.synce.odccm.DeviceManager")

        mgr.connect_to_signal("DeviceConnected", self.device_connected_cb)
        mgr.connect_to_signal("DeviceDisconnected", self.device_disconnected_cb)

        session_bus = dbus.SessionBus()
        notif_obj = session_bus.get_object("org.freedesktop.Notifications", "/org/freedesktop/Notifications")
        self.notify_iface = dbus.Interface(notif_obj, "org.freedesktop.Notifications")

        for obj_path in mgr.GetConnectedDevices():
            self._add_device(obj_path, False)
        
    def device_connected_cb(self, obj_path):
        self._add_device(obj_path, True)

    def device_disconnected_cb(self, obj_path):
        if obj_path in self.devices:
            device = self.devices[obj_path]
            self.notify_iface.Notify("SynCE", 0, "", "PDA disconnected", "'%s' just disconnected." % device.name, [], {}, 3000)
            del self.devices[obj_path]
            p = os.popen('killall synce-trayicon')

    def _add_device(self, obj_path, just_connected):
        device = CeDevice(self.bus, obj_path)
        self.devices[obj_path] = device

        if just_connected:
            p = os.popen('killall synce-trayicon')
            self.notify_iface.Notify("SynCE", 0, "", "PDA connected", "A %s %s '%s' just connected." % \
                (device.model_name, device.platform_name, device.name), [], {}, 3000)


ODCCM_DEVICE_PASSWORD_FLAG_SET     = 1
ODCCM_DEVICE_PASSWORD_FLAG_PROVIDE = 2

class CeDevice:
    def __init__(self, bus, obj_path):
        self.obj_path = obj_path
        dev_obj = bus.get_object("org.synce.odccm", obj_path)
        dev = dbus.Interface(dev_obj, "org.synce.odccm.Device")
        self.name = dev.GetName()
        self.platform_name = dev.GetPlatformName()
        self.model_name = dev.GetModelName()
        self.dev_iface = dev
        
        dev.connect_to_signal("PasswordFlagsChanged", self.password_flags_changed_cb)
        
        self._print_debug()
        
        self._password_flags_changed()

    def _print_debug(self):
        dev = self.dev_iface
        print "Created CeDevice with obj_path=\"%s\"" % self.obj_path
        print "  GetIpAddress:", dev.GetIpAddress()
        print "  GetGuid:", dev.GetGuid()
        print "  GetOsVersion:", dev.GetOsVersion()
        print "  GetName:", dev.GetName()
        print "  GetVersion:", dev.GetVersion()
        print "  GetCpuType:", dev.GetCpuType()
        print "  GetCurrentPartnerId:", dev.GetCurrentPartnerId()
        print "  GetId:", dev.GetId()
        print "  GetPlatformName:", dev.GetPlatformName()
        print "  GetModelName:", dev.GetModelName()
        print "  GetPasswordFlags:", dev.GetPasswordFlags()

    def password_flags_changed_cb(self, added, removed):
        print "password_flags_changed_cb: added=0x%08x removed=0x%08x" % (added, removed)
        self._password_flags_changed()

    def _password_flags_changed(self):
        flags = self.dev_iface.GetPasswordFlags()

        if flags & ODCCM_DEVICE_PASSWORD_FLAG_PROVIDE:
            authenticated = False
            while not authenticated:
                dlg = EntryDialog(None, "Password required",
                                  "The PDA '%s' is password-protected.  Enter password:" % self.name,
                                  True)
                if dlg.run() == gtk.RESPONSE_ACCEPT:
                    authenticated = self.dev_iface.ProvidePassword(dlg.get_text())
                dlg.destroy()


class EntryDialog(gtk.Dialog):
    def __init__(self, parent, title, text, password=False):
        gtk.Dialog.__init__(self, title, parent,
                            gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
                            (gtk.STOCK_OK, gtk.RESPONSE_ACCEPT,
                             gtk.STOCK_CANCEL, gtk.RESPONSE_REJECT))

        label = gtk.Label(text)
        label.set_alignment(0.0, 0.5)
        self.vbox.pack_start(label, False)
        self._label = label

        entry = gtk.Entry()
        entry.set_visibility(not password)
        self.vbox.pack_start(entry, False, True, 5)
        self._entry = entry

        self.show_all()

    def get_text(self):
        return self._entry.get_text()


TestApp()
gtk.main()
Save and exit... Now you're ready to reboot!

Note:
- You need to plug and unplug your device after you login for the tray icon to light up


Now to sync with Evolution or Kontact, there is 3 options:

1. Use the SyncEngine - http://www.synce.org/index.php/SyncEngine
2. sync with Scheduleworld and Evolution using the syncevolution engine.
3. sync with a local Funambol server installed locally no internet connection required.

No matter which option you pick, there is going to be some work envolved

1. Please follow the guide: http://www.synce.org/index.php/SyncEngine to get SynEngine going...

2. If you have wifi or a unlimited gprs connection, Scheduleworld is a free service and might be a good way to go, since you can sync anywhere on the go and supports google, google calendar, evolution etc.

I will complete this how to at a later time... Please follow this guide if you plan to sync with ScheduleWorld

http://www.sjoerdmulder.nl/wordpress/?p=4


I hope someday, all this will be built in to ubuntu so that connect and sync with a pocket pc is easy. Please help by sending feedback and suggestions.

More Reading:

http://www.lvivier.info/SynceFS/ - an application allowing to mount pocketPC like a remote filesystem (deb for ubuntu available).
Attached Thumbnails
Click image for larger version

Name:	device_in.png
Views:	12052
Size:	38.7 KB
ID:	37841   Click image for larger version

Name:	device_out.png
Views:	12016
Size:	38.6 KB
ID:	37842  
__________________
Domain and Hosting: http://www.biztoe.net
Website Development: http://www.biztoe.com

Last edited by edmondt; July 11th, 2007 at 01:54 PM.. Reason: Added how to.
edmondt is offline   Reply With Quote
Old February 3rd, 2007   #2
subtex
Just Give Me the Beans!
 
Join Date: May 2005
Beans: 45
Re: How to Connect to a WM5 Device with USB

Man is that a lot of work!

I think I'll wait until this is more plug and play...



Ubuntu has spoiled me. I expect stuff to just sort of work now.
subtex is offline   Reply With Quote
Old February 14th, 2007   #3
darrengoddard
Spilled the Beans
 
Join Date: Feb 2007
Beans: 14
Re: How to Connect to a WM5 Device with USB

thanks fr all the hard work put in. i got this far...

I got an ip, great! now test out odccm by entering this:

Code:

sudo odccm -f

and then terminal just seemed to stop. and i'm not sure what to do. any help would be greatly appreciated.

regards
darren
darrengoddard is offline   Reply With Quote
Old February 15th, 2007   #4
dzul1983
5 Cups of Ubuntu
 
Join Date: Feb 2007
Beans: 15
Re: How to Connect to a WM5 Device with USB

having the same problem here.. device is HTC Tytn (Hermes)
dzul1983 is offline   Reply With Quote
Old February 19th, 2007   #5
edmondt
A Carafe of Ubuntu
 
Join Date: Jun 2005
Beans: 101
Re: How to Connect to a WM5 Device with USB

Try it with just "sudo odccm" and then type "pls" and see if you have a directory listing...

If it works then skip "odccm -f", it is only used for testing...
edmondt is offline   Reply With Quote
Old February 22nd, 2007   #6
wormie_dk
Spilled the Beans
 
Join Date: Feb 2007
Beans: 14
Re: How to Connect to a WM5 Device with USB

When I get to :
Code:
sudo dhclient3 rndis0
This command fails. dmsg might shed some light on the matter but I am not sure:
Code:
[17182098.320000] usb 4-6.4: new full speed USB device using ehci_hcd and address 12
[17182098.420000] usb 4-6.4: configuration #1 chosen from 1 choice
[17182098.504000] rndis_host 4-6.4:1.0: RNDIS_MSG_QUERY(0x01010101) failed, -110
[17182098.504000] rndis_host: probe of 4-6.4:1.0 failed with error -110
Do you have any idea how to proceed next?

Thanks

David
wormie_dk is offline   Reply With Quote
Old February 23rd, 2007   #7
darrengoddard
Spilled the Beans
 
Join Date: Feb 2007
Beans: 14
Re: How to Connect to a WM5 Device with USB

so near and yet...

thanks for the info/advice with odccm -f.

managed to move on and received the following message

darren@desktop:~$ sudo cp synce-gnome /usr/src/
cp: omitting directory `synce-gnome'

and then i ground to a halt.

would really appreciate your support.

regards
darren
darrengoddard is offline   Reply With Quote
Old February 23rd, 2007   #8
darrengoddard
Spilled the Beans
 
Join Date: Feb 2007
Beans: 14
Re: How to Connect to a WM5 Device with USB

also (really not splitting hairs but it caught me out for a while) i think this is a typo...

should

sudo chmod +x /etc/init.d/odccmsudo
update-rc.d odccm defaults


actually say

sudo chmod +x /etc/init.d/odccm
sudo update-rc.d odccm defaults


smile
darren
darrengoddard is offline   Reply With Quote
Old March 4th, 2007   #9
beow
A Carafe of Ubuntu
 
Join Date: May 2005
Location: Sweden
Beans: 91
Ubuntu 9.04 Jaunty Jackalope
Re: How to Connect to a WM5 Device with USB

Quote:
Originally Posted by wormie_dk View Post
When I get to :
Code:
sudo dhclient3 rndis0
This command fails. dmsg might shed some light on the matter but I am not sure:
Code:
[17182098.320000] usb 4-6.4: new full speed USB device using ehci_hcd and address 12
[17182098.420000] usb 4-6.4: configuration #1 chosen from 1 choice
[17182098.504000] rndis_host 4-6.4:1.0: RNDIS_MSG_QUERY(0x01010101) failed, -110
[17182098.504000] rndis_host: probe of 4-6.4:1.0 failed with error -110
Do you have any idea how to proceed next?

Thanks

David
I also got this RNDIS_MSG_QUERY(0x01010101) failed from dmesg. First time I inserted the plug I didn't get that message and also got a device (I think) rndis0. But now it halts by the rndis_host stage as above all times I plug in and out the plug. Is it possible to remove the "configuration #1" that was not present at the first attempt? How?

Anyone?
beow is offline   Reply With Quote
Old March 6th, 2007   #10
Haitao
First Cup of Ubuntu
 
Haitao's Avatar
 
Join Date: Mar 2007
Location: Beijing, China
Beans: 3
Ubuntu Karmic Koala (testing)
Re: How to Connect to a WM5 Device with USB

Hi!

Thanks a lot for the long post and detailed process.

There is a typo starting from the section:
Quote:
Next we copy that synce-gnome to:
You probably need to edit your post and amend it as people will follow it blindly and it won't work.

The cp command should have -R in order to copy the sub-directories as well and there is a problem as you copy those files to /usr/src/... but then all the other commands and copy and paste are based on /usr/share/... instead. So the startup script won't work, the edit of test.py won't work and so on.

Now I almost got everything "working" except that pls gives me:
Code:
** (process:6368): WARNING **: No devices connected to odccm
pls: Unable to initialize RAPI: An unspecified failure has occurred
but dmesg see the device with the rndis driver (though I can't access www.synce.org from China, I have a Dopod 838 and assumed the rndis-lite would work too).

Any idea about what could be wrong?

Thanks
Haitao is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:48 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. bilberry