Recently I bought a bluetooth RS232 serial convertor. I wasn’t sure whether it would work with my Linux laptop. But it turned out to be quite simple to setup.

Pre-requisites

The following packages are required:

  • bluez
  • bluez-utils
  • byobu (optional)

Bluez provides the bluetooth protocol stack (most likely shipped with the OS), bluez-utils provides the bluetoothctl utility and byobu is a wrapper around screen terminal emulator. You can also use ‘screen’ directly. Install these using your distributions recommended procedure.

Steps

  1. Start daemon:
1
    Swanky:~$ systemctl start bluetooth
  1. Discover using bluetoothctl:
1
2
3
4
    Swanky:~$ bluetoothctl
    [NEW] Controller <controller-mac-address> xkgt-Swanky [default]
    [bluetooth]# power on
    [bluetooth]# scan on
  1. Once you can see your device, turn off the scan and pair
1
2
    [bluetooth]# scan off
    [bluetooth]# pair <device-mac-address>
  1. Exit blutoothctl and create serial device (Note that root privileges are required):
1
2
    [bluetooth]# exit
    Swanky:~$ sudo rfcomm bind 0 <device-mac-address>
  1. You should now have /dev/rfcomm0. Connect to it using byobu-screen utility:
1
    Swanky:~$ byobu-screen /dev/rfcomm0

Enjoy your wireless console connection!