Using the Plugable USB-BT4LE Bluetooth Adapter with the Raspberry Pi

UPDATE: This blog post was written for an earlier version of Raspian. For Jessie, the current version, please see this blog post. .

Using a Bluetooth adapter with your Raspberry Pi opens up a whole new world of possibilities. You can connect a Bluetooth keyboard a mouse, send music to Bluetooth headphones or music receiver, or delve into the exciting world of Bluetooth Low Energy (BLE) applications. The best part is that it is really easy.

If you are using Raspbian, the most common Linux distribution for the Pi, almost everything you need to use the Plugable Bluetooth adapter is already built in. Besides the Pi itself, you will need an internet connection, the Plugable Bluetooth adapter, and a powered hub that is compatible with the Pi. For the hub we recommend the Plugable USB 2.0 7-port hub, which can both power the Pi and the USB devices connected to it, so you don’t have to worry about your Pi restarting after drawing too much power through its USB ports.

First connect the monitor and internet to your Pi. Plug the Bluetooth adapter into the hub, connect the hub to the Pi, then plug the hub into an AC outlet. You can watch a video about setting up the hub here.

After the Pi starts up, log in and type the following commands to update software on the Pi. Each command can take several minutes to run. Answer “yes” to any prompts.

sudo apt-get update
sudo apt-get upgrade

Next, install the Bluetooth support software with this command:

sudo apt-get install blueman

After the installation finishes, type startx to start the graphical interface.

You should now see a Bluetooth symbol in a blue oval at the lower or upper right of your screen, depending on which version of Raspbian you have.

Bluetooth symbol

Click it to bring up the Bluetooth Devices window, and click Search to look for devices. If no window appears, see our blog post here. Any nearby Bluetooth devices in discovery mode should appear in the window. In this example, we will install a keyboard. Other devices are similar, although many will not require a PIN.

Search

Click the device you want to pair to, then select the plus sign to pair. Under device, select the service you want to connect to. If you are adding a keyboard or similar device, you will be asked to enter a pin.

Pairing request

Enter the same PIN on the keyboard to connect, and you are done.

Connected

If the Bluetooth utility does not see the Bluetooth adapter try the following commands:

sudo nano /etc/group

{change line 8 from “lp:x:7:” to “lp:x:7:pi” save and exit}

sudo reboot

33 comments on “Using the Plugable USB-BT4LE Bluetooth Adapter with the Raspberry Pi”

  1. Seanzky Reply

    Left-clicking the Bluetooth icon doesn’t do anything. Right-clicking opens up a menu but nothing in the menu works except for Turn Bluetooth Off…

  2. Chuck Reply

    Same problem as Seanzky – the Bluetooth GUI will NOT start in LXDE, which runs on Raspian Wheezy on my Pi B+. Tested this with 3 other Pi, same thing.

    I don’t know what break, but as of right now, I cannot use this bluetooth device. Additionally, per David Varney above, no response from Pluggable about pairing via CLI.

    Anyone from Plugable will response?

    • Ivan Fossa Ferrari Ivan Fossa Ferrari Reply

      Hello Chuck,

      Pairing a bluetooth device via the commandline can be accomplished using either the bluetoothctl tool or hcitool. bluetoothctl is the easier tool to use.

      There’s a brief tutorial on how to pair a device using bluetoothctl here: https://wiki.archlinux.org/index.php/bluetooth#Configuration_via_the_CLI

      Please note that only the section I linked to is relevant to Raspbian Wheezy.

      I’m investigating the issues with the Bluetooth GUI on LXDE and I should have some more information regarding that soon.

      Sincerely,
      Ivan
      Plugable Technologies

      • Chuck Reply

        Ivan,

        Thanks for the info. I found a way of pairing using CLI to pair a keyboard bluetooth. The problem I am facing is that during the pairing session, it keep asking for a PIN. I tried 000, 1234, or make my own and it won’t work.

        I tried it with other keyboards (Logitech, Amazon own-brand, etc.) and they all exhibit the same reason. Someone from the Raspberry.org forum asked if the BT dongle is broken, because when I run “lsusb”, it only show some number and then “Broadcom”, that’s it.

        So I wonder if Plugable BT dongle works with BT keyboard in Wheezy.

      • Chris Reply

        Any update on this? I’ve tried the other recommendations but it took me down a rabbit hole that lead me to wasting a tone of time… Clicking the bluetooth icon does nothing and when I restart the bluetooth icon it brings up the devices box but I can’t click search, it’s greyed out.

    • Ivan Fossa Ferrari Ivan Fossa Ferrari Reply

      Hello Nantha,

      Our BT Dongle works very well under Raspbian. The only issues I can point to is that Raspbian has some issues when pairing some Bluetooth keyboards, primarily from Logitech, but this related to Raspbian, and would be experienced when using any Bluetooth adapter under the OS.

      Sincerely,
      Ivan
      Plugable Technologies

  3. hoyt Reply

    Once you pair a device with the bluetooth dongle, how do you communicate with it (say build an alarm system containing a bluetooth transmitter module) to receive & transmit data from your alarm board

    • Ivan Fossa Ferrari Ivan Fossa Ferrari Reply

      Hoyt,

      Specific information like that is beyond the scope of the bluetooth adapter. The alarm board device you purchased should have a way of interacting with it via an application, or an SDK, or something of the sort.

      Sincerely,
      Ivan
      Plugable Technologies

  4. Hoyt Reply

    No, I’m BUILDING the alarm board with an r-pi and want to use your BLE adapter to move data. How do you create this app? …Do you provide examples, or tools?

    • Bernie Thompson Bernie Thompson Reply

      Hi Hoyt – No, sorry. Our USB Bluetooth Adapter uses the Broadcom chipset and on Linux the BlueZ open source Bluetooth stack which allows low-level Bluetooth applications to be written — but any programming is up to you. Best wishes, Bernie

  5. Hoyt Reply

    Do you know of anyone who has used one on a Raspberry Pi to set up & transmit/rcv data to a BLE sensor?

  6. GaryCN Reply

    Raspberry Pi B+ fails to open the Bluetooth Devices window, using Noobs version of Raspbian, even with icon displayed in the lower right bar on the screen. I have tried this with a powered usb hub and directly connected to the R Pi.

    • David Roberts David Roberts Reply

      Hi Gary,

      I’ve been experiencing this problem too in the current version of Raspbian, with or without Noobs. It seems like Blueman is broken with Raspbian at the moment. I’ve been able to accomplish some things from the command line, so the lower level Bluetooth utilities are still working and support the USB-BT4LE. No advice yet. I’m still trying to figure out the problem.

  7. Hamad Reply

    This is my first time using a raspberry pi.

    I am using LXTerminal to install the bluetooth and every time i run the raspberry pi I have to reinstall it. It is also telling me:

    The following packages have unmet dependencies:
    blueman : Depends: obex-data-server (>= 0.4.3) but it is not going to be installed
    E: Unable to correct problems, you have held broken packages.

    Can someone help?

  8. nantha Reply

    I build a system android device and RPI. can I use BLUETOOTH ADAPTER for ANDROID app to communicate with RPI that is send a data into RPI
    LIKE BUTTON on APP.

  9. Brad Reply

    I’m having problems getting two devices (Anker A7721 keyboard and Logitech MX900 mouse) to connect and work properly with this adapter following a reboot of my RPI 2 after I had both devices connected and working properly. Seems like I can get one device to connect properly but not both devices. Anyone have any ideas?

    • David Roberts David Roberts Reply

      Hi Brad, Thanks for asking! Rasbian has changed considerably since this post was written, so it is hard to know what the problem might be. If you are using the Plugable adapter, please contact us at support@plugable.com, and we can do some troubleshooting.

  10. Dave Reply

    I tried using these instructions to pair a Logitech K480 keyboard with Raspbian Jessie. It is working now, but was a bit of a struggle because of changes between Raspbian versions. To save others the same pain, I am posting the additional steps I had to take here.

    First of all, pairing using the GUI did not work. The keyboard was detected, but would always reject the PIN. So I ended up using the command-line for pairing. (All of this was done via SSH as the root user.)

    1. I edited /etc/default/bluetooth and changed the line “HID2HCI_ENABLED=0” to be “HID2HCI_ENABLED=1” and restarted the system.
    2. I put the keyboard into discovery mode as described on Logitech’s support website.
    3. I ran the bluetoothctl program on the Raspbian machine.
    4. At the [bluetooth] prompt, I typed ‘scan on’ and then ‘agent on’ and finally ‘devices’.
    5. The MAC address for my keyboard was displayed in the output, so I copied it to the clipboard for easy pasting in the next few commands.
    6. Next I typed ‘pair ‘ where is the MAC address I copied to the clipboard previously.
    7. A PIN was displayed, so I typed it on the keyboard. The keyboard then showed as paired.
    8. I then typed ‘trust ‘ and ‘connect ‘, though I’m not sure if the connect command was strictly needed.
    9. I typed ‘info ‘ just to verify everything. The important things to look for here are ‘paired: yes’ and ‘trusted: yes’.
    10. Finally I tested using the text editor in Raspbian and the keyboard was indeed working.

    The idea for which bluetoothctl commands to run and in what order was from a post I found at Csabi’s Blog (http://patkoscsaba.blogspot.com/2013/12/linux-tip-how-to-pair-your-bluetooth.html)

    • Dave Reply

      In the instructions above I used MAC inside angle brackets to indicate the MAC address in the commands. Apparently these were interpreted as HTML tags and do not appear. So, here are the instructions again without any angle brackets.

      1. I edited /etc/default/bluetooth and changed the line “HID2HCI_ENABLED=0″ to be “HID2HCI_ENABLED=1″ and restarted the system.
      2. I put the keyboard into discovery mode as described on Logitech’s support website.
      3. I ran the bluetoothctl program on the Raspbian machine.
      4. At the [bluetooth] prompt, I typed ‘scan on’ and then ‘agent on’ and finally ‘devices’.
      5. The MAC address for my keyboard was displayed in the output, so I copied it to the clipboard for easy pasting in the next few commands.
      6. Next I typed ‘pair MAC‘ where MAC is the MAC address I copied to the clipboard previously.
      7. A PIN was displayed, so I typed it on the keyboard. The keyboard then showed as paired.
      8. I then typed ‘trust MAC‘ and ‘connect MAC‘, though I’m not sure if the connect command was strictly needed.
      9. I typed ‘info MAC‘ just to verify everything. The important things to look for here are ‘paired: yes’ and ‘trusted: yes’.
      10. Finally I tested using the text editor in Raspbian and the keyboard was indeed working.

      • Tom Reply

        I ran across this same problem this weekend. My setup is RPi 2B with the Plugable BT4 USB2 adapter pairing the Anker A7726 Compact Bluetooth keyboard. I am running the latest Jessie update/upgrade and I could not get Bluetooth Manager to pair the keyboard. It worked to pair my phone but then I couldn’t do anything with it.

        Very much appreciate that it took you some time to get this figured out since I was several hours into research before discovering your post. I will add to my post if I figure other issues out.

        Thanks

    • Melvin Reply

      Thanks!! I was struggling trying to connect my Logitech K480 to my raspberry pi using the blueman-manager and I kept getting the org.bluez.Error.ConnectionAttemptFailed error, until I followed this instructions right here worked like a charm, thank you.

  11. Jimmy Reply

    I’m attempting to connect my Sony MX950BT with this dongle, and it looks like the receiver picks up the name of the device, but it says there is no such directory when I try to connect.

    Any assistance is appreciated.

      • Jimmy Reply

        Hey Bernie! Thanks for the speedy response. Sorry I was not too clear in my last comment. Essentially, I’m on the Bluetooth Devices window and can see my bluetooth headset. It has been trusted and paired, but upon selecting Connect, I get a “Connection Failed: No such file or directory” at the bottom of the window.

  12. Scott Bishel Reply

    I am using Raspberry Pi 2 with Jessie installed. after using “sudo apt-get install blueman” command, rebooting the os causes the system to stop loading the os entirely. All it shows is that windows icon and blinking text input line

Leave a Reply