3

I have an external bluetooth adapter, it works if I attach it before booting, but if I connect it afterwards it fails to detect any device.

Is there any command to scan for and detect devices?

3
  • how do you connect this device ? via usb ? in other words, is this a usb bluetooth adapter that doesn't get enabled if you plugin after booting ?
    – koushik
    Oct 7, 2010 at 14:45
  • its via usb, thats right @kaushik
    – JapanPro
    Oct 9, 2010 at 13:52
  • hcitool and sdptool may help.
    – Mikel
    May 8, 2011 at 3:51

3 Answers 3

5

You should check to see if the USB bluetooth kernel module (driver) is loaded.

lsmod | grep btusb

If it doesn't return anything, then you need to load the kernel module with:

sudo modprobe btusb
2
  • Note: This works on an unmodified Ubuntu system with no extra packages installed. Great! Jul 5, 2018 at 14:50
  • 1
    Even if the driver is loaded and listed with the above lsmod | grep btusb, sometimes it helps to force a restart of it: rmmod btusb, then modprobe btusb.
    – cfi
    Jan 14, 2022 at 21:06
4

Can you try restarting the init.d service?

:~$ sudo /etc/init.d/bluetooth restart

Executing this command after you connect your usb bluetooth adapter should restart the service and make the bluetooth service recognize new connections/adapters/etc....

Let me know...

0

In addition to the above answer lsmod to check for the bluetooth kernel module, you can also use rfkill to check the status of (and block and unblock) different wireless devices on your machine.


RFKILL

rfkill was merged into the linux kernel in 2.6 and is a simple way to manage wireless devices.

For example, view wireless devices by calling rfkill with no arguments:

cat@rt~ $ rfkill
ID TYPE      DEVICE      SOFT      HARD
 0 wlan      phy0   unblocked unblocked
 1 bluetooth hci0     blocked unblocked

And get a little more details with rfkill list $TYPE:

cat@rt~ $ rfkill list bluetooth
1: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no

Then (with sudo/root) you can block or unblock the devices with rfkill block $TYPE (or $ID):

cat@rt~ $ sudo rfkill block bluetooth
cat@rt~ $ sudo rfkill block wlan

Now check their new status with rfkill again:

cat@rt~ $ rfkill
ID TYPE      DEVICE    SOFT      HARD
 0 wlan      phy0   blocked unblocked
 1 bluetooth hci0   blocked unblocked

Note the devices I disabled are listed blocked under SOFT but not HARD. This means we've disabled the device through software (and can re-enable the device through software).

A HARD blocked device indicates the wireless device was hardware blocked. This could be a hardware kill switch (some laptops have a switch to toggle wireless off), or the device may be disabled by bios, or possibly doesn't have a driver for the software to interact with it (double-check me on that last one though).

And to unblock a SOFT blocked device:

cat@rt~ $ sudo rfkill unblock bluetooth
cat@rt~ $ sudo rfkill unblock wlan

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .