How to Activate Linux USB Dongles ‘D-link, Belkin etc’
Generally you can expect a USB device to work as soon as you plug it into a machine running any modern distribution of GNU/Linux. Everything from Debian to openSUSE can usually identify any USB device you plug into it and activate it as long as it can find a suitable open-source driver. Some distributions, like Ubuntu, have opted to use closed-source drivers when there isn’t any open-source version available.
Getting USB dongles to provide wireless connectivity can be a pain, however. Your Linux distribution might not activate the device automatically, which means you won’t be able to sync Bluetooth or Wi-Fi connections to it. Fortunately, there’s a quick fix from the terminal that should restore everything to normal after a restart.
Method 1: Recognizing the Device with hcitool
You’ll need to open up a terminal window, which you can do by searching for it on the Dash or opening it by clicking on the LXDE, Whisker or KDE menu and opening it from System Tools. You can also hold down Ctrl, Alt and T to open it in almost every desktop enviroment. You may want to hold down the Super or Windows key and then push T if that shorcut is supported by your window manager.
Run sudo hcitool lescan from the terminal as soon as it opens. This might find the Bluetooth device you were looking for. If you see an error that reads something like “The program ‘hcitool’ is currently not installed. You can install it by typing: sudo apt install bluez,” then you might not actually have the required Bluetooth daemon installed. This could very well be the cause of your issue. You could also get an error from sudo itself. Run sudo apt-get update after making sure that your repositories are activated and then run sudo apt-get install bluez to install the daemon. Once you’ve completed the installation, you can then try this again. You might also want to restart, which you can do simply by typing reboot at the command prompt to see if this helps.
Method 2: Editing the 99-local-bluetooth.rules File
If you absolutely can’t get the system to recognize the device under hcitool, then you’ll need to create a rule in the 99-local-bluetooth.rules file to get it to identify it. This should work with pretty much any of the Debian-based distributions and quite possibly Red Hat Linux as well. This should, by extension, work for Linux Mint, Ubuntu and the various derivatives of Ubuntu like LXLE, Bodhi Linux and Kubuntu.
Open the file by typing at the command prompt and push enter. If you’d prefer, then you can substitue nano with vi, vim or another text editor. Scroll all the way down and then add the line SUBSYSTEM==”usb”, ATTRS{idVendor}==”####”, ATTRS{idProduct}==”####”, RUN+=”/bin/sh -c ‘modprobe btusb; echo #### #### > /sys/bus/usb/drivers/btusb/new_id'” to the bottom of the file. If you want to save yourself some time and simply copy this over but you’re using a terminal-based text editor, then make sure to either click on the Edit menu in the terminal and use Paste or hold down the Shift key when you push Ctrl+V.
You’ll need to replace the octothorpe symbols with the Vendor ID and Product ID of your device. If you know it, then simply fill it in. Otherwise, you’ll need to run lsusb from the command line to find it out. Look for the name of your device in the list. You should see the letters ID followed by four hexadecimal digits, a colon and then four more hexadecimal digits. Use the first four digits to replace the octothorpes in ATTRS{idVendor}==”####”, and then use the second four to replace the ATTRS{idProduct}==”####”, segment before using both to replace the set of symbols after echo. Save the file, exit and then restart your machine. You shouldn’t have any other issues.
Make sure the device is connected properly if you don’t see it listed after running the lsusb command, though. You might have noticed in our example image we didn’t actually see the Bluetooth device listed there. That meant it wasn’t plugged in properly. Wait a few moments after plugging it in before you run it, otherwise the lsusb program might not be able to find it right away.