Turn bluetooth on linux

How to Turn On or Off Bluetooth in Ubuntu Linux

This post shows students and new users steps to enable or disable Bluetooth on Ubuntu Linux to connect or disconnect from nearby devices.

Bluetooth is a wireless technology that allows your computers, smartphones, and mobile devices to connect to other Bluetooth-enabled devices nearby.

With Bluetooth enabled in Ubuntu Linux, you can stream music, connect to devices like speakers, headphones, keyboards, mouse, send data, and communicate with nearby devices wirelessly with ease.

There are multiple ways to turn On or Off Bluetooth on your computer. Some computers come with a dedicated Bluetooth button that sits on top of the keyboard area, and/or on either side of the computer.

The physical Bluetooth switch on your computer allows you to quickly turn off or turn on your Bluetooth device. There’s also another way to turn off Bluetooth on Ubuntu Linux, and we’ll also show you how to do that.

Disabling and enabling Bluetooth in Ubuntu Linux is something that hasn’t changed much. Similar to previous editions of Ubuntu, the process is still the same.

To get started with disabling and enabling Bluetooth on Ubuntu Linux, follow the steps below:

How to turn off or on Bluetooth on Laptop

As we mentioned above, there are multiple ways to turn on or turn off Bluetooth on Ubuntu Linux. One way is using your computer’s Bluetooth button.

If your laptop is equipped with a physical Bluetooth button, you can quickly turn it on or off the Bluetooth device simply by toggling the button to the On or Off position or tapping it to disable or enable it.

How to turn on or off Bluetooth on Ubuntu

If your computer does not have a physical Bluetooth switch or button, then you can turn off or on Bluetooth from within Ubuntu Linux.

The Bluetooth icon appears in the top system menu when one or more Bluetooth devices are connected. You can see icons for volume, network, Bluetooth, and a few others. The top panel should look similar to the one below:

If you don’t see the Bluetooth signal icon on the top system menu, simply click the System Menu area to show the menu options. On the menu options, select Turn Off Bluetooth if it’s already On, or Turn On if it’s Off.

You can also bring up the Bluetooth panel from the system menu option. Click Bluetooth Settings to open the panel.

To connect to a Bluetooth device, use the panel. Then when a list of nearby Bluetooth devices shows up, select the one you want to pair with.

Читайте также:  Код блютуз телевизора самсунг

Confirm the Bluetooth connection PIN to pair with other devices.

How to disable or enable Bluetooth on Ubuntu Linux

In some situations, you may want to completely disable Bluetooth in Windows, and not just disconnect. You can do that via the Bluetooth settings panel.

To disable Bluetooth on Ubuntu Linux from the desktop, click on the click the “Show Applications” button from the bottom left or press the Super key (WIN) on your keyboard.

On the Activities overview dashboard, start typing Bluetooth in the search box. Select the Bluetooth app to open the panel. From there you can quickly disable and enable Bluetooth by toggling the button to the On or Off position.

That will turn Off or On the Bluetooth on Ubuntu Linux. You can now exit the settings panel and you’re done.

This post showed you how to enable or disable Bluetooth on Ubuntu Linux. If you find any error above, please use the comment form below to report.

Richard W

I love computers; maybe way too much. What I learned I try to share at geekrewind.com.

Источник

Bluetoothctl: Management of Bluetooth Devices in Linux

bluetoothctl - management of bluetooth devices in Linux

This article is about the Management of Bluetooth devices in Linux using a command-line tool called bluetoothctl. In this, I will talk about how to connect with a Bluetooth device in Linux. I have also given a little hint in the end about how to automate this whole scanning, connecting, and other processes just with a script.

Alternatively, we can use Graphical Tools like GNOME Bluetooth, Bluedevil, Blueman. But like all other Graphical Tools, they are bloated, they lack the ability of scripting, and they cannot be used without X11 or Wayland. These restrictions are mitigated by using a command-line utility called bluetoothctl .

Table of Contents

Installation and Early Preparation

~$ sudo pacman -S bluez bluez-utils 
~$ sudo dnf install bluez bluez-tools

Now, enable the bluetooth.service using following systemd‘s command

~$ sudo systemctl enable bluetooth.service

The above is to enable the Bluetooth service in the background. But it requires restarting your system. If you do not want to restart, execute the following command as well:

~$ sudo systemctl start bluetooth.service

Note: Make sure that kernel module btusb is loaded into the system. Kernel modules are equivalent to drivers in Windows OS. If it is not loaded, load it using

Now, I will be describing how to connect to a Bluetooth device using my smartphone as an example in the following steps.

Step 1: Get into Bluetoothctl’s Interactive Mode

Like nmtui, bluetoothctl’s interactive mode is easier to work with during the first-time connection. And like nmcli, the non-interactive mode is good for scripting.

To get into interactive mode, use

Output may look like this:

Agent registered [CHG] Controller F8:89:D6:C8:2E:54 Pairable: yes [bluetooth]# 

Notice, how the prompt is changing from ~$ to [bluetooth]# . Now, you can execute any command like help after the # symbol. Use help to find all existing commands and their one-liner explanations.

After following all the steps, you can quit using

Step 2: Turn on Bluetooth in Linux

To turn on the Bluetooth, use power on command:

In my system, I get the following output:

[CHG] Controller F8:89:D2:C8:2E:54 Class: 0x006c010c Changing power on succeeded

Similarly, to turn it off, you can use the power off command.

Читайте также:  Bluetooth transmitter aptx adaptive

Step 3: Scan for Available Bluetooth Devices

First list available devices using

[bluetooth]# devices Device 40:45:DA:B8:AB:BB 34SUPER Device 04:C8:07:12:D0:2D LG Q3

If you cannot find your device in the output, use the following command:

As you turn on your Bluetooth device (in the above example, my new smartphone), bluetoothctl will list it in the output. After you have found your device, copy its address for future use.

If you want your Linux computer to be discoverable by other devices, use the command given below. But for my tutorial, it is not necessary.

[bluetooth]# discoverable on

Step 4: Connect to Your Bluetooth Device

We can do it in two ways:
1. Pair and then Connect.
2. Trust and then Connect. I find it simpler, less confusing and it works for me with all kinds of devices. Hence, I will be describing this in detail.

1. Pair and Connect

Turn on the pairing in your Bluetooth device (ex – smartphone). Then, Turn on the pairing in your Linux computer using

[bluetooth]# pair 90:78:B2:C7:8F:A8
[bluetooth]# connect 90:78:B2:C7:8F:A8

Now, you might get a prompt to accept the connection. Just say yes.

2. Trust and Connect

First, you need to trust your device using the following :

[bluetooth]# trust 90:78:B2:C7:8F:A8
[CHG] Device 90:78:B2:C7:8F:A8 Trusted: yes Changing 90:78:B2:C7:8F:A8 trust succeeded

Now, bluetoothctl saves your device’s address on your computer. In the future, you will not be needing to trust the device anymore. This saving is preserved even over system-restart. Now, you can connect with the device using:

[bluetooth]# connect 90:78:B2:C7:8F:A8

Now, you might get a prompt to accept the connection. Just say yes. It might even ask you to match passkey/pin. For my smartphone, the output is

Request confirmation [agent] Confirm passkey 989960 (yes/no): yes [CHG] Device 90:78:B2:C7:8F:A8 Paired: yes Connection successful

Scripting using bluetoothctl in non-interactive mode

We can execute the above-mentioned commands in non-interactive mode as well by prepending bluetoothctl with them. For example, power on command becomes

So, if you want to connect to your Bluetooth device using a single command, use the following:

~$ bluetoothctl power on && bluetoothctl connect 90:78:B2:C7:8F:A8

Note: As stated above, don’t forget to trust your device 90:78:B2:C7:8F:A8 before executing the above command – We need to do this only once in our lifetime.

Scripting is one of the things I love about Linux – You can merge one command with another and boost your productivity.

This can be seen with my current usage of the above command with the nmcli command to share my smartphone’s internet with the computer. It is reasonably fast – it can play Youtube videos at 720p. at the same time, Bluetooth consumes much less energy than Wi-Fi.

~$ bluetoothctl power on && bluetoothctl connect 90:78:B2:C7:8F:A8 && nmcli connection up id 'Mi A3 Network'

Other Bluetoothctl Commands

When we used the devices command, we got a list of devices. If you want to remove your device from the list due to privacy reasons, use the following in interactive mode:

[bluetooth]# remove 90:78:B2:C7:8F:A8

And if you no longer want your device to be trusted any more use:

[bluetooth]# untrust 90:78:B2:C7:8F:A8

To disconnect, there are many methods:
1. Toggle the Bluetooth switch on your Bluetooth device and/or computer.
2. Use bluetoothctl power off command from your terminal.
3. Or, use the standard method bluetoothctl disconnect 90:78:B2:C7:8F:A8

Читайте также:  Паджеро 4 блютуз модуль

Conclusion

There are many more options to explore in bluetoothctl, just read them in bluetoothctl help. Now you can use Bluetooth for sharing files/internet/audio.

Occasionally, you might face a few bugs. Sometimes, restarting the computer might fix them. And if the problem still persists, put them in the comment section below. I have a few solutions and putting them here will make the article lengthy.

That’s all. And also do not forget to notify me any mistakes committed by me in this article if any.

Источник

Turn on/off Bluetooth from shell not from applet

I want to be able to turn on and off the Bluetooth as is being done from the applet button. How can I do this?

7 Answers 7

The commands you’re looking for are:

Thank you, works on Pop_OS! 22.04. My trackpad was someone turned off — happened only when I am not logged in, otherwise the trackpad worked when I was logged out. After executing your commands I managed to get a hold of my blue tooth mouse and go into the settings to enable the trackpad.

sudo /etc/init.d/bluetooth stop 
sudo /etc/init.d/bluetooth start 
sudo /etc/init.d/bluetooth restart 

this is not correct. turning off bluetooth and stopping the service are different things (most notably, the latter requires sudo permissions).

On systems that use systemd , including Ubuntu 15.04 and later:

systemctl start bluetooth 

for turning off Bluetooth

systemctl restart bluetooth 

werewolf_65 — FYI you can omit .service because it is assumed if there is no extension (and who likes typing)

I also discovered that I had too reboot, as there was some state info that wasn’t reset without that. Now all is working properly — I hope this helps others. Beware of attempting to turn on bluetooth through Settings. And when working with keyboard/mouse that used a 2.4 Ghz dongle, I needed the bluttooth on, even though I would have thought that as being irrelevant.

Источник

Включение и выключение Bluetooth

Вы можете включить Bluetooth для подключения к другим Bluetooth-устройствам или отключить его для экономии энергии. Чтобы включить Bluetooth:

  1. Откройте Обзор и начните вводить: Bluetooth .
  2. Нажмите Bluetooth для открытия панели.
  3. Включите переключатель на панели заголовка.

На многих ноутбуках есть аппаратный переключатель или комбинация клавиш для включения и выключения Bluetooth. Найдите переключатель на компьютере или клавишу на клавиатуре. Доступ к этой клавише часто осуществляется с помощью клавиши Fn .

Чтобы выключить Bluetooth:

Компьютер остаётся видимым пока открыта панель Bluetooth .

Дополнительная информация

  • Bluetooth — Подключение к устройствам через Bluetooth для передачи файлов или использования беспроводного аудио.

You can choose the displayed language by adding a language suffix to the web address so it ends with e.g. .html.en or .html.de.
If the web address has no language suffix, the preferred language specified in your web browser’s settings is used. For your convenience:
[ Change to English Language | Change to Browser’s Preferred Language ]

The material in this document is available under a free license, see Legal for details.
For information on contributing see the Ubuntu Documentation Team wiki page. To report errors in this documentation, file a bug.

Источник

Оцените статью
Adblock
detector