Bluetooth module do not see any discoverable device My MacBookPro (Retina, 15-inch, Mid 2015) do not see any Bluetooth device. So I can't connect external wireless mouse and keyboard and this is annoying. 

This is a log from a Bluetooth Packet Logger. 

[Feb 22 16:55:12.033]  [NOTE]  OS X Version 10.13.3 (Build 17D47) / Model ID: MacBookPro11,5
[Feb 22 16:55:12.035]  [NOTE]  Bluetooth Software Version: 6.0.2f2
[Feb 22 16:55:12.036]  [NOTE]  Host Controller:  Broadcom / 0x05AC / 0x8290 / v153 c4801 / Built-In (Yes) / Location ID (0x14300000)
[Feb 22 16:55:12.036]  [NOTE]  Support:  Deep Idle (No) / WoBT (Yes) / BTRS (No) / New Idle Policy (Yes) / Idle Time (500 ms)

[Feb 22 16:58:48.306]  [HCI EVENT]  [200E] Command Complete - LE Create Connection Cancel - Status: 0x0C 
[Feb 22 16:58:48.306]  [KERNEL]  Received Command Disallowed (0x0C) error -- In UHE mode?
[Feb 22 16:58:48.306]  [HCI COMMAND]  [FCFE] Vendor Specific Command [FCFE] - Read Local Firmware Info - Info Type: Read Current Bluetooth Mode
[Feb 22 16:58:48.307]  [HCI EVENT]  [FCFE] Command Complete - Broadcom VSC Event - Read Local Firmware Info
[Feb 22 16:58:48.307]  [KERNEL]  Not in UHE Mode -- continue


Here is system info

OS: macOS 10.13.3 17D47 x86_64
Host: MacBookPro11,5
Kernel: 17.4.0
Shell: zsh 5.3
Resolution: 1440x900
DE: Aqua
WM: Kwm
Terminal: iTerm2
CPU: Intel i7-4870HQ (8) @ 2.50GHz
GPU: AMD Radeon R9 M370X, Intel Iris Pro
Memory: 3736MiB / 16384MiB


Some images illustrating the problem.




Does anybody know how to solve this issue?
I've had the same things happen over the past 6 months (mine's a mid-2012, thought). I've tried to find out the root cause on many occassions - but I'm pretty sure it's a culmination of many, many different factors (wear and tear, bumps/drops, formatting drives repeatedly, etc.). Just found this though:


  § UHE Button Operation:
  Your Bluetooth USB adapter may have UHE button, this is applied in the condition
  when computer system is without BTW driver installed but need to make
  connection with Bluetooth enabled keyboard or mouse or any HID devices


I also use iTerm2, which is notorious for provisioning issues (can't have a worse problem when it comes to the command line).

Bluetooth gets in the way a lot (for me), so I've messed with the settings quite a bit. I wouldn't be surprised if the same was true for you. Likely through iTerm as well, which worsened the situation.

The largest cause seems to be from inconsistent settings, firmware upgrades, and the kernel issues that come with them. Doesn't take long for it to start taking a toll on the battery, power settings, and worsening kernel panics, kind of like this (old but relevant): https://forums.gentoo.org/viewtopic-t-506162.html

You will have to dig deep. But the issue is buried under some random setting, plugin, or other microscopic detail. Find the source, then patch the kernel appropriately.