/gobt

Bluetooth HID proxy with Go

Primary LanguageGoMIT LicenseMIT

GoBT

What's this?

This program will convert your locally connected keyboard/mouse input to Bluetooth HID input device.

Requirements

  • Linux
    • Tested with Raspbian Jessie
    • (Raspberry Pi 3 for transmitter; Raspberry Pi 2 or macOS Sierra(MacBook Air 2012 13") for receiver)
  • BlueZ 5.23+
    • DBus
    • Systemd

Required Modules

Preparation

--noplugin=input option for the bluetoothd is required in order to make this program work.

For example:

On Raspbian Jessie:

Target file: /lib/systemd/system/bluetooth.service

[Unit]
Description=Bluetooth service
Documentation=man:bluetoothd(8)

[Service]
Type=dbus
BusName=org.bluez
########
## Original Entry
# ExecStart=/usr/lib/bluetooth/bluetoothd
########
## Modified Entry
ExecStart=/usr/lib/bluetooth/bluetoothd -C --noplugin=input
########
NotifyAccess=main
#WatchdogSec=10
#Restart=on-failure
CapabilityBoundingSet=CAP_NET_ADMIN CAP_NET_BIND_SERVICE
LimitNPROC=1

[Install]
WantedBy=bluetooth.target
Alias=dbus-org.bluez.service

(-C is for some 'older' tools; like sdptools)

Pairing

Use bluetoothctl to accept connection and authorize pairing.

$ sudo bluetoothctl
[bluetooth]# discoverable on
[bluetooth]# pairable on
[bluetooth]# agent on
[bluetooth]# default-agent

Usage

sudo ./gobt

(need to execute with root/admin privilege)

After running gobt on transmission side, let the receiver to pair.

In order to stop program, send an interrupt signal from remote or secondary shell.

Credits

License

MIT License; See LICENSE for detail

Author

Tatsuya Kobayashi pikopiko28@gmail.com