Ubuntu bluetooth mac address

Pairing Bluetooth headphones in command line

How do you pair bluetooth headphones without using the GUI? I don’t know how to. I found different method on the internet but nothing works. I can actually see my headphones with the command : hcitool scan then i try to connect with : hcitool cc 00:00:00:00:00:00 and hcitool auth 00:00:00:00:00:00 I haven’t received an error message but my headphones are not working. thanks for your time.

6 Answers 6

  • if you don’t know the MAC do : bt-device -l | grep
  • now that you have the MAC connect with: bluetoothctl connect

Now put this in your profile:

alias headphones="until bluetoothctl connect ; do echo . ; sleep 1; done" 

** MAC HERE will be the MAC you found in previous steps

It might fail a few times because of bt connectivity and latency of connections but it works after 3 tries for me.

I never solved the UI bluetooth manager issue but I got my BT device to connect through the cli (aka terminal).

  1. Scan for pairable BT devices: this will help you obtain the MAC address of your device. The device has to be in pair mode.
  1. Once you’ve found your device, copy the MAC address.
  2. Now you can attempt connecting (replace Xs with the copied MAC at step 3):
bluetoothctl connect XX:XX:XX:XX:XX:XX 

You can get the list of bluetoothctl commands by typing:

Install it by running sudo apt-get install bluez-tools .

Find the MAC address of your device with bt-device -l and connect to it with bt-audio -c 00:00:00:00:00:00 .

The BT-audio program is not yet installed. You can install it by typing sudo apt-get install bluez-tools. I tried to remove and install bluez-tools but the problem is still there.

I’m on ubuntu 19.04 and executing the following worked for me:
sudo bluetoothctl where $DEVICE_MAC_ADDRESS is the mac address of the bluetooth device.

To find my device’s mac address I used bt-device -l

Both bluetoothctl and bt-device commands were already pre-installed on my system.

Hope this can help someone! 😉

To connect to a bluetooth headset, this worked for me.

I made sure bluetoothd was running.

I did: bluetoothctl devices

This gave the name and address of my bluetooth device.

I did: bluetoothctl connect

I saw: «Connection successful».

$ bluetoothctl devices Device B8:AD:3E:7B:5E:D2 LG HBS750 $ bluetoothctl connect B8:AD:3E:7B:5E:D2 Attempting to connect to B8:AD:3E:7B:5E:D2 [CHG] Device B8:AD:3E:7B:5E:D2 Connected: yes Connection successful the script I now use is simply: bluetoothctl connect B8:AD:3E:7B:5E:D2 

For Ubuntu Users

Connect your headphones to Bluetooth in a robust manner.

We will use the bluetoothctl command-line utility:

  • Important: Make sure your device is bluetooth discoverable by pressing some button on the device.
  • Find the bluetooth device’s MAC-address by running $bluetoothctl scan on .
    • This command will start discovering your devices and you need to spot your device’s mac address in the output. My device is called «Avi Ear» and it was found in the line:
      • [CHG] Device 4C:87:5D:9E:04:B8 Name: LE-Avi Ear
      • Important: Before running the script, make sure your device is bluetooth discoverable by pressing some button on the device.
      #!/bin/bash # remove headphones and start fresh bluetoothctl remove 4C:87:5D:9E:04:B8 # turn bluetooth off bluetoothctl power off # turn blutooh on bluetoothctl power on # scan for devices for 15 secs so that our device gets discovered. timeout 15s bluetoothctl scan on # pair with headphones bluetoothctl pair 4C:87:5D:9E:04:B8 # trust headphones bluetoothctl trust 4C:87:5D:9E:04:B8 # connect to headphones bluetoothctl connect 4C:87:5D:9E:04:B8 

      enter image description here

      • Finally, you should see headphones in the «Connected» state in Bluetooth Settings. For example, as you can see in the image below, «Avi Ear»(Name of my headphones) is «Connected».

      (If no sound) Configure your computer to output to your headphones

      Even though my headphones were shown as connected, I did not hear any sound. To hear sound you need to:

      enter image description here

      • Open the PulseAudio Volume Control App. This came preinstalled with Ubuntu for me, but you should be able to find easy instructions to install if you don’t have it.
      • Go to the Configuration tab and make sure you have all other devices turned off except your headphones like this:

      You should now be able to hear sounds from your headphones now.

      Источник

      How to Find Your MAC address in Ubuntu and Other Linux Distros

      When you are learning networking or troubleshooting it, you would need to know the MAC address.

      A computer can have more than one MAC address. It is because the MAC address is a core part of networking, and each networking peripheral device has its own MAC address.

      So, your WiFi card has a MAC address, and so does the Ethernet (LAN) port. Even the Bluetooth has one.

      The MAC address, also known as the physical address, is a 12-digit hexadecimal code (48-bits) and is represented as MM:MM:MM:SS:SS:SS

      In this tutorial, I’ll share the steps for finding the MAC address of your desired networking interface in Linux. I’ll show both command line and GUI methods.

      Method 1: Find MAC address using command line

      There are serveral Linux networking commands that can be used to get the MAC address of the WiFi or LAN cards.

      Open up your terminal and use the following command, and it will bring the address of the present network cards in your system:

      And you’ll be met with the following output:

      use ip link command to show mac address

      Generally, the wireless device names will be wlan0, wlan1, wlan2, wlo0, wlo1, and wlo2, whereas the Ethernet (wired device) will probably have eth0, eth1, eno0, eno1,enpls0, or enpls1.

      You can find the MAC address of each device at the last line of the device description, followed by link/ether and it’s 52:54:00:5c:92:bf in my case.

      Get the MAC address of Bluetooth

      As I mentioned earlier, all networking devices have a physical address. If you want to see the MAC address of your Bluetooth adapter, you can use this command:

      You can see it beside the BD Address field.

      [email protected]:~$ hciconfig hci0: Type: Primary Bus: USB BD Address: DC:41:A9:FB:7A:C4 ACL MTU: 1021:4 SCO MTU: 96:6 UP RUNNING RX bytes:17895787 acl:275 sco:250783 events:298882 errors:0 TX bytes:303664302 acl:295384 sco:249895 commands:3380 errors:0

      You can also use the bluetoothctl command here.

      Method 2: Get MAC address using GUI

      If you’re afraid of using the terminal you can use the network settings to get the MAC address details.

      I am using Ubuntu with the GNOME desktop environment. If you use some other desktop environments, the screenshots may not look the same.

      First, search for settings in the system menu and open the first result.

      search for settings in system menu

      Now, for the left menu bar, select Network and click on the little gear icon located near to wired network toggle. Even if you’re not connected to a wired network, you can still follow the same approach.

      select networks and click on gear icon

      If you’re on Wi-Fi, there will be an option for Wi-Fi in the left menu bar. From there, you have to follow the same approach (clicking on the gear icon) to get your MAC address.

      Once you click on the gear icon, you’ll be met with details of the selected network interface. Here, the MAC address is given as the Hardware address.

      find mac address using gui

      Here you have it in the easiest way possible!

      Final Words

      Did you know that the first half of hexadecimal code (24 bits) is used to represent the manufacturer of your network adapter?

      Finding a MAC address in Linux is quite easy as you have seen it here. On the same note, you may like to learn about changing the MAC address in Linux.

      Let me know if you have any questions or suggestions.

      Источник

      Retrieve paired Bluetooth devices from console

      Is there any way to retrieve all paired bluetooth devices («Friendly name» and MAC-Adress) from the console? Is there any universal solution for any Linux distribution? In case there isn’t: I’m using an Ubuntu derivative. I already tried some stuff with hcitool , but nothing worked so far.

      3 Answers 3

      Late to the party, I tried listing as suggested by @panmari and @MarkCh but I was getting some unknown mac addresses (on a C.H.I.P with Debian), so I used the following command:

      It will return both friendly name and Mac of all paired devices.

      I found a solution myself. In Linux, the friendly names with their according mac adresses are saved in the file:

      It should be easy enough to read it out with a shell script or the programming language of your choice.

      This directory does not exist on Ubuntu 17, nor the file names , but /var/lib/bluetooth///info exists

      Install bluez-utils , run bluetoothctl paired-devices . See bluetoothctl —help for more useful commands.

      I am using Raspian on Raspberry Pi 4 and connected my Bluetooth keyboard via the GUI. After setting boot mode to CLI it did not work anymore. bluez-tools (now bluez) was already installed. After starting bluetoothctl I saw with the command paired-devices , that no keyboard was connected. With scan on I was able to find out the device address and pair it with pair , trust it with trust and connect it with connect

      Источник

      Easier way to connect to Bluetooth device

      Is there a way to connect to a USB device in fewer steps than this?

      4 Answers 4

      Take a look at a similar question/answer here.

      First, the MAC Address of the Bluetooth device is needed. You can find it by running the following commands:

      1. sudo systemctl start bluetooth
      2. bluetoothctl (a new bash prompt «[bluetooth]#» will be visible after running this command)
      3. devices
      4. Look for the MAC Address of your Bluetooth device by searching through the names of the device listed, assuming the device is powered on and visible.

      Finally, run the following commands which start the Bluetooth service and passes the commands through the echo program. These two commands are what you need to connect to your bluetooth device over the terminal.

      1. sudo systemctl start bluetooth
      2. echo -e ‘connect YOUR_DEVICE_MAC_ADDRESS \nquit’ | bluetoothctl

      This can be put in a bash script and the bash script can be automated to run upon startup.

      Just typing bluetoothctl was sufficient to find the MAC address (at least if the device is already connected). And echo «connect $DEVICE_MAC» | bluetoothctl was sufficient to establish a connection when not currently connected. So scripting it would work. Running the script on startup is not useful for me. But calling the script from a hotkey should work.

      Though I didn’t use this answer exactly the way it was written. It still gave me the information I needed to create a hotkey to achieve the desired effect.

      @kasperd Could you tell which command did you use exactly for the hotkey? I tried the mentioned command but it didn’t work for me.

      In addition to the CLI-based solutions in other answers, there is a Gnome extension called Bluetooth quick connect which streamlines the GUI a lot. It adds a toggle button to the Bluetooth menu for each paired device, which cuts your number of clicks down to three.

      The easiest way to install Gnome extensions is to first install the Gnome extensions manager ( apt install gnome-shell-extensions ) and the Firefox plugin (which will be linked at the top of the extension’s webpage). After that, installing any Gnome extension is just a case of clicking the toggle button at the top of the corresponding webpage.

      Источник

      Читайте также:  Xiaomi низкая громкость bluetooth
Оцените статью
Adblock
detector