How to connect an SPV C500 smartphone to a Linux box


SynCE project

Revisions of this document: from April, 2006 to May 28, 2006.

Its official website is on Sourceforce.

If you encounter problems using specific functions of SynCE and its website does not help, you can look at my SynCE patches.

Why this howto? Because this smartphone is not recognized as a mass storage under Linux, so it needs special configuration and special software to work:

  • copy files from and to the smartphone
  • synchronize calendar, contacts and tasks
  • use the smartphone as a modem

Description of the Debian box

The Linux kernel I use is a 2.6.14 one. I have given instruction on how to install Debian on my computer.

I use SynCE to synchronize Evolution Calendars and Evolution Contacts with the calendars and contacts of my smartphone.

I have installed Evolution and all its dependencies. My favorite window manager is WindowMaker, and yes, with the dependencies of Evolution, I have had to install half of the common libraries of Gnome. Pitty my smartphone cannot synchronize with a software less dependent from the window manager 🙁

Description of the smartphone

The smartphone is a French Orange SPV C500 smartphone. This model is also known as a Qtek 8010.

Be careful! « Orange » is the name of my mobile phone network provider, but in this case it is also the brand of the smartphone!

Smartphone analysis

The smartphone will be connected to the computer with an USB cable, not by Infrared. This is less smart or less flashy but has advantages:

  1. my computer has no IrDA port, other computers may not have one
  2. the smartphone battery can be recharged by USB

USB details (cat /proc/bus/usb/devices):

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12  MxCh= 0
D:  Ver= 1.00 Cls=ff(vend.) Sub=ff Prot=ff MxPS=64 #Cfgs=  3
P:  Vendor=0bb4 ProdID=0a51 Rev= 0.00
C:* #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=500mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=ipaq
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
C:  #Ifs= 1 Cfg#= 2 Atr=80 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
C:  #Ifs= 1 Cfg#= 3 Atr=c0 MxPwr=  2mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms

Kernel configuration

You will need some modules to connect your computer to the smartphone:

  • CONFIG_PPP_ASYNC (« PPP support for async serial ports »)
  • CONFIG_USB_SERIAL_IPAQ (« USB Pocket PC PDA Driver »)
  • their dependencies of course, and maybe generic iptables support so that PPP will not print out lots of warnings

Userland configuration

You need to install the SynCE software and libraries. I have installed these ones:

  • libsynce0
  • libsynce0-dev
  • librapi2
  • librapi2-dev
  • librapi2-tools
  • librra0
  • synce-dccm
  • synce-serial
  • multisync
  • synce-multisync-plugin
  • libmultisync-plugin-evolution

The SynCE libraries are in version 0.9.1. Multisync is version 0.82-5.2.

Connection

The order for the actions is very important.

  1. load the kernel modules
  2. run dccm as a normal Linux user
  3. plug the smartphone to the USB socket, sample syslog:
    May 20 15:53:24 tethys kernel: usb 1-1: new full speed USB device using uhci_hcd and address 3
    May 20 15:53:25 tethys usb.agent[5129]: Keeping default configuration with /sys//devices/pci0000:00/0000:00:1d.0/usb1/1-1
    May 20 15:53:25 tethys kernel: usb 1-1: configuration #1 chosen from 3 choices
    May 20 15:53:25 tethys kernel: usbcore: registered new driver usbserial
    May 20 15:53:25 tethys kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic
    May 20 15:53:25 tethys kernel: usbcore: registered new driver usbserial_generic
    May 20 15:53:25 tethys kernel: drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0
    May 20 15:53:25 tethys kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for PocketPC PDA
    May 20 15:53:25 tethys kernel: drivers/usb/serial/ipaq.c: USB PocketPC PDA driver v0.5
    May 20 15:53:25 tethys kernel: ipaq 1-1:1.0: PocketPC PDA converter detected
    May 20 15:53:25 tethys kernel: usb 1-1: PocketPC PDA converter now attached to ttyUSB0
    May 20 15:53:25 tethys kernel: usbcore: registered new driver ipaq
    May 20 15:53:25 tethys usb.agent[5134]:      ipaq: loaded successfully
    
  4. as the root user:
    1. run synce-serial-config (if it is the first time you connect the computer and the smartphone together), sample log trace:
      tethys:~# synce-serial-config ttyUSB0 192.168.131.102:192.168.131.201 192.168.10.1
      0:192.168.131.102:192.168.131.201
      
      You can now run synce-serial-start to start a serial connection.
      
      tethys:~# cat /etc/ppp/peers/synce-device 
      # Modifications to this file will be lost next time you run synce-serial-config
      /dev/ttyUSB0 115200
      connect '/usr/bin/synce-serial-chat'
      nodefaultroute
      noauth
      local
      192.168.131.102:192.168.131.201
      ms-dns 192.168.10.1
      crtscts
      linkname synce-device
      
    2. run synce-serial-start (in all cases), sample syslog:
      May 20 15:54:05 tethys kernel: PPP generic driver version 2.4.2
      May 20 15:54:05 tethys synce-serial-start: Executing '/usr/sbin/pppd call synce-device'
      May 20 15:54:05 tethys pppd[5260]: pppd 2.4.4b1 started by root, uid 0
      May 20 15:54:06 tethys pppd[5260]: Serial connection established.
      May 20 15:54:06 tethys pppd[5260]: Using interface ppp0
      May 20 15:54:06 tethys pppd[5260]: Connect: ppp0 <--> /dev/ttyUSB0
      May 20 15:54:07 tethys kernel: PPP BSD Compression module registered
      May 20 15:54:07 tethys kernel: PPP Deflate Compression module registered
      May 20 15:54:07 tethys pppd[5260]: local  IP address 192.168.131.102
      May 20 15:54:07 tethys pppd[5260]: remote IP address 192.168.131.201
      May 20 15:54:07 tethys postfix/master[4124]: reload configuration /etc/postfix
      May 20 15:54:08 tethys dccm[4481]: Connection from 192.168.131.201 accepted
      May 20 15:54:08 tethys dccm[4481]: Talking to 'SPV_C500', a SmartPhone device of type HTC
      

Disconnection

The order for the actions is very important.

  1. unplug the smartphone
  2. as the root user, run synce-serial-abort to clean all remaining things in case the serial connection has failed to shutdown itself
  3. unload kernel modules (not mandatory)

Further userland configuration

Please install the hotplug package and create the following script as /etc/hotplug/usb/ipaq:

#!/bin/bash

export time=`date +"%b %d %X"`
export uname=`uname -n`

echo "$time $uname $0: iPAQ added" >> /var/log/synce
/usr/bin/synce-serial-abort >> /dev/null
/usr/bin/synce-serial-start >> /var/log/synce

:> $REMOVER
echo "export time=\`date +\"%b %d %X\"\`" >> $REMOVER
echo "export uname=\`uname -n\`" >> $REMOVER
echo "echo \"\$time \$uname $0: iPAQ removed\" >> /var/log/synce" >> $REMOVER
echo "sleep 15 >> /var/log/synce" >> $REMOVER
echo "/usr/bin/synce-serial-abort >> /var/log/synce" >> $REMOVER
chmod +x $REMOVER

With this script and CONFIG_KMOD (« Automatic kernel module loading ») you will be able to avoid the steps 1 and 4 from above « connection » and step 2 from above « disconnection ».

If you configure your favorite window manager to automatically run dccm when starting, you will be able to avoid the step 2 from above « connection ».

Testing the connection

Run synce-pstatus 3 to 5 seconds after having plugged the smartphone. The result may look at this trace:

Version
=======
Version:    4.21.1088 (Microsoft Windows Mobile 2003 Pocket PC Phone Edition)
Platform:   3 (Windows CE)
Details:    ""

System
======
Processor architecture: 5 (ARM)
Processor type:         2577 (StrongARM)
Page size:              0x10000

Power
=====
ACLineStatus: 00 (Offline)

Status for main battery
=========================
Flag:          8 (Charging)
LifePercent:   99%
LifeTime:      Unknown
FullLifeTime:  Unknown

Status for backup battery
=========================
Flag:          1 (High)
LifePercent:   Unknown
LifeTime:      Unknown
FullLifeTime:  Unknown

Store
=====
Store size: 29341696 bytes (27 megabytes)
Free space: 17965056 bytes (17 megabytes)

Memory for storage: 1572864 bytes (1 megabytes)
Memory for RAM:     22671360 bytes (21 megabytes)

If you get the message Unable to initialize RAPI: An unspecified failure has occurred, this may be a crash of the Winsock2 layer on the smartphone ; system logs such as

pppd[4585]: LCP terminated by peer
pppd[4585]: Connection terminated.
pppd[4585]: Connect time 0.1 minutes.

should confirm the diagnostic. In this case, reboot the smartphone (do not forget to unplug it!) and it will be OK next time.

You are now able to copy files from and to the smartphone, using the SynCE specific tools (read the man pages, I will not explain here who to use them). You are also able to synchronize the calendar, contacts and tasks from and to the smartphone. I personally use Evolution for calendars and contacts, so I installed the multisync plugins for SynCE and Evolution, and of course the multisync software.

How to use the smartphone as a modem

Smartphone analysis

On the smartphone, go to the « Modem link » menu, select the « USB » connection (not the IrCOMM), click on « Menu->Activate ».

USB details (cat /proc/bus/usb/devices):

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 1.00 Cls=02(comm.) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0bb4 ProdID=00cf Rev= 0.90
C:* #Ifs= 1 Cfg#= 1 Atr=c0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=02(comm.) Sub=ff Prot=ff Driver=(none)
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=86(I) Atr=03(Int.) MxPS=  16 Ivl=80ms

Kernel configuration

You will need the CONFIG_PPP_SYNC_TTY (« PPP support for sync tty ports ») module and dependencies.

Userland configuration

You should create two files: /etc/ppp/peers/spv-modem and /etc/ppp/peers/spv-connect-chat (this one is for the persons that use Orange as a mobile phone network provider, please adapt it for your own provider).

spv-modem:

connect '/usr/sbin/chat -vf /etc/ppp/peers/spv-connect-chat'

/dev/ttyUSB0
-detach
debug
idle 900

nopcomp
noaccomp
nobsdcomp
nodeflate
noccp
novj
usepeerdns
defaultroute
ipcp-accept-local

noauth

spv-connect-chat:

"" AT
OK AT&F
OK 'AT+cgdcont=1,"IP","orange.fr","",0,0'
OK ATDT*99#
CONNECT ""

Connection

The order for the actions is not very important.

  1. unload the usbserial module if loaded
  2. look at the /proc/bus/usb/devices and find the line Vendor=0bb4 ProdID=00cf Rev= 0.90 as shown in the previous screenshot
  3. insert the usbserial module with the parameters taken above: modprobe usbserial vendor=0x0bb4 product=0x00cf
  4. activate the modem connection on the smartphone as detailed in a previous section
  5. plug the smartphone to the USB cable

Your syslog should tell something like this:

May 20 18:27:04 tethys kernel: usb 1-1: new full speed USB device using uhci_hcd and address 9
May 20 18:27:10 tethys kernel: usbcore: registered new driver usbserial
May 20 18:27:10 tethys kernel: drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic
May 20 18:27:10 tethys kernel: usbserial_generic 1-1:1.0: Generic converter detected
May 20 18:27:10 tethys kernel: usb 1-1: Generic converter now attached to ttyUSB0
May 20 18:27:10 tethys kernel: usbcore: registered new driver usbserial_generic
May 20 18:27:10 tethys kernel: drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0

As the root user, or better with sudo, start the modem connection. Sample traces and syslog:

jc@tethys:~$ sudo pppd call spv-modem
Serial connection established.
using channel 4
Using interface ppp0
Connect: ppp0 <--> /dev/ttyUSB0
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0x87cfc35a>]
rcvd [LCP ConfRej id=0x1 <magic 0x87cfc35a>]
sent [LCP ConfReq id=0x2 <asyncmap 0x0>]
rcvd [LCP ConfAck id=0x2 <asyncmap 0x0>]
rcvd [LCP ConfReq id=0x6 <asyncmap 0x0> <auth chap MD5> <pcomp> <accomp>]
sent [LCP ConfRej id=0x6 <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x7 <asyncmap 0x0> <auth chap MD5>]
sent [LCP ConfNak id=0x7 <auth pap>]
rcvd [LCP ConfReq id=0x8 <asyncmap 0x0> <auth pap>]
sent [LCP ConfAck id=0x8 <asyncmap 0x0> <auth pap>]
sent [PAP AuthReq id=0x1 user="tethys" password=<hidden>]
rcvd [PAP AuthAck id=0x1 ""]
PAP authentication succeeded
sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
rcvd [IPCP ConfReq id=0x3 <addr 212.234.96.26>]
sent [IPCP ConfAck id=0x3 <addr 212.234.96.26>]
rcvd [IPCP ConfNak id=0x1 <addr 10.15.157.96> <ms-dns1 194.51.3.56> <ms-dns3 194.51.3.76>]
sent [IPCP ConfReq id=0x2 <addr 10.15.157.96> <ms-dns1 194.51.3.56> <ms-dns3 194.51.3.76>]
rcvd [IPCP ConfAck id=0x2 <addr 10.15.157.96> <ms-dns1 194.51.3.56> <ms-dns3 194.51.3.76>]
not replacing existing default route via 192.168.10.254
local  IP address 10.15.157.96
remote IP address 212.234.96.26
primary   DNS address 194.51.3.56
secondary DNS address 194.51.3.76
Script /etc/ppp/ip-up started (pid 6816)
May 20 18:28:05 tethys pppd[6578]: pppd 2.4.4b1 started by jc, uid 0
May 20 18:28:06 tethys chat[6583]: send (AT^M)
May 20 18:28:06 tethys chat[6583]: expect (OK)
May 20 18:28:06 tethys chat[6583]: AT^M^M
May 20 18:28:06 tethys chat[6583]: OK
May 20 18:28:06 tethys chat[6583]:  -- got it
May 20 18:28:06 tethys chat[6583]: send (AT&F^M)
May 20 18:28:06 tethys chat[6583]: expect (OK)
May 20 18:28:06 tethys chat[6583]: ^M
May 20 18:28:06 tethys chat[6583]: AT&F^M^M
May 20 18:28:06 tethys chat[6583]: OK
May 20 18:28:06 tethys chat[6583]:  -- got it
May 20 18:28:06 tethys chat[6583]: send (AT+cgdcont=1,"IP","orange.fr","",0,0^M)
May 20 18:28:07 tethys chat[6583]: expect (OK)
May 20 18:28:07 tethys chat[6583]: ^M
May 20 18:28:07 tethys chat[6583]: AT+cgdcont=1,"IP","orange.fr","",0,0^M^M
May 20 18:28:07 tethys chat[6583]: OK
May 20 18:28:07 tethys chat[6583]:  -- got it
May 20 18:28:07 tethys chat[6583]: send (ATDT*99#^M)
May 20 18:28:07 tethys chat[6583]: expect (CONNECT)
May 20 18:28:07 tethys chat[6583]: ^M
May 20 18:28:08 tethys chat[6583]: ATDT*99#^M^M
May 20 18:28:08 tethys chat[6583]: CONNECT
May 20 18:28:08 tethys chat[6583]:  -- got it
May 20 18:28:08 tethys chat[6583]: send (^M)
May 20 18:28:08 tethys pppd[6578]: Serial connection established.
May 20 18:28:08 tethys pppd[6578]: using channel 3
May 20 18:28:08 tethys pppd[6578]: Using interface ppp0
May 20 18:28:08 tethys pppd[6578]: Connect: ppp0 <--> /dev/ttyUSB0
May 20 18:28:09 tethys pppd[6578]: sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xe697931>]
May 20 18:28:09 tethys pppd[6578]: rcvd [LCP ConfRej id=0x1 <magic 0xe697931>]
May 20 18:28:09 tethys pppd[6578]: sent [LCP ConfReq id=0x2 <asyncmap 0x0>]
May 20 18:28:09 tethys pppd[6578]: rcvd [LCP ConfAck id=0x2 <asyncmap 0x0>]
May 20 18:28:10 tethys pppd[6578]: rcvd [LCP ConfReq id=0x2 <asyncmap 0x0> <auth chap MD5> <pcomp> <accomp>]
May 20 18:28:10 tethys pppd[6578]: sent [LCP ConfRej id=0x2 <pcomp> <accomp>]
May 20 18:28:10 tethys pppd[6578]: rcvd [LCP ConfReq id=0x3 <asyncmap 0x0> <auth chap MD5>]
May 20 18:28:10 tethys pppd[6578]: sent [LCP ConfNak id=0x3 <auth pap>]
May 20 18:28:10 tethys pppd[6578]: rcvd [LCP ConfReq id=0x4 <asyncmap 0x0> <auth pap>]
May 20 18:28:10 tethys pppd[6578]: sent [LCP ConfAck id=0x4 <asyncmap 0x0> <auth pap>]
May 20 18:28:10 tethys pppd[6578]: sent [PAP AuthReq id=0x1 user="tethys" password=<hidden>]
May 20 18:28:10 tethys pppd[6578]: rcvd [PAP AuthAck id=0x1 ""]
May 20 18:28:10 tethys pppd[6578]: PAP authentication succeeded
May 20 18:28:10 tethys pppd[6578]: sent [IPCP ConfReq id=0x1 <addr 0.0.0.0> <ms-dns1 0.0.0.0> <ms-dns3 0.0.0.0>]
May 20 18:28:12 tethys pppd[6578]: rcvd [IPCP ConfReq id=0x1 <addr 212.234.96.90>]
May 20 18:28:12 tethys pppd[6578]: sent [IPCP ConfAck id=0x1 <addr 212.234.96.90>]
May 20 18:28:12 tethys pppd[6578]: rcvd [IPCP ConfNak id=0x1 <addr 10.16.139.201> <ms-dns1 194.51.3.56> <ms-dns3 194.51.3.76>]
May 20 18:28:12 tethys pppd[6578]: sent [IPCP ConfReq id=0x2 <addr 10.16.139.201> <ms-dns1 194.51.3.56> <ms-dns3 194.51.3.76>]
May 20 18:28:12 tethys pppd[6578]: rcvd [IPCP ConfAck id=0x2 <addr 10.16.139.201> <ms-dns1 194.51.3.56> <ms-dns3 194.51.3.76>]
May 20 18:28:12 tethys pppd[6578]: not replacing existing default route via 192.168.10.254
May 20 18:28:12 tethys pppd[6578]: local  IP address 10.16.139.201
May 20 18:28:12 tethys pppd[6578]: remote IP address 212.234.96.90
May 20 18:28:12 tethys pppd[6578]: primary   DNS address 194.51.3.56
May 20 18:28:12 tethys pppd[6578]: secondary DNS address 194.51.3.76
May 20 18:28:12 tethys pppd[6578]: Script /etc/ppp/ip-up started (pid 6591)
May 20 18:28:12 tethys postfix/master[4124]: reload configuration /etc/postfix
May 20 18:28:12 tethys pppd[6578]: Script /etc/ppp/ip-up finished (pid 6591), status = 0x0

Warning! When you are connected on Internet using this method, you are not connected directly but you go through some transparent proxies or something similar. So not all ports are opened! I have found someone on Internet who identified that Orange (my network provider) uses a whitelist system to open ports…

Global userland configuration (again)

You should create a /etc/modprobe.d/usbserial file:

options usbserial vendor=0x0bb4 product=0x00cf

So as you would not have to make a brainstorm whenever you want to connect your SPV as a modem or as a smartphone: this will automatically append the right options to this module, and these options seem not to interfere if the smartphone is not connected as a modem, or with other modules that depend on the usbserial (I have tested it with the ftdi_sio, which is my USB to serial DB9 adapter).


Laissez un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *