CABLE-OBEX v0.2.8
This is Cable OBEX, or Cobex for short, a small utility/library for talking to (not in, hahaha) a cellphone using OBEX over a serial cable. For a full-featured Open Source OBEX implementation, see the OpenOBEX project, http://openobex.sourceforge.net/ . I think their primary focus is IrDA and Bluetooth, and I never got it to work over a serial cable, thus this project.
Cobex has been successfully tested with the SonyEricsson phones K508i, K750i, K700i, T610, T310 and T300 using a DCU-11 USB/Serial cable. Other phones might work, PLEASE report any succes you have with it.
This project includes the four utilities, cobex_put, cobex_get, cobex_ls and cobex_rm. Also, some contributions may be in the contrib/ folder.
- Index
WORKING PHONES
REQUIREMENTS
INSTALL
USAGE
MODELDB
CONTRIB
LICENSING
HINTS
Contact
WORKING PHONES:
The following phones are known to work:
T300 Doesn't support obex get, so can't download files
T310 Doesn't support obex get, so can't download files
T610 Works fine!
K700i Works fine, when you set HI_TARGET to IRMC-SYNC.
K750i Works fine, when you set HI_TARGET to IRMC-SYNC.
K508i User reports that this one works fine too! I've never seen one myself.
- REQUIREMENTS
Full GNU toolchain, ie. GCC etc.
ezv24 from http://ezv24.sourceforge.net/
expat from http://expat.sourceforge.net/
- INSTALL
Install the required libraries . If they are not installed in the usual places, you will have to modify the Makefile. Come on, a configure script with all it's fluff would be several times larger than this entire project.
When ezV24 and expat are in place, do a simple "make" and the project should build.
Should you need to change the baudrate, you have to edit the files and recompile. It is set to 115200 in cobex_serial.h baud by default.
Cobex does handle port locking using lockfiles. Unfortunately, f.ex. Fedora Core 3 does not, at least not very well. So, therefore port locking is turned of by default. You can enable it by editing the Makefile, and removing the hashmark infront of the LOCKSERIAL definition.
- USAGE
cobex_get <device> <filename>
cobex_ls <device> <filename>
cobex_put <device> <infile> <name-on-device>
cobex_rm <device> <filename>
Note,
- For cobex_get, use redirection or pipes to get the file to disk, or where you want it.
- Since v0.2.4, cobex_get has a bit better path handling. This means that
you don't have to separate the filename into name and dir manually. It also sortof handles the
telecom subtree, that isn't a tree at all, but filenames with / in them.
- cobex_put puts a file to the Inbox, and let's the phone sort it out where it should end,
putting directly to a directory is currently not supported.
- It should be exceedingly simple to make an kio_cobex.
For fun, you could try fetching telecom/rtc.txt (the clock) and telecom/devinfo.txt (the device presents it's features).
- Example
./cobex_ls /dev/ttyUSB0 ""
will list the files in top level directory on the phone.
./cobex_get /dev/ttyUSB0 "Bilder/Sad.gif" > Sad.gif
will fetch the file Bilder/Sad.gif from the phone and save it, using redirection, to a file Sad.gif.
- MODELDB
Included is the tiny subproject modeldb. This is a tool to autodetect what's connected to a serial port. Usage is simple:
dodetect <device>
Curently, the model db in the phones.xml file holds four different phones and software revisions, PLEASE email me the responses from your phone and I will include them in the database. You need to recompile if you add a new phone.
- CONTRIB
KDE Servicemenu entry
Currently there is one contribution in contrib/ right now, and that is a KDE servicemenu
entry to be able to rightclick on any file, and send them to the phone. Install the
executable script and the cobex binaries somewhere in your path, and .dekstop file in your
user- or systemwide servicemenu folder, that is either
`kde-config --prefix`/share/apps/konqueror/servicemenus or
~/.kde/share/apps/konqueror/servicemenus . You'll figure it out.
This was contributed by Johannes Pirkl.
- LICENSING
GNU General Public License Version 2. Go fetch the license text from the usual places.
Notes about T300/T310:
The OBEX implementation in the T310 is ... well, it's not very exhaustive. It doesn't seem to support GET for example. That's right, there doesn't seem to be any way to transfer things from a phone to a computer using the serial cable. Of course, you can beam objects to a computer, using a IrDA device and OpenOBEX/ircp, but unless you have a laptop with a builtin IrDA device, the support for IrDA devices, ie. IrDA dongles, under Linux is not good.
In some cases, the implementation in the phone is not even compliant with the specification. If you try to GET an object you will get no response. None whatsoever. In fact, if you try you will lock up the OBEX server in the phone, and you will have to restart it. The phone, that is. You need to powertoggle it.
You don't need OBEX to fetch the phonebook or SMSs, or check the battery and signal status, you can do that directly with AT commands.
- HINTS
The DCU-11 cable is supported in Linux 2.4.21 using the pl2303-driver. However, the pl2303 can be modified to support the DCU-11 cable in earlier versions, at least 2.4.18 and possibly all the way back to pre 2.4. Bascially, if you modify the pl2303 driver to recognize the DCU-11 cable vendor and product ID, you're there. The vendor:product ID for the DCU-11 is 0x0731:0x0528.
I use this line to compile the pl2303 driver out of the kernel tree:
gcc -Wstrict-prototypes -Wno-trigraphs -fomit-frame-pointer -fno-strict-aliasing \ -fno-common -D__KERNEL__ -DMODULE -DNOKERNEL -I/lib/modules/`uname -r`/build/include \ -O2 -Wall -Wstrict-prototypes -fomit-frame-pointer -pipe -DMODULE -D__KERNEL__ \ -DEXPORT_SYMTAB -DMODVERSIONS -c pl2303.c
- Contact
Fredrik Sörensson, sorn73 at yahoo dot com
