After an extensive Google search, I wasn't able to locate a decent HowTo document on this topic so I decided to write one.
Why IR and not Bluetooth?
The answer is simple. k500i does NOT have Bluetooth. But I will post a k700i + Linux + Bluetooth HowTo sometime in the future. Anyway, here it goes...
Ingredients:
1 Linux box running Fedora Core 5
1 USB-IR dongle
Notes:
I would imagine any Sony Ericsson k series (k300i, k700i, etc.) mobile phone should work as well. My Linux box runs the latest version of Fedora Core but this HowTo should, likewise, be applicable to other distros. For IR connectivity, I bought a cheapo USB-IR dongle with the Prolific PL-2303 chipset.
Step 1. Download and install the following programs from your favorite Fedora Core repository:
openobex-apps
openobex
If you run a different flavor of Linux, the name of the binary files may be different from the ones above. The command for installing programs may be different as well. Just consult the appropriate documentation. With Fedora, just issue the following command:
- # yum install irda-utils openobex openobex-apps
You migh ask what are these programs for? irda-utils provides irdadump and irattach which we'll need a bit later for diagnosing our IR connection; openobex-apps provides obex_test and irxfer which are essential for file transfer; openobex is needed by openobex-apps.
Step 2. Attach the USB-IR device to your computer. In the case of laptops with built-in IR ports, obviously, you don't have to do this. So how do we know if the USB IR dongle has been detected? From a command prompt, issue the "dmesg" command without the double quotes.
From the output, you should see a line similar to this.
This simply means that your USB device has been detected and is now attached to ttyUSB0. Using the "irattach" command, we now bind the Linux-IrDA stack to an IrDA port (at least, that's what the irattach manual says).
For Fedora Core users, you may choose to do the above. You also have the option to do make use of the "service" command to do the "irattach" command for you. This, I find much more convenient. It's really up to you.
So first, you have to make sure that the /etc/sysconfig/irda entries are correct. Mine are as follows:
DEVICE=/dev/ttyUSB0
DISCOVERY=yes
Now, run the "service irda start" command. You'll see something like this:
Starting IrDA: [ OK ]
To make sure everything is in perfect order up this point, run the irdadump program. This is how the output will look like:
07:27:20.912199 xid:cmd c92b3324 > ffffffff S=6 s=0 (14)
07:27:21.000199 xid:cmd c92b3324 > ffffffff S=6 s=1 (14)
07:27:21.088195 xid:cmd c92b3324 > ffffffff S=6 s=2 (14)
07:27:21.176208 xid:cmd c92b3324 > ffffffff S=6 s=3 (14)
07:27:21.264209 xid:cmd c92b3324 > ffffffff S=6 s=4 (14)
07:27:21.352207 xid:cmd c92b3324 > ffffffff S=6 s=5 (14)
07:27:21.440212 xid:cmd c92b3324 > ffffffff S=6 s=* deathstar hint=4400 [ Computer LAN Access ] (25)
With irdadump still running, turn on the IR of your k500i mobile phone. The output of irdadump should show something like this:
07:42:26.917388 xid:cmd 33135fa0 > ffffffff S=6 s=0 (14)
07:42:27.005385 xid:cmd 33135fa0 > ffffffff S=6 s=1 (14)
07:42:27.093385 xid:cmd 33135fa0 > ffffffff S=6 s=2 (14)
07:42:27.181387 xid:rsp 33135fa0 < 00001134 S=6 s=2 K500 series hint=9124 [ PnP Modem IrCOMM IrOBEX ] (28)
Notice the line which says K500 series? This simply means, your computer can now detect the presence of your mobile phone.
Step 3. We are now ready to make a file transfer. But first, let's try to ping the mobile phone using the irdaping utility. How do we know which address to ping? cat /proc/net/irda/discovery should do the the trick. Here goes:
IrLMP: Discovery log:
nickname: K500 series, hint: 0x9124, saddr: 0x33135fa0, daddr: 0x00001134
Take note of the daddr entry. Now, (irda)ping this address.
IrDA ping (0x00001134 on irda0): 32 bytes
32 bytes from 0x00001134: irda_seq=0 time=113.95 ms.
32 bytes from 0x00001134: irda_seq=1 time=110.04 ms.
32 bytes from 0x00001134: irda_seq=2 time=108.68 ms.
32 bytes from 0x00001134: irda_seq=3 time=113.85 ms.
32 bytes from 0x00001134: irda_seq=4 time=108.24 ms.
32 bytes from 0x00001134: irda_seq=5 time=108.83 ms.
Step 4. Test the connection using the obex_test program.
Using IrDA transport
OBEX Interactive test client/server.
> c
Transport connect error! (IrDA)
The "c" command above means connect. In the case of my Sony Ericsson k500i, I got a Transport connect error! After searching via Google, I stumbled upon the URL below. This is where I got my workaround to the Transport connect error.
http://www.hpl.hp.com/personal/Jean_Tourrilhes/IrDA/IrDA.html
In the case of the k500i, you have to set the maximum baud rate to 9600.
Now, do the obex_test again. Make sure the mobile phone IR is turned on.
Using IrDA transport
OBEX Interactive test client/server.
> c
Connect OK!
Version: 0x10. Flags: 0x00
>
Voila! Connection succesful.
Step 5. Send files from your mobile phone using irxfer, an infrared transfer application program. As mentioned earlier, irxfer is one of the programs under openobex-apps.
Send files to and receive files from win95
Waiting for files
Align your mobile phone to the IR device and send a file. Here's a sample output of a successful file transfer from k500i to Linux. Note the line that says win95. =)
Send files to and receive files from win95
Waiting for files
......................................................................
HEADER_LENGTH = 70764
Filename = Picture(3).jpg
Wrote /tmp/Picture(3).jpg (70764 bytes)
Step 6.Send files from Linux PC to k500i. Again, align your phone and the IR device. Issue the irxfer command followed by the filename you want to send. It's that simple!
Send files to and receive files from win95
name=test.jpg, size=70764
......................................................................
PUT successful
To follow: You can also use obexftp to download files from you mobile phone. More on that in the coming weeks.
10 comments:
Have you had any luck with the dcu-11 data cable?
Unfortunately, I don't have a dcu-11 cable so I've never tried it . =(
how fast is the transfer through IR? Is it good enough? For e.g. How long will it take to transfer a 1mb file to the mobile?
It's good enough for very small files (i.e. 100 kb-size pictures). But for a 1 mb file, it's excruciatingly slow. Maybe I have to tweak a few more things on my Linux machine.
In fact, I downloaded a 30 minute sound recording (about 2.1 mb). It took around 25 to 30 minutes to download the whole thing.
At least IR gets the job done. I have no other choice since I don't have a cable and the phone is not equipped with Bluetooth.
Hey, i figured out to get the cable working on windows :D
Have to explore on how to get it working in linux. Do u know how to configure usb support in linux?
> Do u know how to configure usb support in linux?
Hmm ... These links might be of help:
http://kapsi.fi/~mcfrisk/linux_gprs.html
http://www.linux-usb.org/
hello ,
I connect DCU-11 cable to linux through com4(In Windows). But when i use dmesg command, i m not getting any
information about my K300i cell phone. Please help me to connect in Linux. I use RedHat 9.2
when you connect dcu11 to linux (using PARDUS 2007 a linux distro) the cable looks like
Bus 002 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
dmesg saying
usb 2-2: pl2303 converter now attached to ttyUSB0
usbcore: registered new driver pl2303
drivers/usb/serial/pl2303.c: Prolific PL2303 USB to serial adaptor driver
usb 2-2: USB disconnect, address 2
pl2303 ttyUSB0: pl2303 converter now disconnected from ttyUSB0
pl2303 2-2:1.0: device disconnected
so i think it is ttyUSB0
then? that is the point that i come last nothing more..
thanks you!
here's how i did it under ubuntu, since i don't use fedora:
aptitude install irda-utils openobex openobex-apps
mknod /dev/ttyUSB0 c 188 0
(i did not have the /dev/ device created)
/etc/init.d/irda-setup start
/etc/init.d/irda-utils start
(plug usb-irda adapter)
irxfer
(send file from mobile)
i even got a progress bar :)) (lot of dots)
thank you again! i needed to transfer recorded voice calls which under windows cannot be transferred because these call records are stored on files beginning with a forbidden character under windows (question mark)
Hi.I am using Ubuntu 6.06 and Sony Ericsson K510i.I installed irda-utils and openobex-apps to my machine.
I have successfully recieved files from my mobile phone but i cant send any file to my mobile phone.
when i use irxfer,i have received file succesfully but when i use
irxfer deneme.X(jpg,mp3,etc...)
i cant send file to mobile phone.The fallowing message is printed:
-------------------
# irxfer bennyhill_0.mp3
Send files to and receive files from win95
name=bennyhill_0.mp3, size=134524936
PUT failed: No such file or directory
PUT successful
---------------
What can i do for solve this problem ?
Thanks all.
Post a Comment