HC 06 Bluetooth in Ubuntu

In this article we going see how to connect HC-06 Bluetooth in Ubuntu, which is commonly using in embedded systems such arduino. But this time we will see how to use it with linux in order to interact with bluetooth channels.

So first thing we need to pair this device with ubuntu using the Bluetooth GUI in Ubuntu .

alt text

Select the device and make sure you set up the Pin Option to ‘1234’.

Then, Open Terminal and make sure that you can see the device !

$ hcitool scan

Now go head and edit this file : /etc/bluetooth/rfcomm.conf

$ sudo vi /etc/bluetooth/rfcomm.conf

uncomment and change it to :

    rfcomm0 {
        # Automatically bind the device at startup
        bind no;

        # Bluetooth address of the device
        device 98:D3:31:80:51:48;

        # RFCOMM channel for the connection
        channel    1;

        # Description of the connection
        comment "HC-06";

Make sure you change the device to you’re HC-06 Module Address !.

Finally, bind the device with :

$ sudo rfcomm bind rfcomm0

Then use minicom to communicate with the modue in serial !

$ sudo minicom -D /dev/rfcomm0 -b 9600 -8

and don’t forget to release the device when you finishing

$ sudo rfcomm release rfcomm0
comments powered by Disqus