Search This Blog

Friday, January 21, 2011

Samsung i8910 cellphone and Linux

Synchronizing contacts in the command line

  • Install program syncml-ds-tool. In my case it comes in the libsyncml-0.5.2 ebuild (package in Gentoo's jargon).
  • Create an empty directory called contacts.
  • Connect the i8910 to the USB port in "PC Suite" mode.
  • Execute the script below:

    syncml-ds-tool -u 0 --identifier 'PC Suite' --version 1.1 --wbxml \
    --username '' --password '' --useStringTable --remoteWinsConflicts \
    --slow-sync text/x-vcard Contacts $(pwd)/contacts/

One file per contact will be created in the contacts directory. They are in vCard 2.1 format, you can edit them with your prefered text editor. To upload the changes to the phone:

  • Delete all contacts from you phone (yes, that is right). To delete them go to Contacts -> Options -> Mark/Unmark -> Mark all, then Options -> Delete.
  • Execute the same script above.

One alternative to deleting all phone's contacts is removing the "--remoteWinsConflicts" option and executing the script above. I prefer to use the first method because sometimes removing "--remoteWinsConflicts" makes contacts appear twice in the phone or in the contacts directory.

You can use KDE's KAddressbook to edit the contacts. When I have more time I will write how to do that.

Synchronizing contacts using KDE's Akonadi
Well, this is yet to be written since it is not officially working. There is an old version that works somewhat, but is not reliable so we have better wait.

Using the phone as bluetooth modem
If you use Linux and KDE follow the instructions in here, if not keep reading :-)

Ok, now it connects and I can surf the web, I am connected through bluetooth now. What I did:

udev/bluethood do not create the /dev/rfcommX, I had to create it and connect it manually to my phone:

#mknod --mode=666 /dev/rfcomm0 c 216 0
#rfcomm connect 0 <phone's mac address> 4

The number 0 in the rfcomm command means rfcomm0. The number 4 is the channel. To find the correct channel do:

evolucao ~ # sdptool search DUN
Inquiring ...
Searching for DUN on 00:23:D4:2E:13:B8 ...
Service Name: Dial-Up Networking
Service RecHandle: 0x1001f
Service Class ID List:
  "Dialup Networking" (0x1103)
Protocol Descriptor List:
  "L2CAP" (0x0100)
  "RFCOMM" (0x0003)
    Channel: 4
Language Base Attr List:
  code_ISO639: 0x454e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Dialup Networking" (0x1103)
    Version: 0x0100

DUN means bluetooth dial-up network.

then you can use wvdial: using /dev/rfcomm0 as Modem parameter.

It also works with KDE's Plasma NetworkManagement and ModemManager-0.4:

Using the phone as Bluetooth GPS

To do that you need:

. python and python script shell 2.0.0 signed by Nokia with full capability. Most python install files out there do not have Location capability, which rises "permission denied" errors when any python program tries to access the internal GPS. Probably this also happens with Java programs, which would affect ExtGPS. The needed files are Python_2.0.0.sis and PythonScriptShell_2.0.0_high_capas.sis. Install them on C:

. download and locationrequestor_3rd.sis. I had to add some fixes to to prevent it from crashing. The changes are simple: 1. In line 34 change "import socket" to "import btsocket as socket"; 2. In line 320 add a "if len(args) > 7:", in the following 5 lines add a tab to ident the if (Python requires that to accept the if); 3. In line 332 do the same, add "if len(args) > 13:" and ident all lines until the line with "###########"

. Install the .sis and copy to C:/Data/Python/ using X-plore for instance.

. turn Bluetooth on.

. run Python Scriptshell and from there run

. click on Options -> Accept Connections.

That is it. The bluetooth service should be available now on channel 10.

Importing GPS data into GoogleEarth
I also managed to import the data into GoogleEarth running in my Linux installation. I have not tried to do that in Windows. I used the information here, although I had to fix the python script available in that page ( because the script in the phone exports the GPS data in a different NMEA type. It is not that hard to fix it, you just need to understand the fields in the two NMEA types used by the phone ($GPGGA) and the script ($GPRMC).

To attach the phone's bluetooth NMEA service to Linux you need to execute as root:

rfcomm bind /dev/rfcomm0  00:11:22:33:44:55 10

where 00:11:22:33:44:55 is your phone's bluetooth MAC address and 10 is the channel the script got from Symbian bluetooth service (it may not be 10).

Then you need to edit the file and change the serial_port variable to /dev/rfcomm0, the field number 3 to 2 (latitude), 5 to 4 (longitude), 4 to 3 (North/South switch), and 6 to 5 (West/East switch) in the datablock variable, and change $GPRMC to $GPGGA. The $GPGGA type does not indicate speed so you can ignore this value.

Then is just run the script and import the gps.kml file available on that page into GoogleEarth. It is a bit slow but it works :-)

No comments: