4.30.2011

How to transfer files through Bluetooth under Ubuntu? - Part-I

Bluetooth is a specification for the use of low-power radio communications to wirelessly link phones, computers and other network devices over short distances. The name Bluetooth is borrowed from Harald Bluetooth, a king in Denmark more than 1,000 years ago.

Bluetooth is the short-range networking facility that allows various items of hardware to work with each other wirelessly. For Bluetooth to work, both devices need to have Bluetooth support. Many mobile phones come with Bluetooth nowadays, and an increasing number of notebook computers do too. It’s also possible to buy very inexpensive Bluetooth USB adapters.

Your PC’s Bluetooth hardware is automatically recognized under Ubuntu, and the low-level driver software is installed by default. Therefore, all you normally need to do is install the software that provides the Bluetooth functionality you require.

Configuring Bluetooth

When two pieces of Bluetooth-compatible hardware need to communicate on a regular basis, they can pair together. This means that they trust each other, so you don’t need to authorize every attempt at communication between the devices. Indeed, some devices won’t communicate unless they’re paired in this way.

Pairing is very simple in practice and works on the principle of a shared personal ID number (PIN). The first Bluetooth device generates the PIN, and then asks the second Bluetooth device to confirm it. Once the user has typed in the PIN, the devices are paired.

Pairing is easily accomplished under Ubuntu and doesn’t require any additional software. However, you will need to edit a configuration file. This only needs to be done once.

Start by opening the central Bluetooth configuration file, hcid.conf, in Gedit, using superuser powers:

Code:

gksu gedit /etc/bluetooth/hcid.conf

Look for the line that reads "security user", and change it so that it reads "security auto".

The default PIN needed to pair with Ubuntu is 1234. For security reasons, it’s wise to change this, and the setting is contained further down in the hcid.conf file. Look for the line that reads

Code:

passkey "1234";

and replace 1234 with the number you desire. For example, if I wanted a PIN of 9435, the line would read

Code:

passkey "9435";

When you’ve finished, save the file, and close Gedit. It’s then necessary to restart the background Bluetooth service. To do this, type the following into a Terminal window (Applications -> Accessores -> Terminal):

Code:

sudo /etc/init.d/bluetooth restart

Following this, I paired my Ubuntu test PC to a Nokia 6680 mobile phone. It’s easiest to initiate pairing on the phone, which should then autosense the PC’s Bluetooth connection.

On my Samsung Champ, I opened the menu, and selected Connections -> Bluetooth. Then I pressed the right arrow key to select Paired Devices and selected Options -> New Paired Device -> More Devices. This made the phone autosense my Ubuntu PC, which was identified by its hostname, followed by -0. In my case, the Ubuntu PC was identified as keir-desktop-0, and I was then prompted to enter the PIN I set earlier. Following this, the two devices were paired.

In the next episode we will discuss how to transfer/receive files through bluetooth.
Till then, bbye.

No comments:

Post a Comment