2007-03-27
How to make an IBM T60 running Fedora Core 6 push files to a Nokia 6233 over bluetooth
I notice that Google is sending people making general queries about running Fedora on a T60 to this entry. If you fall into that category, your best bet is this ThinkWiki page. But please return when you want to get bluetooth working!
Long time, no blog. And I'm afraid that this entry will have a fairly narrow audience. For everyone else, here's a photo from the Brecon Beacons:
I have a IBM T60 laptop (it's still got an IBM logo on it, so I'm not going to call it a Lenovo with a built-in bluetooth adapter. Back in January I got it to push files to my Nokia 6233 phone over bluetooth. It took a while to find a procedure that worked, because although many web pages discuss how to do this, I never got their instructions to work properly (in brief, they recommend using OBEX File Transfer, rather than OBEX Object Push, which runs into pc-phone authentication issues that I was unable to overcome). Unfortunately, I didn't write the details of my discovery down. So when I wanted to play with J2ME development recently, I had forgotten the critical points, and I had to spend a couple of hours uncovering them again. So now I'm documenting the process here.
These instructions should apply to Linuxes other than FC6, since the only software requirements are the common Bluez bluetooth stack and OpenOBEX. And the T60 simply uses a Broadcom bluetooth chipset on an internal USB bus, so they should also apply to any bluetooth adapter supported by the Linux kernel. Finally, there's nothing special about the 6233 (except for a bug when transferring a Jar file, described below), and I have followed the same procedure with a Motorola L6.
-
First, use hidtool scan to make sure that bluetooth is working on both sides, and to discover the bluetooth MAC address of the target phone:
$ hcitool scan Scanning ... 00:19:B7:81:60:A8 DPW phone
(I had previously set my phone to call itself “DPW phone” under Settings / Connectivity / Bluetooth / My phone's name.)
If the phone does not appear in the results of the scan, check that bluetooth is enabled on the computer and the phone, and that the phone is set to be visible (Settings / Connectivity / Bluetooth / My phone's visibility on the 6233).
-
Use sdptool browse to list the services offered by the phone:
$ sdptool browse 00:19:B7:81:60:A8 [...] Service Name: OBEX Object Push Service RecHandle: 0x1000b Service Class ID List: "OBEX Object Push" (0x1105) Protocol Descriptor List: "L2CAP" (0x0100) "RFCOMM" (0x0003) Channel: 9 "OBEX" (0x0008) Language Base Attr List: code_ISO639: 0x656e encoding: 0x6a base_offset: 0x100 Profile Descriptor List: "OBEX Object Push" (0x1105) Version: 0x0100 [...]
You need to find the OBEX Object Push section, as shown above. Note the channel number for the next step.
-
Now start obex_test with the OBEX Object Push channel number:
$ obex_test -b 00:19:B7:81:60:A8 9 Using Bluetooth RFCOMM transport OBEX Interactive test client/server.
-
Use the c command to connect to the phone:
> c Using Bluetooth RFCOMM transport OBEX Interactive test client/server.
At this point the phone asks:
Accept date from? [computer name]
Accept, and obex_test will indicate that the connection was successful:
Connect OK! Version: 0x10. Flags: 0x00
- At last, push a file:
> x App.jar Going to send App.jar(App.jar), 2404 bytes Filling stream! Made some progress... Made some progress... Filling stream! PUT successful!
When the whole file has been transferred (which can take a while for a large file), the phone will announces that a file was received.
- Quit obex_test:
> q
I have used this procedure to copy audio files, video files, and J2ME Jar files to my 6233. For audio and video files, the 6233 seems able to work out what they are, and puts them into an appropriate folder. But when you transfer a Jar file, the phone has an interesting “feature”: When it announces that a file was received, it gives misleading information about which folder the file was received into, so it can easily look like the transfer failed. But actually it will be in the “Collection” folder in the phone's memory.
26 December 2007 06:27
Comment from Anonymous
Thanks, that was helpful! obex_test didn't work with my lg vx 5400 phone (it could not establish a connection), but obex_push did the trick.