gummAY's room

  • HOME
  • DIARY
  • KBASE
  • SEARCH
  • DROPBOX
  • LOGIN

Links

AttphanRamblings of a wandering physics student...

AussieGridBlog for the Australia-ATLAS Tier 2 Facility at The University of Melbourne.

A Muso LifeThe ramblings of a university student ... and musician.

ClaySze Ching is Clay, perpertually being moulded.

JamesXThe official weblog of James D Panther, a consistently interesting read covering a broad range of topics with excellent supporting multimedia.

Melbourne WirelessMelbourne Wireless Inc is a non-profit group aiming to establish a fast, free, Melbourne-wide wireless network.

MultiMeterThe home for the ramblings of Richard Heard; gadgets reviewed, relevent links and witty remarks.

Mind My WordsChris Simon speaks his mind.

S.E.S."Three things I can't live without are, my laptop Ollie, lip balm and good ol' crispy bacon..." Extraordinary!

The Walk of my LifeTake a walk in the footsteps of Wen Li.


Search

Get Firefox


valid XHTML

valid CSS

  Nokia e51

6:55pm, Friday 17th October 2008 [gummAY]

Thanks to a massive effort from a bunch of my friends, led by Ting, I am the proud new owner of a Nokia E51.

I'm hoping to throw some code together and get it to synchronise my contacts under linux from my existing addressbook and post up a few things here.

Random fact:

  • the E51 supports IPv6, but will prefer A records over AAAA records where they are available
So, on to connecting to linux. There are two USB modes on the E51:
  1. Data Transfer mode - plain old usb storage device access to the memory card only
  2. PC Suite mode - allows access to the phone's internal memory
The former was plug and play, KDE popping up the device straight away. The latter I am still working on.

In PC Suite mode, the phone acts as a USB to serial converter, so you need to have these options enabled in the kernel:
Device Drivers  ---> 
USB support --->
USB Serial Converter support --->
<M> USB Serial Converter support
[*] USB Generic Serial Driver

After a quick recompile & reboot, look up your phone using lsusb:

Bus 007 Device 007: ID 0421:0042 Nokia Mobile Phones

Which means you are looking at:

modprobe usbserial vendor=0x0421 product=0x0042

or the below in /etc/modules.autoload.d/kernel-2.6
usbserial vendor=0x0421 product=0x0042
When the phone is connected, you can find it at /dev/ttyUSB0 and /dev/ttyUSB1.

OpenOBEX provides a protocol and userspace applications by which to access the data on the phone. I run gentoo, so to install it:
gummay # emerge openobex obexftp obexfs

The latter of the three packages provides a FUSE module to access the phone's filesystem directly.

Test that obex can see your phone's interfaces

gummay # obex_test -u
Using USB transport, querying available interfaces
Interface 0: Nokia Nokia E51 SYNCML-SYNC
Interface 1: Nokia Nokia E51 PC Suite Services
Interface 2: Nokia Nokia E51 SYNCML-DM
Next, see if you can access the PC Suite Services interface - you should get something like this:

gummay # obexftp -u 1 -c C: -l
Connecting...done
Sending "C:"... done
Receiving "(null)"... <?xml version="1.0"?>
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"
  [ <!ATTLIST folder mem-type CDATA #IMPLIED>
  <!ATTLIST folder label CDATA #IMPLIED> ]>
<folder-listing version="1.0">
   <parent-folder />
   <folder name="data" modified="20080425T000010Z" user-perm="RW" mem-type="DEV"/>
   <file name="feeds_view_template.html" size="1798" modified="20081017T154330Z" user-perm="RWD"/>
</folder-listing>done
Disconnecting...done


C: is the phone's memory - you can access the memory card at E:
gummay # obexftp -u 1 -c E: -l
Connecting...done
Sending "E:"... done
Receiving "(null)"... <?xml version="1.0"?>
<!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd"
  [ <!ATTLIST folder mem-type CDATA #IMPLIED>
  <!ATTLIST folder label CDATA #IMPLIED> ]>
<folder-listing version="1.0">
   <parent-folder />
   <folder name="Images" modified="20081017T080028Z" user-perm="RW" mem-type="MMC" label="Images"/>
   <folder name="Others" modified="20081017T080028Z" user-perm="RW" mem-type="MMC" label="Other"/>
   <folder name="Sounds" modified="20081017T080028Z" user-perm="RW" mem-type="MMC" label="Sound clips"/>
   <folder name="Videos" modified="20081017T080028Z" user-perm="RW" mem-type="MMC" label="Video clips"/>
</folder-listing>done
Disconnecting...done

The commandline is less than ideal for playing around - conveniently ObexTool fills this void nicely. I needed to
gummay # emerge tk bwidget
gummay # wget http://www.nemethi.de/tablelist/tablelist4.10.tar.gz
gummay # tar -xvzpf tablelist4.10.tar.gz
gummay # cp -r tablelist4.10 /usr/lib/tcl8.4/
#dependencies setup, now install the tool
gummay # wget http://www.tech-edv.co.at/downloads/obextool-0.33.tar.gz
gummay # tar -xvzpf obextool-0.33.tar.gz
gummay # cd obextool-0.33
gummay # vim ./etc/obexwrap.sh
#change the line to readobexftp -u 1 "$@"
before I could run obextool.tk:
gummay # ./obextool.tk

OK, so now we have complete access to the files on both the phone memory and the memory card, it's time to look at syncing things like contacts and calendars.

We'll try and use syncML

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
echo "app-pda/libopensync-plugin-syncml ~x86" >> /etc/portage/package.keywords
echo "app-pda/libopensync-plugin-vformat ~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 obex http" >> /etc/portage/package.use
emerge -pv msynctool libopensync-plugin-file libopensync-plugin-syncml libopensync-plugin-vformat
msynctool --addgroup e51
msynctool --addmember e51 file-sync
msynctool --addmember e51 syncml-obex-client

mkdir /home/gummay/syncdir
msynctool --configure mobile 1
#change directory to /home/gummay/syncdir
msynctool --configure mobile 2

Now, this should work:

gummay  # msynctool --showgroup e51
Group: E51
Member 1: file-sync
        Configuration : <?xml version="1.0"?>
<config>
<!--
<directory>
    <path>/home/gummay/syncdir</path>
    <objtype>contact</objtype>
  </directory>
-->

  <!--

   Field objformat set the object format which should be used to store.
   objformat is optional - by default objformat is "file".

  -->

  <directory>
    <path>/home/gummay/syncdir/contact</path>
    <objtype>contact</objtype>
    <objformat>vcard30</objformat>
  </directory>

 <directory>
   <path>/home/gummay/syncdir/event</path>
   <objtype>event</objtype>
   <objformat>vevent20</objformat>
 </directory>

  <!--
  <directory>
    <path></path>
    <objtype>event</objtype>
    <objformat>vevent20</objformat>
  </directory>
  -->

</config>

Member 2: syncml-obex-client
        Configuration : <?xml version="1.0"?>
<config>
  <!-- sets the connection type to use. -->
  <!-- please note that actually OBEX over network is not supported -->
  <!-- 1 means obex over serial cable -->
  <!-- 2 means obex over bluetooth    -->
  <!-- 3 means obex over IRDA         -->
  <!-- 4 means obex over network      -->
  <!-- 5 means obex over usb          -->
  <type>5</type>

  <!-- (Only for bluetooth) The bluetooth address if the bluetooth mode is selected.
       `hciconfig scan` to search bluetooth devices.  -->
  <bluetooth_address></bluetooth_address>

  <!-- (Only for bluetooth) The bluetooth channel to use.
       `sdptool browse $MAC` to search for the correct channel -->
  <bluetooth_channel></bluetooth_channel>

  <!-- (Only for USB) The usb interface number of the SYNCML-SYNC target. use syncml-obex-client -u (you will need access to the USB raw device) to find it. -->
  <interface>0</interface>

  <!-- The string that the plugin will use to identify itself. Some devices need a special string here. -->
  <identifier>PC Suite</identifier>

  <!-- The syncml version to use: 0 for 1.0, 1 for 1.1 and 2 for 1.2 -->
  <version>1</version>

  <!-- if the plugin should use wbxml -->
  <wbxml>1</wbxml>

  <!-- The username to use. Leave empty to not require a username -->
  <username></username>

  <!-- the password for the username -->
  <password></password>

  <!-- If wbxml is enabled, defines wether the wbxml should use string tables -->
  <usestringtable>0</usestringtable>

  <!-- Never send ADD command, but send REPLACE (not needed normally) -->
  <onlyreplace>0</onlyreplace>

  <!-- Workaround around for mobile phones which only use local timestamps and _no_ UTC timestamps! -->
  <onlyLocaltime>0</onlyLocaltime>

  <!-- Sets the maximum allowed size in bytes of incoming messages (some device need this option set). Example: 10000 -->
  <recvLimit>0</recvLimit>

  <maxObjSize>0</maxObjSize>

  <!-- XXX: Currently you need to write this by your own.
       Later it's planned to create such entries on the fly during
       the discovery() call. Example database field:

       21/30
-->
  <database>
    <name>Contacts</name>
    <objtype>contact</objtype>
    <objformat>vcard30</objformat>
  </database>

  <database>
    <name>Calendar</name>
    <objtype>event</objtype>
    <objformat>vevent20</objformat>
  </database>


<!--
 <contact_db>Contacts</contact_db>
 <calendar_db>Calendar</calendar_db>
 <note_db>Notes</note_db>
 -->
</config>

 

... but unfortunately it does not, due to a bug in libwbxml 0.9.2, instead getting:



gummay # msynctool --sync e51
Synchronizing group "E51"
The previous synchronization was unclean. Slow-syncing
event sink of member 1 of type file-sync just connected
contact sink of member 1 of type file-sync just connected
Main sink of member 1 of type file-sync just connected
event sink of member 2 of type syncml-obex-client just connected
contact sink of member 2 of type syncml-obex-client just connected
Main sink of member 2 of type syncml-obex-client just connected
All clients connected or error
Main sink of member 2 of type syncml-obex-client just sent all changes
event sink of member 1 of type file-sync just sent all changes
contact sink of member 1 of type file-sync just sent all changes
Main sink of member 1 of type file-sync just sent all changes
contact sink of member 2 of type syncml-obex-client had an error: Forbidden (0x43)
event sink of member 2 of type syncml-obex-client had an error: Forbidden (0x43)

The sync failed: At least one object engine failed while getting changes. Aborting
event sink of member 1 of type file-sync just disconnected
contact sink of member 1 of type file-sync just disconnected
Main sink of member 1 of type file-sync just disconnected
event sink of member 2 of type syncml-obex-client just disconnected
contact sink of member 2 of type syncml-obex-client just disconnected

Apparently the workaround for this is to sync once using Nokia PC Suite. Conveniently I have a windows machine and can do this - others are not so lucky!

 

After the sync, things were finally working:

gummay # syncml-obex-client -u 0  --sync text/v-card Contacts --wbxml --identifier "PC Suite"
connection with device succeeded
Received an Alert for the DS Server at Contacts: Type: 200, Last 20081018T060423Z, Next 20081018T060638Z
Just received a new session with ID 1
Going to request the devinf
Session 1 reported final. flushing
Received an reply to our Alert
Going to receive 3 changes
Received the DevInf
Session 1 reported final. flushing
Received a added entry 2 of size 120 and type text/x-vcard
                Data: BEGIN:VCARD
VERSION:2.1
REV:20081018T060601Z
N:XXXXXXXXXX;;;;
TEL;CELL:+61421XXXXXXX
X-CLASS:private
END:VCARD

Received a added entry 3 of size 120 and type text/x-vcard
                Data: BEGIN:VCARD
VERSION:2.1
REV:20081018T060631Z
N:XXXXXXXXXX;;;;
TEL;CELL:+6143XXXXXXX
X-CLASS:private
END:VCARD

Received a deleted entry 1 of size 0 and type (null)
                Data: (null)
Received an reply to our Sync: 200
Session 1 reported final. flushing
Session 1 has ended

It seems that the sync will not update anything that hasn't changed since the last sync - regardless of which application is doing the request. Maybe a different identifier in place of 'PC Suite' could change this?

 

While the low-level 'syncml-obex-client' works, msynctool still does not work. In any case, I have enough to go on now to work on my end goal: synchronising my existing address book to the phone!

No Comments


  Octopus != Jellyfish

10:56pm, Sunday 12th October 2008 [gummAY]

Call me crazy - I am addicted to this Jonathan Coulton song - Octopus:

I still remember the words you said
They were hard enough to leave a mark
And now they echo inside my head
As I spiral down into the dark
I windmill upside down
Knowing you’ll come at me again
And I feel your shadow pass above me

Octopus
Some kind of octopus
Tearing my shell apart
Letting the sea get in
You make my insides outside

*snip*

For the geeks out there, you might know Jonathan Coulton better from his work on the Portal soundtrack - Still Alive.

No Comments


  Running down the way up.

10:22pm, Wednesday 24th September 2008 [gummAY]

Conscious light gets through somehow.
Yet I always fail to notice
Yet I always fail to notice
That I'm still heading for the ground.

From conditioned red
To condition red
Heading for the ground.
(then amber flashes)
From conditioned red
To condition red
Yet I always fail to notice,
I'm always heading for the ground.

Running down the way up.

The visible effect
Runs through my blood.
As I watch the sun

No Comments


Copyright Tom Fifield 2002-2008

Lovingly Handcoded in PHP, SQL and CSS