I use a late-2015 iMac (currently) running OS X High Sierra as my main work machine. From day 1 till just a few days ago, bluetooth has worked flawlessly on this machine. The bluetooth Apple keyboard and TrackPad 2 that came with the iMac both paired seamlessly right out of the box, and I’ve never had a connection drop or any other issue, even after going through 2 rounds of major OS upgrades (first to Sierra, and now to High Sierra).
Then suddenly out of the blue a few days ago, the bluetooth connections to both the keyboard and trackpad would drop roughly 20-30 seconds after the machine wakes from sleep. Most times, they would not reconnect on their own, and sometimes, the bluetooth status of the machine would actually report bluetooth was OFF with no option to turn it back ON.
Simply removing the devices and re-connecting them would work to keep them connected only until such time that I sleep the machine and wake it up again. Whereupon the whole disconnect cycle would repeat.
Trashing the Bluetooth prefs file and resetting the machine SMC did not solve this problem. Finally what seems to have done the trick to fix it is Resetting the Bluetooth Module on the iMac via a little known special menu accessible via holding “Shift + Option” then clicking on the bluetooth icon in the top menu bar.
This brings up the among other things a “Debug” sub-menu with the option to “Reset the Bluetooth Module”. And easy as that, disconnect issues have now been resolved!