KYIT

Linux Bluetooth not work

Error: sap

sudo systemctl status bluetooth

● bluetooth.service - Bluetooth service
Loaded: loaded (/lib/systemd/system/bluetooth.service; disabled; vendor preset:
Active: active (running) since 四 2022-01-20 16:17:41 CST; 7s ago
Docs: man:bluetoothd(8)
Main PID: 29774 (bluetoothd)
Status: "Running"
Tasks: 1
Memory: 2.1M
CPU: 39ms
CGroup: /system.slice/bluetooth.service
└─29774 /usr/lib/bluetooth/bluetoothd

-bluetoothd[pid]: Sap driver initialization failed.
-bluetoothd[pid]: sap-server: Operation not permitted

What is sap

SIM Access Profile (SAP) allows a Bluetooth enabled device to access data contained in the SIM card of another Bluetooth enabled device.

You probably don't need this function, so you can disable it.

sudo mkdir /etc/systemd/system/bluetooth.service.d/
sudo vi /etc/systemd/system/bluetooth.service.d/01-disable-sap-plugin.conf

[Service]
ExecStart=
ExecStart=/usr/lib/bluetooth/bluetoothd --noplugin=sap

sudo systemctl daemon-reload
sudo systemctl restart bluetooth.service

Note: The double usage of ExecStart= in the SystemD bluetooth.service.d override file is important!

The first line with empty assignment, "ExecStart=", clears out the value of ExecStart so we can override it later rather than append to it.

Some SystemD settings such as ExecStart behave as an appended list when specifying them multiple times.

Many options that you want to override will apply to this use case when we use foo.service.d/*.conf files.

So it's important to notice that an extra Foo= setting may be necessary to override a value rather than append to a list.