"Raspberry Pi" Raspberry Pi 3 Bluetooth connection configuration record with phone

Source: Internet
Author: User

Configuring the Raspberry Pi 3 is a Bluetooth-enabled connection.

This allows for file transfer, or audio, etc. can be used, can bring some convenience.

How do you do it specifically? I practiced a bit, found that it is possible, the following intercept some of the relevant commands and so on for reference.

One. Bluetooth pairing between Raspberry Pi and mobile phone:

Raspberry Pi 3 directly support Bluetooth, using the direct use of the command, you first open the Bluetooth device to connect, and then configure the Raspberry Pi:

[Email protected]:~ $sudobluetoothctl[sudo] Password forLIFECCP: [NEW] Controller B8: -: Eb:f4: the: 7E raspberrypi [default][bluetooth]# listcontroller B8: -: Eb:f4: the: 7E raspberrypi [default][bluetooth]# Power onchanging Power on succeeded[bluetooth]# scan ondiscovery Started[chg] C Ontroller B8: -: Eb:f4: the: 7E discovering:yes[new] Device the:D 9: +:Geneva: Ed:ad the-d9- +-Geneva-ed-ad[bluetooth]# agent Onagent registered[new] Device 7c:e9:d3:be: the: theDouhao-pc

Look at the above commands, the first configuration of the classmate may not know how to go. It doesn't matter, the following is helpful information, the official provides a lot of help information can refer to:

[bluetooth]# helpavailable commands:list list available controllers show [Ctrl] Controller InformationSelect<ctrl>Select Default controller devices List available devices paired-devices List paired devices power<on/off>Set Controller Power pairable<on/off>Set Controller pairable mode discoverable<on/off>Set Controller discoverable mode agent<on/off/capability> enable/Disable Agent with given capability default-Agent Set Agent as the default one scan<on/off> Scan forDevicesInfo<dev>Device Information Pair<dev>Pair with Device trust<dev>Trust Device Untrust<dev>untrust Device Block<dev>Block Device unblock<dev>Unblock Device Remove<dev>Remove Device Connect<dev>Connect Device Disconnect<dev>Disconnect Device version Display version quit Quit program

After reading these commands, I basically know how to operate them.

The following records some of the commands I've practiced:

[bluetooth]# listcontroller B8: : eb:f4:7Eraspberrypi [Default]

Look at the currently searchable Bluetooth device:

#查找设备
:D 9: £º-d9---ed-addevice 7c:e9:d3:be: £ douhao- : 0c:4e:dc:- -0c-4e-dc-,Geneva

Connection pairing:

[bluetooth]# pair FC:ba:c2:7b: Attempting topair with FC:: ba:c2:7b:57  [CHG] Device FC:: ba:c2:7b:744237 (yes/77 :D 9:-d9---ed-ad

Add Trust:

[bluetooth]# Trust FC:ba:c2:7b:[CHG] Device FC:: ba:c2:7b: trusted:yeschanging FC: : ba:c2:7b: succeeded Trust

Connecting devices:

[bluetooth]# Connect FC: -: ba:c2:7b: $attempting to connect to FC: -: ba:c2:7b: $[CHG] Device FC: -: ba:c2:7b: $Connected:yes[chg] Device FC: -: ba:c2:7b: $Modalias:bluetooth:v0046p0802d0903[chg] Device FC: -: ba:c2:7b: $UUIDs:00001105-0000- +-8000-00805F9B34FB 0000110a-0000- +-8000-00805F9B34FB 0000110c-0000- +-8000-00805F9B34FB 0000110f-0000- +-8000-00805F9B34FB00001112-0000- +-8000-00805F9B34FB00001115-0000- +-8000-00805F9B34FB00001116-0000- +-8000-00805F9B34FB 0000111f-0000- +-8000-00805F9B34FB 0000112f-0000- +-8000-00805F9B34FB00001132-0000- +-8000-00805F9B34FB00001200-0000- +-8000-00805F9B34FB00001800-0000- +-8000-00805f9b34fb

Here are 2 photos:

(1) on the mobile phone see this prompt, select "Pairing";

(2) After the pairing is successful, the relevant Raspberry Pi device is visible in the paired list;

Stop using:

When the end of use, want to turn off Bluetooth, you can do this:

[bluetooth]# Scan off
[CHG] Device 7f:bb:20:bb:0f:ce RSSI is nil
[CHG] Device 7c:e9:d3:be:49:15 RSSI is nil
[CHG] Device d0:03:4b:35:6e:c1 RSSI is nil
[CHG] Device 55:34:0c:4e:dc:04 RSSI is nil
[CHG] Device d4:a7:4e:10:54:5a RSSI is nil
[CHG] Device fc:64:ba:c2:7b:57 RSSI is nil
Discovery stopped
[CHG] Controller b8:27:eb:f4:42:7e Discovering:no


[bluetooth]# Power off
Changing power off succeeded
[CHG] Controller b8:27:eb:f4:42:7e Powered:no
[CHG] Controller b8:27:eb:f4:42:7e Discovering:no


[bluetooth]# discoverable off
Failed to set discoverable off:org.bluez.Error.Failed


[bluetooth]# Agent off
Agent unregistered
[DEL] Device d4:a7:4e:10:54:5a MI Band 2
[DEL] Device 55:34:0c:4e:dc:04 55-34-0c-4e-dc-04
[DEL] Device D0:03:4B:35:6E:C1 D0-03-4B-35-6E-C1
[DEL] Device 7c:e9:d3:be:49:15 douhao-pc
[DEL] Device 7f:bb:20:bb:0f:ce 7f-bb-20-bb-0f-ce

If you want to connect the speaker device, you need to install the relevant components:

sudo Install PulseAudio pulseaudio-module-bluetooth

Two. Other Notes:

Bluetoothctl
Pairing with the command line is the most reliable choice. The exact pairing process varies depending on the device type and the input functions provided. The following is a general procedure for pairing using/usr/bin/bluetoothctl:
Starts the bluetoothctl Interactive command. You can enter Help to list all the valid commands.
Enter power on command to turn on the controller. The default is off.
Enter the devices command to get the MAC address of the device you want to pair.


If the device is not listed in the manifest, enter the scan on command to set the device Discovery mode.
Enter the agent on command to open the proxy.
Enter pair MAC Address to start pairing (Support tab completion).
If you are using a pin-free device, reconnecting may require manual authentication. Enter the trust MAC Address command.
Finally, use the Connect mac_address command to establish the connection.

Three. Other FAQs:

FAQ1: My computer is not visible

If you can't find your computer on your mobile phone, open Pscan and Iscan:

# Open Pscan and iscan$ hciconfig hci0 piscan # Confirm operation Valid $ hciconfig hci0:   type:usb        BD address:00:12:34:56:78:9a ACL MT U:192:8 SCO mtu:64:8 up        RUNNING pscan ISCAN        RX bytes:20425 acl:115 sco:0 events:526 errors:0        TX byt es:5543 acl:84 sco:0 commands:340 errors:0
Note:Check for discovery Countdown and pairing countdown in/etc/bluetooth/main.conf

Try changing the class of the device at/etc/bluetooth/main.conf

# Default Device class. Only the major and minor device class bits are# considered. #Class = 0x000100 (from default config) class = 0x100100

This is the only way to make the computer visible to the phone at the moment.

FAQ2:nautilus cannot browse files

If Nautilus cannot open and displays the following error:

Nautilus cannot handle obex:locations. Couldn ' t display "obex://[xx:xx:xx:xx:xx:xx]/".

To install the GVFS-OBEXFTP package:

# pacman-s Gvfs-obexftp

Of course, here are just a few shallow basic use, want to further research and application, the suggestion can refer to some official documents: Https://wiki.archlinux.org/index.php/Bluetooth_ (%e7%ae%80%e4%bd%93 %e4%b8%ad%e6%96%87), relatively more complete, updated and more timely.

"Raspberry Pi" Raspberry Pi 3 Bluetooth connection configuration record with phone

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.