Giter Site home page Giter Site logo

drchristaylor / textblade-dongler Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wmertens/textblade-dongler

0.0 1.0 0.0 1.36 MB

Tools to convert a CSR8510 Bluetooth dongle to a pre-linked wireless USB keyboard

License: MIT License

Nix 40.29% C 14.11% Shell 45.60%

textblade-dongler's Introduction

TextBlade Dongler

TB and CSR8510 dongle

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.

List of known-good dongles

  • Laird
  • Logitec (Seems to be Japan-only)

Roadmap

  • Working NixOS VM with Bluetooth
  • Make working dongle
  • Nix package to compile program to switch dongle back into BT host mode
  • Scripts to automate
    • Automatic pairing and writing
    • Fix TODOs in the scripts
    • Autostart on VM terminal, no SSH needed to write the pairing
  • LiveCD/USB image
  • Maybe allow to write the same keys and MAC addresses to multiple dongles so you can keep a single jump slot for multiple physical locations

Set up test VM

  1. Install Nix and VirtualBox
  1. Install NixOps
  • nix-env -i nixops
  1. Deploy dongler VM
  • nixops create -d dongler dongler-vm/*.nix
  • nixops deploy --force-reboot -d dongler
  1. Shut down VM and enable USB in VirtualBox settings
  2. Start VM and attach USB dongle to VM
  3. Log in and play with Bluez 5
  • nixops ssh -d dongler dongler
  • You should be able to pair with pair.sh, it will automatically pair with the first thing it finds
  • Once paired, you can use make-hid.sh <TextBlade address> to write the pairing to the dongle
  • Verify the written keys with bccmd psread
  • For manual control, pair with bluetoothctl
    • scan on
    • devices
    • pair <tab>
    • quit
  • If you have a CSR dongle that is already in HID mode, you can switch it to bluetooth mode with hid2hci

Available data

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.

CRS8510 programming

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.

textblade-dongler's People

Contributors

wmertens avatar awh-tokyo avatar

Watchers

Chris Taylor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.