Sony Ericsson T630 and Linux via IrDA Italiano

Index

The informations in this document apply to Sony Ericsson T610 and T630; you can find useful links and informations for other models as well. I'm writing this paper as I've had lots of troubles in getting the phone working with Linux and finding related docs on the web; of course, now that I got it working I'm finding all the docs I'd have needed... Feel free to contact me for questions, errors, new links or software.

System configuration

Please note that green boxes apply to (some) Toshiba Satellite only.

Setting up IrDA

As a first thing disable any serial port with setserial /dev/ttySx uart none; as I've got no serial ports on this laptop I'm not too sure if you have to disable them all, but to follow the most secure way just do it ;) This is because IrDA and serial controllers could share base addresses and thus conflict.

You will need kernel support for your IrDA controller and IrCOMM; you can find these options in the kernel configuration menu Device Drivers -> Networking support -> IrDA (infrared) subsystem support. If you don't know your controller chip you can find it with findchip -v (included in IrDA-utils).

If you have a SMC chip, you need some software to enable it, as the BIOS doesn't. You can find it at http://www.janerob.com/rob/ts5100/irda.html or http://libxg.free.fr/irda/lib-irda.html. The program is to be launched every time you modprobe the smc module. See below about modules configuration.

Now you can load the modules and set up IrCOMM connection:

modprobe smsc-ircc2
modprobe ircomm-tty
irattach irda0 -s

Use your module instead of smsc-ircc2.

Now you should see an irda0 interface via ifconfig and ircomm# devices in /dev.

irda0     Link encap:IrLAP  HWaddr 30:3a:30:38  
          UP RUNNING NOARP  MTU:2048  Metric:1
          RX packets:0 errors:238 dropped:238 overruns:0 frame:0
          TX packets:240 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:8 
          RX bytes:0 (0.0 b)  TX bytes:7446 (7.2 KiB)
          Interrupt:3 Base address:0x130 

Try to see if it works with irdadump, which will sniff any packet on the interface. You should read some lines regarding your computer informing other devices about its presence

01:21:33.405394 xid:cmd 2ce874b7 > ffffffff S=6 s=0 (14) 
01:21:33.495375 xid:cmd 2ce874b7 > ffffffff S=6 s=1 (14) 
01:21:33.585363 xid:cmd 2ce874b7 > ffffffff S=6 s=2 (14) 
01:21:33.675348 xid:cmd 2ce874b7 > ffffffff S=6 s=3 (14) 
01:21:33.765337 xid:cmd 2ce874b7 > ffffffff S=6 s=4 (14) 
01:21:33.855319 xid:cmd 2ce874b7 > ffffffff S=6 s=5 (14) 
01:21:33.945309 xid:cmd 2ce874b7 > ffffffff S=6 s=* flyback hint=0400 [ Computer ] (23) 

When you'll activate your phone IrDA you should notice also its packets, like

06:41:42.185505 xid:rsp 62f9eab1 < 4b51d3a2 S=6 s=0 T630-T628 hint=9124 [ PnP Modem IrCOMM IrOBEX ] (26) 

Now the last step. Because of a bug in T630 (and T610 too) you have to echo 1 > /proc/sys/net/irda/max_tx_window to reduce the transmit window. Some people suggest to modify max_baud_rate to 115200 and max_tx_data_size to 2000, but it seems I don't need them.

It should work now! Go to the last section and try some software to check if all is OK, then proceed to the last configuration step, storing your setting.

Storing your settings

Of course you should repeat the steps above every time you reboot your system, and this isn't what you want. You can automate the procedure on a Debian system proceeding as follows (it could vary a little on other distributions).

At first configure the modules. Open /etc/modprobe.d/irda with your favourite text editor and add the lines

alias irda0 smsc-ircc2
install smsc-ircc2 /sbin/modprobe --ignore-install smsc-ircc2; \
/sbin/modprobe ircomm-tty; echo 1 > /proc/sys/net/irda/max_tx_window

using the name of your module instead of smsc-ircc2.

You should modify the second line in
install smsc-ircc2 /usr/local/sbin/smcinit; /sbin/modprobe --ignore-install smsc-ircc2;\
/sbin/modprobe ircomm-tty; echo 1 > /proc/sys/net/irda/max_tx_window
as you want to automatically load the chip initializer before inserting the module. Don't forget to use the right path for your system!

Finally, configure irda-utils. In Debian, dpkg-reconfigure irda-utils: use simple irda0 as the serial device (not /dev/irda0), enable discovery mode, choose if you'd like to start it at boot time or not. Personally, I prefer not to activate it to save battery: I lauch it with irattach irda0 that loads our aliased module and IrCOMM and sets up the other stuff.

The software

With this programs you can:

UPDATE: I recently discovered that you can browse the phone's filesystem, or at least some parts of it. For details see just below in the obexftp section.

Generic programs

There are many programs for phones that support AT commands and OBEX standard.

OpenOBEX tools
The Debian package is openobex-apps.
You will find:
irxfer
use irxfer filename to upload a file, or irxfer to listen for incoming transfers
obex_test
interactive shell. Use c to connect to the phone, g filename to get a file (stored in /tmp), p filename to put a file, d to disconnect, q to quit. There are other commands but I seldom don't use them. Just try other letters ;)
obex_tcp, irobex_palm3
never tried them
You can try also ircp (Debian ircp package) to send and receive files.

UPDATE obexftp now works! (partially)
Here are the facts.
  • obexftp -i -l will list the content of the phone's root directory. It contains subdirs for images, melodies and themes:
    ale@flyback~ obexftp -i -l
    No custom transport
    Connecting...done
    Receiving (null)... <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">
    <!--
    Generated by XML Coder.
    xml_coder.c (Nov 26 2003 15:17:42)
    (C) 2001 Sony Ericsson Mobile Communications AB, Lund, Sweden
    -->
    <folder-listing version="1.0"><folder name="Immagini"/>
    <folder name="Suoni"/>
    <folder name="Motivi"/>
    </folder-listing>
    done
    Disconnecting...done
    
  • obexftp -i -c / -l <dir> will list the content of a phone's directory:
    ale@flyback~ obexftp -i -c / -l Immagini
    No custom transport
    Connecting...done
    Sending /... Sending ... failed: 
    Receiving Immagini...\<?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE folder-listing SYSTEM "obex-folder-listing.dtd">
    <!--
    Generated by XML Coder.
    xml_coder.c (Nov 26 2003 15:17:42)
    (C) 2001 Sony Ericsson Mobile Communications AB, Lund, Sweden
    -->
    <folder-listing version="1.0"><parent-folder/>
    <file name="Immagine(1).jpg" size="41859"/>
    <file name="Mauri.jpg" size="1938"/>
    <file name="Michele.jpg" size="2223"/>
    <file name="Mattia.jpg" size="2595"/>
    <file name="Alberto.jpg" size="3019"/>
    <file name="Cuore anim.gif" size="25785"/>
    <file name="For you.gif" size="3887"/>
    <file name="Beer.wbmp" size="134"/>
    <file name="Bomb.wbmp" size="134"/>
    <file name="Cup.wbmp" size="134"/>
    <file name="Drink.wbmp" size="134"/>
    <file name="Guitar.wbmp" size="134"/>
    <file name="Heart.wbmp" size="134"/>
    <file name="Meal.wbmp" size="134"/>
    </folder-listing>
    done
    Disconnecting...done
    
  • And now the problems: it seems that obexftp can download (and maybe upload, I haven't tested it yet) the files listed in the misc section, but it's just useless with the user files such as images, melodies and themes. However, you still can upload them, without specifying the target directory (in other words, it seems that the phone really wants to detect the file type from the extension, and then put it in the appropriate directory by its own). Three examples:
    ale@flyback~ obexftp -i -g telecom/pb.vcl
    No custom transport
    Connecting...done
    Receiving telecom/pb.vcl...\done
    Disconnecting...done
    
    ale@flyback~ obexftp -i -g Immagini/Mattia.jpg
    No custom transport
    Connecting...done
    Receiving Immagini/Mattia.jpg... failed: Immagini/Mattia.jpg
    Disconnecting...done
    
    ale@flyback~ obexftp -i -p Immagine\ 91.jpg 
    No custom transport
    Connecting...done
    Sending Immagine 91.jpg.../done
    Disconnecting...done
    
  • To summarize: obexftp seems to be useful to upload files (you can upload multiple files with it) and to check wich user files are on the phone, but it isn't a major tool, definitely.
GSMlib
The Debian package is gsm-utils.
You will find some tools to get phone info, manage and send SMSs, manage the phonebook. The latter doesn't work very well for me, is really slow (6-7 minutes to get all contacts). If you don't have this problem please let me know.
MultiSync
The Debian package is multisync, plug-ins available in libmultisync-plugin-*.
A marvellous program to sync data. You can choose two plug-ins, one for each end of the connection. I suggest IrMc Mobile plugin which will connect to the phone, and at the other end one of Ximian Evolution plugin or Backup plugin. They will synchronize phonebook and calendar.
btcid
Unofficial Debian packages at http://0x63.nu/deb/
This is a nice program that shows an OSD (on screen display) with the caller number and name. Is can also launch a command on incoming or outgoing calls.

I have to mention also gnokii and gammu with the respective GUIS xgnokii and wammu. Unfortunately they don't work very well for me (gammu can't do almost anything yet).

Specific Sony Ericsson programs

There are some program for Sony Ericsson models, such as T68i, T300, T610 and T630. They don't add specific features but can be useful anyway.
leif
There are unofficial Debian packages at http://debian.severin.olloz.net/.
With leif you can check battery charge and signal quality, manage both SIM and internal phonebook and make the phone dial a number, manage and send SMSs, upload files.
tsemgr
No Debian package available.
Similar features as leif, can also make your phone a remote to control some programs (xmms...)
Myericsson
No Debian package available.
I haven't tried it yet. Written for Ericsson T39, maybe it's somewhat compatible.
MyT68
No Debian package available.
A tool to create T68i themes. Maybe they're compatible, I haven't tried it yet.
Remote control
No Debian package available.
A tool to use your phone as a remote. Never tried. Maybe it works only via Bluetooth.
K68
No Debian package available.
Another manager for T68i, T610, T630. Early development stage, only sends files and gets phone info.

GPRS connection

Your phone will behave just like a normal modem, so you can use any connection tool (eg wvdial, pppconfig...). You need of course a GPRS enabled SIM, and some data from your operator: the APN (Access Point Name) or an initialization string containing it, and if your network requires them also a username, a password, an IP and a DNS address.

Once you've collected these data you have to set an account on your phone, in the Connectivity section (you can find the procedure on the manual). Remember the CID (Connection ID) of the connection, as you will need it for the chat script. You are now ready to set your dialer: I will propose an example based on pppconfig and Wind (an Italian operator).

/etc/chatscripts/gprs
# Abort strings
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE'
ABORT 'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED

# Modem init
'' ATZ

# Selection of the PDP Context (eg here you choose which of the data connections
# set on the phone you want to use). The parameters are CID, protocol (IP or PPP), 
# APN. If your provider gives you a string, use that one (with the right CID).
'' 'AT+CGDCONT=3,"IP","internet.wind",,0,0'

# QoS requirements: requested and minimum acceptable
'' 'AT+CGQREQ=1,0,0,0,0,0'
'' 'AT+CGQMIN=1,0,0,0,0,0'

# "Dial string". 3 is the CID.
'' 'ATD*99***3#'

CONNECT \d\c
/etc/ppp/peers/gprs
# Almost self-explainatory. Details on pppd manpage.
# Note that I don't need username and password.

hide-password 
noauth
connect "/usr/sbin/chat -v -f /etc/chatscripts/gprs"
debug
/dev/ircomm0
115200
defaultroute
noipdefault 
remotename gprs
ipparam gprs
usepeerdns
/dev/ircomm0

# Prevent dial line checking via lcp packages, as it
# doesn't work with T630 and causes it to disconnect
lcp-echo-interval 0
lcp-echo-failure 0
Now you can just pon gprs and it should work.

Misc

Here are some known T630 internal files (from obexftp docs).

FilenameContentMethods
telecom/devinfo.txtInformation hardwareGET
telecom/rtc.txtThe Real Time ClockGET/PUT
telecom/pb.vcfLevel 2 access (AccessGET/PUT
telecom/pb/luid/.vcfAdd new entryPUT
telecom/pb/0.vcfOwn business cardGET/PUT
telecom/pb/###.vcfLevel 3 static index accessGET/P UT
telecom/pb/luid/*.vcfLevel 4 unique index accessGE T/PUT
telecom/pb/info.logSupported properties and memory infoGET
telecom/pb/luid/###.logChange logGET
telecom/pb/luid/cc.logChange counterGET
telecom/cal.vcsCalendar Level 2 accessGET/PUT
telecom/cal/luid/.vcsAdd new entryPUT
telecom/cal/###.vcsLevel 3 static index accessGET/ PUT
Telecom/cal/luid/*.vcsLevel 4 unique index accessG ET/PUT
Telecom/cal/info.logSupported properties and memory info GET
Telecom/cal/luid/###.logChange logGET
Telecom/cal/luid/cc.logChange counterGET

And the list of available phonebook and SMS stores (from gsmpb manpage and direct AT interrogation):

CodeMeaningPhonebook/SMS
MEPhone internal storePB and SMS
SMSIM internal storePB and SMS
DCOutgoing callsPB
MCLost callsPB
RCReceived callsPB
LDSIM last callsPB
FDUnknown?
MVUnknown?
HPUnknown?
BCUnknown?

Useful links

Here are some links I found useful. I'd like to thank expecially Emanuele Aina, whose page let me discover the IrDA bug ;)


Alessandro Dalvit, last changed fri 2004/08/13 Valid HTML 4.01! Valid CSS! TuxMobil - Linux on Laptops, Notebooks, PDAs and Mobile Phones