NST Bluetooth FAQ: Difference between revisions
(Started page with some Bluetooth notes) |
mNo edit summary |
||
Line 11: | Line 11: | ||
sudo systemctl start bluetooth.service | sudo systemctl start bluetooth.service | ||
You can enable it so it is started at boot time via: | |||
sudo systemctl enable bluetooth.service | |||
== How Do I Add A Bluetooth Device Using a Desktop Application? == | == How Do I Add A Bluetooth Device Using a Desktop Application? == | ||
Line 24: | Line 28: | ||
== How Do I Add A Bluetooth Device Using the Command Line? == | == How Do I Add A Bluetooth Device Using the Command Line? == | ||
* | * Run the ''bluetoothctl'' program. This will bring up an interactive tool: | ||
[root@refritos ~]# bluetoothctl | [root@refritos ~]# bluetoothctl | ||
[NEW] Controller 00:C2:C6:E9:C3:BF refritos [default] | [NEW] Controller 00:C2:C6:E9:C3:BF refritos [default] | ||
[NEW] Device 90:7F:61:00:3B:15 ThinkPad Compact Bluetooth Keyboard with TrackPoint | [NEW] Device 90:7F:61:00:3B:15 ThinkPad Compact Bluetooth Keyboard with TrackPoint | ||
Agent registered | Agent registered | ||
* Use the ''scan on'' command to find nearby devices: | |||
[ThinkPad Compact Bluetooth Keyboard with TrackPoint]# scan on | [ThinkPad Compact Bluetooth Keyboard with TrackPoint]# scan on | ||
Discovery started | Discovery started | ||
Line 46: | Line 48: | ||
[CHG] Device EB:D0:36:B3:9F:6D RSSI: -68 | [CHG] Device EB:D0:36:B3:9F:6D RSSI: -68 | ||
* You can turn off scanning at this point: | * You can turn off scanning at this point: | ||
[ThinkPad Compact Bluetooth Keyboard with TrackPoint]# scan | [ThinkPad Compact Bluetooth Keyboard with TrackPoint]# scan off | ||
[CHG] Device EB:D0:36:B3:9F:6D TxPower is nil | [CHG] Device EB:D0:36:B3:9F:6D TxPower is nil | ||
[CHG] Device EB:D0:36:B3:9F:6D RSSI is nil | [CHG] Device EB:D0:36:B3:9F:6D RSSI is nil |
Latest revision as of 18:09, 3 January 2018
Bluetooth General
What Services Need to Be Running?
The bluetooth.service needs to be running. You can check its status via:
systemctl status bluetooth.service
You can start it via:
sudo systemctl start bluetooth.service
You can enable it so it is started at boot time via:
sudo systemctl enable bluetooth.service
How Do I Add A Bluetooth Device Using a Desktop Application?
- Start the Bluetooth program found under System|Preferences|Hardware on the MATE desktop.
- Turn on your Bluetooth device and put it into pairing mode (there is often a device specific button or sequence to press).
- Look for the device to appear in the list of available Bluetooth devices. It will be labeled as Not Set Up (see Bluetooth Optic Mouse in the image below).
- Select the device to set up.
- For simple devices (like a mouse), you should be done at this point.
How Do I Add A Bluetooth Device Using the Command Line?
- Run the bluetoothctl program. This will bring up an interactive tool:
[root@refritos ~]# bluetoothctl [NEW] Controller 00:C2:C6:E9:C3:BF refritos [default] [NEW] Device 90:7F:61:00:3B:15 ThinkPad Compact Bluetooth Keyboard with TrackPoint Agent registered
- Use the scan on command to find nearby devices:
[ThinkPad Compact Bluetooth Keyboard with TrackPoint]# scan on Discovery started [CHG] Controller 00:C2:C6:E9:C3:BF Discovering: yes
- Put your Bluetooth device in pairing mode, you should see a NEW entry appear in the bluetoothctl scanning output.
[CHG] Device EB:D0:36:B3:9F:6D RSSI: -68 [CHG] Device EB:D0:36:B3:9F:6D TxPower: -6 [CHG] Device EC:55:F9:F1:FF:8C RSSI: -49 [CHG] Device EC:55:F9:F1:FF:8C TxPower: 0 [NEW] Device 00:12:67:19:6B:40 Bluetooth Optic Mouse [CHG] Device C4:85:08:44:22:43 RSSI: -64 [CHG] Device C4:85:08:44:22:43 RSSI: -74 [CHG] Device EB:D0:36:B3:9F:6D RSSI: -76 [CHG] Device EB:D0:36:B3:9F:6D RSSI: -68
- You can turn off scanning at this point:
[ThinkPad Compact Bluetooth Keyboard with TrackPoint]# scan off [CHG] Device EB:D0:36:B3:9F:6D TxPower is nil [CHG] Device EB:D0:36:B3:9F:6D RSSI is nil [CHG] Device C4:85:08:44:22:43 RSSI is nil [CHG] Device EC:55:F9:F1:FF:8C TxPower is nil [CHG] Device EC:55:F9:F1:FF:8C RSSI is nil Discovery stopped [CHG] Controller 00:C2:C6:E9:C3:BF Discovering: no
- You can use the devices command to list all of the available devices discovered:
[ThinkPad Compact Bluetooth Keyboard with TrackPoint]# devices Device 90:7F:61:00:3B:15 ThinkPad Compact Bluetooth Keyboard with TrackPoint Device EB:D0:36:B3:9F:6D Flex Device EC:55:F9:F1:FF:8C CHANGA Device C4:85:08:44:22:43 MANGO Device 00:12:67:19:6B:40 Bluetooth Optic Mouse
- You should now be able to use the pair command to pair to the device.
[ThinkPad Compact Bluetooth Keyboard with TrackPoint]# pair 00:12:67:19:6B:40 Attempting to pair with 00:12:67:19:6B:40 [CHG] Device 00:12:67:19:6B:40 Connected: yes [CHG] Device 00:12:67:19:6B:40 Modalias: usb:v1131p3501d0611 [CHG] Device 00:12:67:19:6B:40 UUIDs: 00001124-0000-1000-8000-00805f9b34fb [CHG] Device 00:12:67:19:6B:40 UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Device 00:12:67:19:6B:40 ServicesResolved: yes [CHG] Device 00:12:67:19:6B:40 Paired: yes Pairing successful [CHG] Device 00:12:67:19:6B:40 ServicesResolved: no [CHG] Device 00:12:67:19:6B:40 Connected: no
- You can use the trust command to indicate that you trust the device (not certain when this is necessary - it was not actually necessary for my Bluetooth mouse)
[ThinkPad Compact Bluetooth Keyboard with TrackPoint]# trust 00:12:67:19:6B:40 [CHG] Device 00:12:67:19:6B:40 Trusted: yes Changing 00:12:67:19:6B:40 trust succeeded
- You can use the connect command to then connect the Bluetooth device to your system.
[ThinkPad Compact Bluetooth Keyboard with TrackPoint]# connect 00:12:67:19:6B:40 Attempting to connect to 00:12:67:19:6B:40 [CHG] Device 00:12:67:19:6B:40 Connected: yes Connection successful [CHG] Device 00:12:67:19:6B:40 ServicesResolved: yes]#
- At this point your Bluetooth device should be working and you can use the info command to check its state.
[Bluetooth Optic Mouse]# info 00:12:67:19:6B:40 Device 00:12:67:19:6B:40 Name: Bluetooth Optic Mouse Alias: Bluetooth Optic Mouse Class: 0x002580 Icon: input-mouse Paired: yes Trusted: yes Blocked: no Connected: yes LegacyPairing: no UUID: Human Interface Device... (00001124-0000-1000-8000-00805f9b34fb) UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb) Modalias: usb:v1131p3501d0611 ManufacturerData Key: 0x5349 ManufacturerData Value: 0x53 ManufacturerData Value: 0x43
- Finally, you can use the exit command to terminate the bluetoothctl application.
[Bluetooth Optic Mouse]# exit Agent unregistered [DEL] Controller 00:C2:C6:E9:C3:BF refritos [default] [root@refritos ~]#
How Do I Scan for Bluetooth Devices?
This can be done using the Bluetooth GUI tool on the MATE Desktop, or by entering the scan on command in the bluetoothctl command line utility.
How Do I Enable Bluetooth Devices After Boot or Suspend?
I had an issue where my ThinkPad Compact Bluetooth Keyboard with TrackPoint would not connect after a system reboot or suspend/wake cycle. After a lot of Google searching, I was able to fix this issue by creating a udev configuration file /etc/udev/rules.d/10-local.rules with the following content:
# Set bluetooth power up ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"
NOTE: This still won't let you use your bluetooth keyboard to get into the BIOS settings or to select a boot option during a grub boot. However, it does seem to work once the Operating System is loaded.
Device Specific
How Do I Connect a ThinkPad Compact Bluetooth Keyboard with TrackPoint?
The following documents the steps to set up a Bluetooth keyboard (ThinkPad Compact Bluetooth Keyboard with TrackPoint in this case) on a NST or Fedora based system using the bluetoothctl command line tool.
- Start the bluetoothctl command line utility.
[root@refritos ~]# bluetoothctl [NEW] Controller 00:C2:C6:E9:C3:BF refritos [default] [NEW] Device 00:12:67:19:6B:40 Bluetooth Optic Mouse Agent registered
- Use the scan on command. Turn on the keyboard and then press and hold the switch on the keyboard for one second. Now wait until you see a NEW device entry for the keyboard.
[Bluetooth Optic Mouse]# scan on Discovery started [CHG] Controller 00:C2:C6:E9:C3:BF Discovering: yes [NEW] Device EB:D0:36:B3:9F:6D Flex [NEW] Device C4:85:08:44:22:43 MANGO [NEW] Device 90:7F:61:00:3B:15 ThinkPad Compact Bluetooth Keyboard with TrackPoint [NEW] Device EC:55:F9:F1:FF:8C CHANGA
- At this point you can use the scan off command to stop scanning.
[Bluetooth Optic Mouse]# scan off [CHG] Device EC:55:F9:F1:FF:8C TxPower is nil [CHG] Device EC:55:F9:F1:FF:8C RSSI is nil [CHG] Device 90:7F:61:00:3B:15 RSSI is nil [CHG] Device C4:85:08:44:22:43 TxPower is nil [CHG] Device C4:85:08:44:22:43 RSSI is nil [CHG] Device EB:D0:36:B3:9F:6D TxPower is nil [CHG] Device EB:D0:36:B3:9F:6D RSSI is nil [CHG] Controller 00:C2:C6:E9:C3:BF Discovering: no Discovery stopped
- Use the devices command to find the ID of the keyboard discovered during the scan.
[Bluetooth Optic Mouse]# devices Device 00:12:67:19:6B:40 Bluetooth Optic Mouse Device EB:D0:36:B3:9F:6D Flex Device C4:85:08:44:22:43 MANGO Device 90:7F:61:00:3B:15 ThinkPad Compact Bluetooth Keyboard with TrackPoint Device EC:55:F9:F1:FF:8C CHANGA
- Use the pair command to pair to the keyboard. NOTE: The pairing process will prompt you to enter a Passkey generated by the keyboard. The key to enter may be in LIGHT GRAY on WHITE and very difficult to read (try highlighting with a mouse)! Enter the numbers shown on the Bluetooth keyboard being paired and then press the Enter key.
[Bluetooth Optic Mouse]# pair 90:7F:61:00:3B:15 Attempting to pair with 90:7F:61:00:3B:15 [CHG] Device 90:7F:61:00:3B:15 Connected: yes [agent] Passkey: 555730 [agent] Passkey: 555730 [agent] Passkey: 555730 [agent] Passkey: 555730 [agent] Passkey: 555730 [agent] Passkey: 555730 [agent] Passkey: 555730 [CHG] Device 90:7F:61:00:3B:15 Modalias: usb:v17EFp6048d0312 [CHG] Device 90:7F:61:00:3B:15 UUIDs: 00001000-0000-1000-8000-00805f9b34fb [CHG] Device 90:7F:61:00:3B:15 UUIDs: 00001124-0000-1000-8000-00805f9b34fb [CHG] Device 90:7F:61:00:3B:15 UUIDs: 00001200-0000-1000-8000-00805f9b34fb [CHG] Device 90:7F:61:00:3B:15 ServicesResolved: yes [CHG] Device 90:7F:61:00:3B:15 Paired: yes Pairing successful [CHG] Device 90:7F:61:00:3B:15 ServicesResolved: no [CHG] Device 90:7F:61:00:3B:15 Connected: no
- Use the trust command to indicate that you trust the device (not certain this is necessary, but I do it as it seems like something that might be required to auto-pair at boot time).
[Bluetooth Optic Mouse]# trust 90:7F:61:00:3B:15 [CHG] Device 90:7F:61:00:3B:15 Trusted: yes Changing 90:7F:61:00:3B:15 trust succeeded
- Finally, connect to the keyboard using the connect command.
[Bluetooth Optic Mouse]# connect 90:7F:61:00:3B:15 Attempting to connect to 90:7F:61:00:3B:15 [CHG] Device 90:7F:61:00:3B:15 Connected: yes Connection successful [CHG] Device 90:7F:61:00:3B:15 ServicesResolved: yes
- At this point the keyboard should be working and you can exit the bluetoothctl command.
[ThinkPad Compact Bluetooth Keyboard with TrackPoint]# exit Agent unregistered [DEL] Controller 00:C2:C6:E9:C3:BF refritos [default] [root@refritos ~]#
NOTE: This only gets your keyboard working until the next time you suspend or reboot the machine. If you want the keyboard working after a reboot or suspend/resume cycle, create a udev configuration file /etc/udev/rules.d/10-local.rules with the following content:
# Set bluetooth power up ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"