The Waytools TextBlade is amazing but not every computer has Bluetooth 4.0. With a cheap USB dongle based on the CSR8510 chipset (64k EEPROM only!) you can make a wireless USB keyboard. The dongle needs to be paired to the TextBlade and then you can plug it in anywhere and it will appear as a USB keyboard.
This project aims to make that easy.
Warning: I managed to brick a dongle by writing incorrectly formatted data to the pairing data slot. Once I disconnected it, it wouldn't show up on USB any more (I assume the firmware crashes while trying to read the data). The script should write the token correctly, but be careful. Not responsible for any damage, caveat emptor, yadda yadda.
We are pretty sure that this only works on dongles that have enough EEPROM. The very cheap ones generally seem to have 32k EEPROMs. The scripts don't yet test this, but they will.
nix-env -i nixops
nixops create -d dongler dongler-vm/*.nix
nixops deploy --force-reboot -d dongler
nixops ssh -d dongler dongler
pair.sh
, it will automatically pair with the first thing it findsmake-hid.sh <TextBlade address>
to write the pairing to the donglebccmd psread
bluetoothctl
scan on
devices
pair <tab>
quit
hid2hci
Once the device is paired, the /var/lib/<dongle mac>/<TB mac>/info
file contains all the pairing information. This is used by make-hid.sh
to write correct token into the CSR dongle.
The PSKEY_USR42
field has to be set to tbMac + 1482 + be16(EDiv) + be64(Rand) + be16(Key)
(all hexadecimal), where be16 and be64 are big-endian representations, 2 and 8 bytes long respectively. This means the Rand is reversed entirely and the Key on every 2 bytes
Once that is set, bccmd psset -r -s 0 0x3cd 2
will set the dongle into USB keyboard mode. make-hid.sh
does that for you.