Wednesday, February 14, 2007

Using Bluetooth with Nokia 6230i and Fedora


Sometimes I think about all those people carrying around this cool mobiles in their pockets, just because they are the newest ones, or have a nicer color... And most of the time much of the neatest features are just ignored. Take bluetooth for example. Most people don't know even what this is, or they just use it to exchange that funny ringtone... or that naughty wallpaper. But Bluetooth gives you so much more. Other good example is SyncML... and we could go on like this for ages.. as mobiles get more more advanced by the hour.

But right now we are here to create a simple connection with your distinguished, trustworthy and able Linux box and that sexy mobile of yours.

I am using a Bluetooth USB Dongle from D-link, and it works like a champ.

Just plug it into the linux box, and then type (in Fedora...)

#service bluetooth start

So the scenerario is set, lets move on.

Let's see if the dongle was correctly recognized:
#hciconfig -a
hci0: Type: USB
BD Address: 00:15:E9:69:F4:78 ACL MTU: 192:8 SCO MTU: 64:8
UP RUNNING PSCAN ISCAN
RX bytes:8070 acl:192 sco:0 events:481 errors:0
TX bytes:6708 acl:182 sco:0 commands:169 errors:0
Features: 0xff 0xff 0x0f 0x00 0x00 0x00 0x00 0x00
Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3
Link policy: RSWITCH HOLD SNIFF PARK
Link mode: ACCEPT MASTER
Name: 'Linux BOX'
Class: 0x000100
Service Classes: Unspecified
Device Class: Computer, Uncategorized
HCI Ver: 1.1 (0x1) HCI Rev: 0x20d LMP Ver: 1.1 (0x1) LMP Subver: 0x20d
Manufacturer: Cambridge Silicon Radio (10)

everything looks nice.


Now be sure to turn on your mobile's bluetooth radio.

lets see if linux can find the device:

#hcitool scan
Scanning ...
00:15:E9:69:F4:78 Alex's Nokia

That strange HEX address is the unique identifier of your mobile. Think of it as your mobile's bluetooth radio MAC address.

lets ping the mobile from the server

# l2ping 00:E0:03:58:3F:35
Ping: 00:E0:03:58:3F:35 from 00:15:E9:69:F4:78 (data size 20) ...
0 bytes from 00:E0:03:58:3F:35 id 0 time 51.84ms
0 bytes from 00:E0:03:58:3F:35 id 1 time 40.27ms
0 bytes from 00:E0:03:58:3F:35 id 2 time 27.24ms
3 sent, 3 received, 0% loss

pretty neat huh? Ok so now we are sure that they can see each other... lets get them to talk\

# rfcomm connect rfcomm0 00:E0:03:58:3F:35
Connected /dev/rfcomm0 to 00:E0:03:58:3F:35 on channel 1
Press CTRL-C for hangup


That is it!!! now your mobile and computer with a little tweaking is able to exchange contacts.. files, connect to the internet using the mobile's GPRS service, send receive SMS, and so on... but we will get into this in some other post!


Good luck!!






No comments: