This program will convert your locally connected keyboard/mouse input to Bluetooth HID input device.
- 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
- Go 1.7.4+
--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)
Use bluetoothctl to accept connection and authorize pairing.
$ sudo bluetoothctl
[bluetooth]# discoverable on
[bluetooth]# pairable on
[bluetooth]# agent on
[bluetooth]# default-agent
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.
MIT License; See LICENSE for detail
Tatsuya Kobayashi pikopiko28@gmail.com