Bluetooth Pairing

This is a guide to pairing Bluetooth serial devices with your computer, including the Freetronics Bluetooth Shield and the Freetronics Bluetooth Module. For more details on setting up the shield and the module, see the Bluetooth Shield Quickstart Guide or the Bluetooth Module Quickstart Guide.

 

 

Pairing with MacOS

Open Apple -> System Preferences -> Bluetooth. Turn on Bluetooth if it's not already on. Under the list of devices you should see a new device called "HC-05" that is not yet paired. Click the "Pair" button:

Pairing will fail, because MacOS attempts to use the password "0000" by default. Next, click "Options":

Enter password "1234" and click "Pair":

The device will now be paired and ready to use:

Once pairing is finished, continue from the next step in the Bluetooth Shield QuickStart Guide.

 

Pairing with Windows

These pictures show Windows 7, but pairing in all versions of Windows is similar.

Open the "Devices" window, and choose "Add a Device..."

 

 

In the New Hardware window that pops up, you should see the Bluetooth device corresponding to the Bluetooth Shield. It may be called "Unknown Device" or "HC-05", depending on your Bluetooth adapter.

Select the new Bluetooth device, and click Next.

At the next prompt, click "Enter the device's pairing code" then click "Next":

Enter 1234 for the pairing code, then click Next:

Windows will then pair to the Bluetooth Shield. Prompts will appear as the pairing completes, and you may see a popup showing you the COM port name that's been assigned to the new device.

If you need to look up the COM port number later, you can right-click the HC-05 device in the Devices control panel and choose Properties:

 

Then look under the Hardware tab for the COM port name of the device:

Windows Serial Terminal Emulator

Unfortunately, Arduino IDE Serial Monitor feature often has problems talking to Bluetooth serial devices on Windows. We recommend downloading a separate program called a Terminal Emulator, that allows you to interact wirelessly with the Bluetooth Shield.

There are many terminal emulators, but we recommend the free open source program Tera Term.

Once you've downloaded and installed Tera Term, you can continue from the next step in the Bluetooth Shield QuickStart Guide.

Windows Troubleshooting

In Windows Device Manager, you may notice two COM ports instead of one. This is normal. Usually the lower numbered COM port is the correct one to use, it should be the same as the one shown on the Hardware tab of the Bluetooth Devices section shown above.

 

You may experience a lot of timeouts and "connection failed" or "COM port unavailable" errors when connecting to the Bluetooth Shield COM Port. Power cycling the shield (unplugging and replugging it) should usually fix these. If it occurs often, try disabling power management for the Bluetooth host adapter in your computer:

  • Open Device Manager
  • Find your computer's Bluetooth adapter under the "Bluetooth Radios" tab. It may have a name like "Generic Bluetooth Adapter"
  • Right-click the adapter and choose "Properties"
  • Click on the "Power Management" tab
  • Uncheck the box "Allow the computer to turn off this device to save power"

    Once pairing is finished, continue from the next step in the Bluetooth Shield QuickStart Guide.

     

     

    Pairing with Linux

    These pairing instructions show Ubuntu Linux. Every Linux distribution and desktop environment is a bit different, but the steps will be similar.

    Open the Bluetooth control panel by searching for it or choosing it from a launcher menu:

    Click the "Add New Bluetooth Device" button (it may be a + sign)

     

    In the search dialog that pops up, the Bluetooth Shield will appear as HC-05. Select it, and then click "PIN options..."

    Select "1234" for the pairing PIN value:

    Then click "Close" and click "Continue" to pair with the Bluetooth Shield.

    After the pairing is complete, you still need to configure the Bluetooth Shield as a serial port in Linux.

    First, copy the unique address of the Bluetooth shield that's shown in the Bluetooth dialog. Do this by selecting it and typing Control-C:

    Next, use sudo or su to edit the config file /etc/bluetooth/rfcomm.conf as root. On some distributions the path to this file may be different, you can use the command locate rfcomm.conf to find it.

    If there is no rfcomm.conf config file on your system, try installing the bluez package.

    Add a section at the bottom of the rfcomm.conf file like this:

    rfcomm0 {

    bind yes;

    device 11:22:33:44:55:66;

    channel 1;

    }

    Replace the string 11:22:33:44:55:66 with the unique address of your Bluetooth Shield, that you copied before.

    Next, run the command sudo service bluetooth restart to restart the Bluetooth services. The serial port connection to the Bluetooth shield will appear at /dev/rfcomm0.

     

    Once pairing is finished, continue from the next step in the Bluetooth Shield QuickStart Guide or the Bluetooth Module Quickstart Guide.