This article will provide guidance on how to connect the BB-400 to an Android device via Bluetooth.

Pre-requisite steps

The following steps allow the now deprecated Bluez4 commands to be enabled for use with Bluez5

Open the dbus-org-bluez.service file
sudo nano /etc/systemd/system/dbus-org.bluez.service

change the line
ExecStart=/usr/lib/bluetooth/bluetoothd
with the addition of “–compat” as follows:
ExecStart=/usr/lib/bluetooth/bluetoothd --compat

Bluetooth will then need to be restarted using the following commands:
sudo systemctl daemon-reload
sudo systemctl restart bluetooth

and the permissions will also need to be changed:
sudo chmod 777 /var/run/sdp

Download a terminal emulator app on an Android device

In order to see the terminal output once the BB-400 has connected to the Android device via Bluetooth, a terminal emulator app can be used.
A number of terminal emulator apps can be found on the Google Play Store. For Android version 8.1.0 Bluetooth Serial Controller is recommended, and for older versions SENA BTerm is recommended.

Enabling the BB-400 for Bluetooth connectivity

In Linux, open up a terminal and view what Bluetooth services are already available:
1.sdptool browse local

Check for a serial port service and note its channel number, if there are no serial ports available then one can be added by:
2.sdptool add --channel=22 SP

Check that the channel is now available by re-running command 1.
The output should look similar to below:

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-Check-For-Serial-Port.png

Connect to Bluetoothctl

The main way in which Linux configures Bluetooth devices is via the Bluetoothctl command, for more information regarding Bluetoothctl see the following link: https://wiki.archlinux.org/index.php/Bluetooth_headset.

Within a new terminal connect to Bluetoothctl:
sudo bluetoothctl

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-Connect-to-bluetoothctl.png

Switch agent on which will allow the devices to negotiate the Bluetooth pairing code:
agent on

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-Agent-On.png

Start scanning. This will provide a list of MAC addresses for devices that are nearby and available for the BB-400 to pair/connect to. This command also switches discovery on so that your device and the device you wish to pair/connect with can be found.
scan on

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-Scan-On.png

If the MAC address of the Android device does not appear, check that your Android device has Bluetooth enabled, and is set up to pair to devices. You can double check the MAC address of your Android device by going to Settings > System > About Phone > Hardware Info.

Now the command to pair the BB-400 with the Android device can be run:
pair <MAC address>
e.g.

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-Pair-On-Passkey.png

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-Pair-On-Successful.png

As shown by the image above, a message may appear in the Bluetoothctl window asking you to confirm that you want to pair with the Android device, a similar message may also appear on the Android device. Select or type yes in both cases to proceed to the next step.

Once the devices are paired, the BB-400 can be connected to the Android device using the following command:
connect <MAC address>

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-Connect.png

 

Potential PulseAudio Bluetooth Library error

It is possible that when trying to connect the BB-400 to a device for the first time, an error message may occur:

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-PulseAudio-Error.png

This error occurs as the sound protocol is not installed on Linux and so, PulseAudio Bluetooth Library needs to be installed.
In a new terminal, use the following command to install PulseAudio Bluetooth Library:
sudo apt-get install pulseaudio-module-bluetooth

Then it is necessary to restart PulseAudio and Bluetooth
sudo killall pulseaudio
sudo pulseaudio –start
sudo systemctl restart bluetooth

Going back to the terminal where Bluetoothctl was used to connect to the device, retry the command:
connect <MAC address>

And the BB-400 and the Android device should now be connected.

Connect Android device to BB-400

Ensure that Bluetooth Serial Controller or a similar terminal emulator app has been downloaded on your Android phone.
The Android device can be connected to the BB-400, by opening up the terminal emulator app and going to settings->and selecting the BB-400 from the list of available devices:

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-AndroidDevice.png

If it is not possible to connect to the BB-400, then try downloading a different terminal emulator app and reconnecting to the BB-400.

 

RFCOMM

RFCOMM is a set of Bluetooth transport protocols that allow reliable data stream to the user. It is one of the most widely used protocol by Bluetooth devices.

In a new terminal, RFCOMM can be used to ‘listen’ to the channel number of the serial port service you added/used at the beginning of this FAQ:
sudo rfcomm listen /dev/rfcomm0 22

The following message should appear

http://www.brainboxes.com/files/pages/support/faqs/bb-400-faqs/How-do-I-connect-the-BB400-to-an-Android-device-via-Bluetooth-rfcomm.png

which confirms that the BB-400 has connected to an android device using Bluetooth.

Anything that is typed on the terminal emulator app on the Android device will go to /dev/rfcomm0.
The command:
cat /dev/rfcomm0

will allow the user to view everything that is typed into the app in the terminal.

This FAQ Applies to the following Brainboxes Product Ranges: