sudo apt-get install espeak
espeak -ven+f3 -k5 -s150 "I've just picked up a fault in the AE35 unit"



Setting up serial ports on BT

This for Raspberry Pi with standard Raspbian build.

Plug in BT dongle

Using standard BT config app from SysTray – Change Bluetooth adaptor to be always visible.

Use command line to scan for services available on the adaptor:

hcitool scan
(shows adaptors available on RPi)

sdptool browse
(lists services available on visible devices)
Find the address of the device to connected to e.g. Browsing 20:68:…
Find the com port e.g. COM6 (this is the port on the other device)
Find the channel e.g. 0 (on the other device)

Bind the local port to the channel on the remote device address:
Sites say use rfcommN e.g.
rfcomm bind /dev/rfcomm1 AA:BB:CC:AA:BB:CC 1
BUT Java RXTXComm library has a list of serial ports it recognizes by default.

So do something like:

  • ?? bind the port as ttySnn in the first place (does this work = may have to be an existing port?)
    sudo rfcomm bind /dev/rfcomm1 AA:BB:CC:AA:BB:CC 1
  • create symbol to point a searched for port name to the physical rfcomm1 port worked but can’t find ref to creating the symbol)
  • use a command line property, i.e.
  •  ?? Modified in code using see

This post also describes the name issue.

The binding can be put in /etc/bluetooth/rfcomm.conf (not working yet though)

Set permission on port: chmod a+rw /dev/rfcomm0

Get the Java library using:

sudo apt-get install librxtx-java

Now can reboot RPi
# . bindBT.bash
# . demo
sudo rfcomm release 0
sudo rfcomm listen /dev/rfcomm0 22
paplay file.wav

Other useful commands

pulseaudio –-start
sudo leafpad {filename} to edit a system file

Setting up serial port service so other device can initiate connection

Now I can reliably connect from the other device but no services are offered by the RPi. useful info about Bluetooth and UIs to Bluetooth.

Added pi to Bluetooth group (

sudo usermod -G bluetooth -a <username>

Identifies how to start bluetooth daemon with –compat property set.

Then can run sudo sdptool browse local to see what services are available:

and can add one for serial SPP

sdptool add --channel=22 SP
sudo rfcomm listen /dev/rfcomm0 22

If you lose connection need to issue:
sudo rfcomm release 0
before trying to listen again.

Getting audio sink to work

bluez V5 causes some problems because it doesn’t support alsa. However bluetoothctl should work now in its place.

See page 2 of a post for a detailed description of how to make audio work over BT (not specifically for RPi):

Where the guide mentions pacman use

sudo apt-get install {packagename}

  • dbus (interprocess communication) – already at latest
  • alsa-plugins ### Not available!!! ###
  • pulseaudio (audio interfacing that supports bluetooth)
  • pulseaudio-alsa  ### Not available!!! ###
  • pavucontrol (mixer for graphical desktop machines) or
  • ponymix (CLI mixer for pulseaudio for headless machines) ### Not available!!! ###
  • pulseaudio-module-bluetooth (from

pulseaudio-module-bluetooth fllowed by a reboot) enabled the headset in the PulseAudio volume control (accessible from the Start Menu).

To test audio:

paplay file.wav