Bluetooth gives you control to transfer or share your files via wireless connection through a mobile, computer system, and any other Bluetooth enabled devices. It plays a versatile role in providing a faster and easy connectivity without any wired connection but within a specific range. It supports frequency between 2400 and 2483.5 MHz.
In the Linux based system, Bluez plays a key role to implement the Bluetooth wireless standards specifications, necessary to configure a Bluetooth. It is a stack protocol and must be installed in order to run Bluetooth on your Ubuntu system, mine is Ubuntu 14.04.
Want to enable and configure Bluetooth in Ubuntu system? Usually, the Bluetooth is disabled in a system, to make it effective for use, you should perform the following steps as listed below.
Steps to Enable and Configure Bluetooth in Ubuntu
Install Bluez and configure Bluetooth:
Step 1: Firstly install Bluez, which is a bluetooth stack protocol and for that, type “sudo apt-get install bluez”. Then press enter.
Step 2: In the figure, you may observe that the bluez is installed in the system.
Step 3: To check the version of “bluez” installed on your system, run: dpkg –status bluez | grep ‘^Version:’
Step 4: Now, in order to restart your networking devices, type : “sudo /etc/init.d/networking restart”, and press enter. Then you should provide the sudo password, in case you are not a root user.
The /etc/init.d contains the shell scripts that get initiated after kernel completes its initialization process, the init is the first which get invoked after it. These scripts are mainly responsible to start, restart, stop and reload the commands.
Step 5: In order to enable the Bluetooth service using ‘init’ daemon type: “sudo /etc/init.d/bluetooth start”.
Step 6: Now you can see that the Bluetooth is enabled on your system.
Type Bluetooth in the search bar and you’ll find its icon at the top of the screen.
Setup a connection and Share files with Bluetooth device using the Terminal:
Step 1: To know the adapter number of your device write “hciconfig”. The ‘hciconfig’ command is used to configure the Bluetooth devices.
Step 2: Now, to get the Mac address of the device pass the command “hcitool scan”, so as to detect the Bluetooth connections.
Step 3: In order to connect to a device use: “bluez-simple-agent hci# xx:xx:xx:xx:xx:xx”, in place of # put the adapter number, and xx:xx:xx:xx:xx:xx, the MAC address.
To Permanently unblock/block the Bluetooth:
Probably you people may agree with my perspective, that if the Bluetooth is not in use, then the power should not be wasted. Therefore, the following command is included in this tutorial, so that you would not see Bluetooth enabled on your system, every time when you log-in.
1. sudo gedit /etc/rc.local
rc.local is a text file that usually contains scripts related to startup instructions for various programs, it could be for the entire operating system.
2. Add a line “rfkill unblock bluetooth” at last to disable it.
Rfkill is preferably used to block/unblock the wireless devices. It stores the current state of radio frequency devices and tweaks with it according to the instructions given by the user.