org-deur / a8t

a2t -- t2a
Apache License 2.0
0 stars 1 forks source link

Guide: Bluetooth command line tools for linux #2

Open thinhori03 opened 1 month ago

thinhori03 commented 1 month ago

To enable Bluetooth on Linux via the command line, you can use the following steps:

  1. ensure your linux user in bluetooth group.
  groups $USER
  1. Check if Bluetooth is installed:

    Make sure the Bluetooth utilities are installed. On most distributions, the package is called bluez. Install it if it's not present:

    • Debian/Ubuntu:

      sudo apt install bluez
    • Fedora:

      sudo dnf install bluez
    • Arch Linux:

      sudo pacman -S bluez
  2. Start the Bluetooth service:

    Start the Bluetooth service using systemctl:

    sudo systemctl start bluetooth

    To ensure the Bluetooth service starts automatically at boot:

    sudo systemctl enable bluetooth
  3. Check the status of Bluetooth:

    You can check if Bluetooth is active with:

    sudo systemctl status bluetooth
  4. Enable the Bluetooth adapter (if needed):

    If the Bluetooth adapter is powered off, you can turn it on using bluetoothctl:

    bluetoothctl
    power on
  5. Pairing and Connecting Devices:

    Inside the bluetoothctl interactive shell:

    • To list available devices:

      devices
    • To start scanning for devices:

      scan on
    • To pair with a device:

      pair <device_mac_address>
    • To connect to a paired device:

      connect <device_mac_address>
    • To trust a device:

      trust <device_mac_address>
  6. Exit bluetoothctl:

    When you're done, exit the bluetoothctl interactive shell by typing:

    exit

This should enable Bluetooth and allow you to manage your Bluetooth devices via the command line.

thinhori03 commented 1 month ago

resolved.