From the starting days of Kernel-2.4.6, Bluetooth made its way into the core Linux kernel and is getting better by the day since then. Added to this fact is that the desktop environment Gnome 2.4 included a Bluetooth subsystem, which makes it much easier for end users to configure and use Bluetooth graphically.
In India Bluetooth wasn’t hot but, demand for Bluetooth enabled mobile hand-sets is increasing now-a-days. Reducing cost of these devices and availability of GPRS Internet through these phones, makes it possible for mobile professionals to get connected even when they are not sitting in office. In this article, we’ll talk about how you can configure your Bluetooth adapter in Linux.
Snapshot | |
Applies to | Personal devices |
Usp | Easier interconnects |
Links | www.gnome.org/ www.holtmann.org/linux/bluetooth/ |
Installing the Components
To setup your Bluetooth device under Linux you will need BlueZ and if you have Gnome 2.4 then your life will be easier. BlueZ is the official Linux Bluetooth protocol stack and supports most Bluetooth devices. In our test setup we used a CSR (Cambridge Silicon Radio) chipset based USB Bluetooth dongle and configured it under PCQLinux 2004. PCQLinux 2004 has all the necessary software and applications, and if you’ve done a complete install, you don’t need anything else.
Otherwise, make sure that you install the Gnome-Bluetooth subsystem. To do so run the package manager by selecting Start>System Settings >Add/Remove Applications. This will open a new window. Select the ‘Details’ link after the ‘Gnome Desktop Environment’ option and check the Gnome Bluetooth option, if not selected already. Now just follow the wizard and it will install five components needed to setup the Gnome Bluetooth subsystem. After this, you also have to add some more tools to setup Bluetooth properly. For that, insert the PCQLinux 2004 Disc 3 and run the following command.
#rpm —ivh /mnt/cdrom/PCQLinux/RPMS/blue*
It will install all the required applications and you are ready to go.
|
Configuring Bluetooth
Insert your Bluetooth device into the system and restart your machine. Then run the following command.
#hciconfig hcix up
Here, replace ‘x’ with the number of Bluetooth devices minus one. So if you have just one device then the command should look like ‘hciconfig hci0 up’. Now, run the hciconfig command without any parameters to see the type (USB/PCMCIA) and MAC address of your Bluetooth device(s). Now check whether or not the Bluetooth demon is working by running the command:
#/etc/init.d/Bluetooth status
If it’s not running, then issue the command.
“/etc/init.d/bluetooth start”
You are now all set to connect to other Bluetooth devices.
Connect to Others
We used a Sony Ericsson T610 mobile phone to communicate with a Linux laptop. To start, open an instance of Nautilus (the Gnome file explorer) and enter ‘bluetooth://’ at its location bar. Within seconds it will show you all Bluetooth enabled devices available near you.
In our case it is the T610. Suppose, you want to send some file to the phone through Bluetooth. Just drag the image file and drop it into the phone and a popup will appear with a title ‘Bluetooth PIN Code’. Here enter a pin code (any number with at least four digits) and press the Accept button. Now, you get a message on your phone asking you to add the device to the Device list of the phone. Here select yes and provide the same Pin when asked and the PC will be added to the phone’s trusted device list. Finally, the phone will again pop a message asking weather you want to accept the file which is coming via Bluetooth or not. Click Yes and the file will be downloaded to the phone. Note that this pin code pairing happens just once when you send a file for the first time from a device to another device. After the trusted relation is build, it is not needed.
This was just one part of the transaction. Now let’s see how you can receive a file from the phone to the PC. This is a little tricky one, as Gnome does not automate this. So to receive a file you have to run a command from any terminal like this.
#gnome-obex-server
If you send any file from any other Bluetooth device, it will get downloaded to the home directory of the active user of your Linux PC.
Next month we’ll talk about how you can configure GPRS via Bluetooth on your Linux PC.
Anindya Roy