Turn Bluetooth on and off in Settings. Pair devices, exchange files, use a Bluetooth Internet connection (PAN) and connect keyboards or mice with bluetoothctl and fplinux-bluetooth in a shell on the phone. Optional packages add A2DP audio output. Check support status and your phone page for the supported functions, peers and profiles before using a procedure below.
These procedures apply to supported UMS9117 phones. Bluetooth is unsupported on the SC9820E Xiaomi Qin 1s+; preparing optional radio data does not enable it.
Bluetooth needs firmware taken from the same phone, which is part of its device data. An image built without it boots normally but has no Bluetooth. Do not use firmware copied from another phone.
Bluetooth starts powered off. Keep the USB connection to your computer while you set it up: it stays your way to manage the phone and is independent of Bluetooth.
Run fplinux-bluetooth --help for the list of commands, and add --help after a command, such as fplinux-bluetooth receive --help, for its syntax.
Turn Bluetooth on and off
Section titled “Turn Bluetooth on and off”In the graphical session, open Settings → Bluetooth and press Turn on or Turn off. The Quick settings on Home have the same switch. Both show the current state, including a change made with bluetoothctl, and are listed only while the Bluetooth controller is available. If the change fails, an error asks you to try again.
In a shell:
bluetoothctl power onbluetoothctl power offPairings are kept while Bluetooth is off.
Pair with a computer or another phone
Section titled “Pair with a computer or another phone”You need bluetoothctl on both devices. Send each command separately and wait for it to finish before sending the next. Identify each device by the exact address that show prints.
-
On the phone, open a short pairing window:
Phone bluetoothctl --agent NoInputNoOutputdefault-agentpower onshowpairable ondiscoverable-timeout 120discoverable on -
On the other device, start
bluetoothctl:Other device bluetoothctl --agent NoInputNoOutputdefault-agentpower onshowIf this device still lists the phone from an earlier FPLinux session, run
remove PHONE-MACfirst. After every new RAM boot, the phone has forgotten the old pairing, so the old record no longer works. -
On the other device, find and pair with the phone, then trust only its address:
Other device pairable onscan bredrdevicespair PHONE-MACtrust PHONE-MACscan offpairable off -
Back on the phone, trust only the other device’s address and close the pairing window. The last command keeps the phone reachable for incoming file transfers:
Phone trust PEER-MACdiscoverable offpairable offmgmt.connectable on
Receive a file on the phone
Section titled “Receive a file on the phone”Create a destination directory, then open a receive window for one file from the paired device. The last number is the time limit in seconds, from 1 to 3600:
mkdir -p /tmp/bluetooth-receivefplinux-bluetooth receive PEER-MAC /tmp/bluetooth-receive 120While the command waits, send one file from that device with its Bluetooth file-transfer (OBEX Object Push) client. The window accepts only that device, closes after one file or when the time runs out, and never overwrites an existing file.
Send a file from the phone
Section titled “Send a file from the phone”Start an OBEX Object Push receiver on the paired device first, then run:
fplinux-bluetooth send PEER-MAC /tmp/photo.jpgWhether a particular computer or phone accepts the file depends on its own Object Push service; not every desktop Bluetooth setup is compatible.
Internet over Bluetooth (PAN)
Section titled “Internet over Bluetooth (PAN)”The other device must share its Internet connection over Bluetooth as a network access point (NAP). It provides the addresses, DNS and routing; FPLinux does not configure it. Set this up on the other device before pairing.
-
In one shell on the phone, connect and leave the command running:
Phone fplinux-bluetooth network PEER-MACIt prints the name of the new network interface, for example
bnep0. -
In a second shell on the phone, request an address on the interface it printed:
Phone udhcpc -i bnep0 -
Press Ctrl+C in the first shell to disconnect.
Internet traffic goes through Bluetooth only. The USB link to your computer stays a separate private connection and does not carry Internet traffic.
Send audio to an A2DP sink
Section titled “Send audio to an A2DP sink”Copy fplinux-bluealsa.apk, fplinux-bluez-libs.apk and fplinux-sbc.apk from your build’s apks/ directory to /tmp, as described in Packages. Install them together so their dependencies are available, then start the service:
apk add --no-network --allow-untrusted --force-non-repository \ /tmp/fplinux-bluez-libs.apk /tmp/fplinux-sbc.apk /tmp/fplinux-bluealsa.apkrc-service bluealsa startEnable Bluetooth, pair and trust the sink using the procedure above. Connect its Audio Sink profile and list the available PCM devices:
bluetoothctl connect PEER-MAC 0000110b-0000-1000-8000-00805f9b34fbbluealsactl list-pcmsSelect the Bluetooth output explicitly when playing a file:
aplay -D 'bluealsa:DEV=PEER-MAC,PROFILE=a2dp,CODEC=SBC' /tmp/audio.wavReplace PEER-MAC with the paired sink’s exact address. Finish playback before disconnecting. After reconnecting, start a new playback command. The service does not replace the default audio output or start automatically at boot. Before removing fplinux-bluealsa, stop it with rc-service bluealsa stop.
Use this procedure only with a sink and boot profile supported on your phone page. Audio to physical headsets and other phones has not been tested. This service supports SBC only; HFP and SCO are not supported.
Keyboards and mice
Section titled “Keyboards and mice”Where supported, Bluetooth keyboards and mice appear as ordinary input devices. Keyboards control the graphical interface and type into its text fields. Direct-display applications such as TyrQuake use their own input controls with the graphical session stopped. The procedure below uses Bluetooth Low Energy; check your phone page for keyboard and mouse support. Bluetooth Classic keyboards and mice have not been tested.
Put the keyboard or mouse into pairing mode, then pair it from the phone:
bluetoothctl --agent KeyboardDisplaydefault-agentpower onscan lepair DEVICE-MACtrust DEVICE-MACconnect DEVICE-MACscan offUse the address shown by the current scan: some keyboards use a new address each time they enter pairing mode. If bluetoothctl shows a passkey, type it on the keyboard.
If your phone page lists Bluetooth sleep support for the boot profile, Bluetooth can stay on while the phone sleeps, and pairings are kept. Before sleeping, finish file transfers, stop audio playback, stop the PAN command with Ctrl+C and wait until the other device has disconnected; an active connection makes the sleep request fail. After waking, Bluetooth works without pairing again. Waking the phone over Bluetooth has not been tested.
What is kept
Section titled “What is kept”In the RAM profile, a power-off or a new load erases pairings and files such as those in /tmp. With a microSD system card, pairings are kept across boots.
Limitations
Section titled “Limitations”Peer compatibility and range are limited to the support stated on your phone page. Pairing alone does not establish support for every service that a peer offers.
- Physical Bluetooth headphones and speakers have not been tested.
- Bluetooth Low Energy devices other than keyboards and mice have not been tested.
- Range has not been tested.