Table of Contents

Bluetooth Dongles with TextBlades

The TextBlade uses BLE (Bluetooth Low Energy) to communicate with host systems. BLE was introduced as part of the Bluetooth 4.0 specification so systems running earlier versions of Bluetooth are not capable of running in BLE mode and thus cannot be used with the TextBlade. Most modern phones, tablets and laptop PC/Mac systems will have the appropriate hardware built-in and for such systems the TextBlade can be used without the need for additional hardware.

Hardware with built-in Bluetooth support that operates in BLE mode started becoming the norm during 2011, but you need to check the specification of your hardware to check. At the OS level this is only the case for the most recent versions of most common OS. For PCs the OS support for BLE is built-in on systems running Windows 8 or later (although there are drivers for Windows 7). On Macs OS support for BLE is built-in if using OSX Mavericks or later.

For systems that do not have Bluetooth 4.0 support built-in at the hardware level then a Bluetooth dongle plugged in via USB is the way to add such support. If purchasing a dongle for use with the TextBlade ensure that it supports Bluetooth BLE mode. This means that the dongle must support at least Bluetooth 4.0 or later.

A Bluetooth dongle can operate in two modes:

  • Host system runs Bluetooth stack:
    In this mode (also known as HCI mode), which is the commonest, then the support for the Bluetooth protocol stack is provided by the host. This means that the host OS must support Bluetooth 4.0 BLE.
  • Dongle runs Bluetooth stack:
    In this mode (also known as HID proxy mode) the Bluetooth protocol stack runs purely within the dongle and so the host does not need to provide Bluetooth support. A TextBlade attached to a dongle running in this mode appears to the host to just be another USB keyboard. This means it can be used on legacy systems that know nothing about Bluetooth but can handle USB keyboards. However not all dongles sold as supporting BLE are capable of operating in this mode, and even for those that do have this capability then special action may be required to put them into this mode.
A Bluetooth dongle should have its active parts at least 2cm (preferably 4cm) away from metal. That is one reason why the very small micro-style dongles will often operate better when attached to the host via a USB extension cable.

Bluetooth Dongle from WayTools

WayTools make a Bluetooth dongle suitable for use with the TextBlade available as an optional accessory.

The dongle supplied to early TREG testers (image above) was actually a Laird 820 dongle (as discussed later in this section) pre-paired to a slot on the TextBlade. Later TREG testers got a version of the dongle with Waytools branding applied as the Way-In dongle rather than it having the Laird branding (although under the covers it is identical to the Laird 820). When supplied by WayTools in conjunction with a TextBlade then the dongle arrives with the following customisations already done for you:

The only further customisation you might normally need to do is to set the correct Key Map, Target OS and Target Keyboard for your intended use of Jump Slot 6. This is done with the TextBlade connected to the device running the TextBlade app (on the Jump slot appropriate to that device which will not be Jump Slot 6) from the Jumps section of the app.

We do not yet know what the settings for these options are when the dongle arrives from WayTools so it will always be a good idea to set them explicitly yourself.

In normal use when using a WayTools supplied dongle the remainder of this section can be ignored. It does, however, become relevant if:

In the ideal world such a Bluetooth dongle could be combined with the NanoCharger so that it can be held inside the TextBlade when not in use. However such a product would definitely not be something that is likely to be available for initial release of the TextBlade to the general public (assuming it ever appears at all). It is also not clear if such a product (if it existed) would be able to receive Bluetooth signals reliably enough in such a small form factor.

Setup when Host OS runs Bluetooth Stack

The setup when a dongle is being used but the host is going to run the Bluetooth stack is exactly the same as when using built-in Bluetooth hardware. It is expected that this is the method that many users will use rather than the more complicated one of getting the Dongle to run the Bluetooth stack (which is the focus of the sections after this one).

Points to note are:

The detailed steps of the process of connecting a Bluetooth keyboard to such a system is going to be specific to the Operating System that is being used, so you should refer to the OS documentation for more information.

For an old Mac, the procedure that appears to work is:

That should it and you will now be able to pair the TextBlade to the Mac.

Some users have also reported success by omitting the steps that use the Bluetooth File Explorer, but exactly under what conditions this is possible is not clear. Any feedback from users who can clarify this would be appreciated as obviously removing the need for getting the additional software from Apple is highly desirable.

GMYLE BT V4.0 Dual Mode Procedure on Older Mac Running 10.11.6:

Setup when Dongle runs Bluetooth stack

This is the only way to get a TextBlade to work with a system that is not capable of supporting Bluetooth natively. It allows the TextBlade to be used with any system that is capable of supporting a USB keyboard. This would cover:

From trial-and-error experiments by early TextBlade users it appears that the hardware requirements for dongles to be capable of operating in HID proxy mode are:

It is quite possible that dongles based on other chipsets may be capable of this mode as well, but so far none have been found.

Dongles that have been found to meet the above requirements and have been successfully used in HID mode with TextBlades are:

We concentrate here on getting the TextBlade to work with the dongle. However it is worth pointing out that the approach described should work with any BLE compliant keyboard, not just the TextBlade. The Laird 820 dongles mentioned here allow for two devices to be simultaneously paired with it in HID mode, so it should also be possible to pair a BLE compliant mouse/trackball with the dongle at the same time as a TextBlade.

Getting a dongle into HID Proxy Mode

The steps to getting a compatible dongle working in HID Proxy mode with a TextBlade have proved to be a little convoluted and thus prone to error. A Texblade-dongler project has been started on GitHub to try and automate this as far as possible and to act as a repository for information needed to get this working. This work has resulted in a process that seems to work reasonably reliably for most early users (although still not for the faint-of-heart).

The following approaches to doing these steps have so far been validated:

Virtual Machine Approach

If you are running Windows 10 and are having problems connecting the dongle to the VM, then this post helped me and may help you: https://forums.virtualbox.org/viewtopic.php?f=2&t=84040#p398908
The dongle is automatically captured by Windows and can't be ejected. The change to the registry allows the VM to use USB filters to capture the dongle. You need a filter for the dongle in HID and HCI mode.

Raspberry Pi Approach

It has been found that the Raspberry Pi Single Board Computer (SBC) can also be used to configure the dongle. It is possible that other SBC systems that are Linux based may work but the Raspberry Pi is the only one tested so far. The steps to get a Raspberry Pi ready to run the dongle setup process are:

It has been found that the version of the bluez software installed as standard with Raspbian can have problems handling the TextBlade and is typically not the latest version available. You can upgrade to a later release by following the bluez update instructions provided by Adafruit. The :rpi-bluez-install.zip attached script provides an automated way of carrying out all those steps (it defaults to 5.50 but a different release can be provided as a parameter). Releases between the bluez 5.37 and bluez 5.50 releases are ones that have been tested successfully against the TextBlade.

COMMON STEPS

You are now in a position to start configuring the dongle

If the dongle is actually already been put into HID mode then Device ID field is changed to ID: 0a12:100b and the Description field no longer mentions HCI mode.
If using the latest pair.sh and make-hid.sh scripts, then PINless pairing is not necessary. You can manually update these scripts if using the VM approach.
If using HCI device other than hci0 you must run the bccmd command as bccmd -d <HCI device>

Assuming the above has all worked successfully then you should be able to plug the dongle into any system capable of supporting USB keyboards and find that it will work with the TextBlade if you select the Jump Slot that you paired with the dongle. If the dongle selected has a LED that indicates it is active in Bluetooth mode you will find that the mere act of plugging it into a system (and thus powering it) will start that LED flashing.

Video Walkthrough

The following video is a walkthrough of the above steps, pairing a WayTools supplied (Laird 820) dongle with slot 6 on a TextBlade using VirtualBox.

Useful CLI commands

Once you are have paired the dongle and are ready to configure the dongle there are some useful commands that can be used at the CLI level to check out the dongle.

bluetoothctl command

This command provides basic Bluetooth control. Once started you will stay in the bluetoothctl program until you enter the quit option. A list of sub-commands available is available by typing

help

once bluetoothctl has been started. This will give output of the form

Available commands:
  list                       List available controllers
  show [ctrl]                Controller information
  select <ctrl>              Select default controller
  devices                    List available devices
  paired-devices             List paired devices
  power <on/off>             Set controller power
  pairable <on/off>          Set controller pairable mode
  discoverable <on/off>      Set controller discoverable mode
  agent <on/off/capability>  Enable/disable agent with given capability
  default-agent              Set agent as the default one
  set-scan-filter-uuids [uuid1 uuid2 ...] Set scan filter uuids
  set-scan-filter-rssi [rssi] Set scan filter rssi, and clears pathloss
  set-scan-filter-pathloss [pathloss] Set scan filter pathloss, and clears rssi
  set-scan-filter-transport [transport] Set scan filter transport
  set-scan-filter-clear      Clears discovery filter.
  scan <on/off>              Scan for devices
  info [dev]                 Device information
  pair [dev]                 Pair with device
  trust [dev]                Trust device
  untrust [dev]              Untrust device
  block [dev]                Block device
  unblock [dev]              Unblock device
  remove <dev>               Remove device
  connect <dev>              Connect device
  disconnect [dev]           Disconnect device
  list-attributes [dev]      List attributes
  select-attribute <attribute> Select attribute
  attribute-info [attribute] Select attribute
  read                       Read attribute value
  write <data=[xx xx ...]>   Write attribute value
  notify <on/off>            Notify attribute value
  register-profile <UUID ...> Register profile to connect
  unregister-profile         Unregister profile
  version                    Display version
  quit                       Quit program

The command sequence that is most likely to be required is

poweron
quit

to get the dongle ready to respond to bccmd commands.

If you are using the bluetoothctl command to pair the TextBlade (rather than using the pair.sh script mentioned above) then the sequence of commands will be something along the lines of:

poweron

to make sure the dongle is activated. Then with the dongle waiting to be paired run

scan on

to find the 'id' of the TextBlade. A list of devices seen by the dongle will be listed.

pair XXXXX

To pair the TextBlade with the dongle (where XXXXX is the id obtained from the scan command).

paired-devices

to check that the pairing has been successful.

quit

to exit from the bluetoothctl command and get back to the command line. At this point you can manually run

make-hid.sh XXXXX

to get the dongle into HID mode.

bccmd command

This is used to provide finer grain control of the dongle. It takes additional parameters to specify the action to be performed.

bccmd help

can be used to get a list of the options with available for use with the bccmd command

bccmd - Utility for the CSR BCCMD interface

Usage:
	bccmd [options] <command>

  Options:
	-t <transport>     Select the transport
	-d <device>        Select the device
	-b <bcsp rate>     Select the bcsp transfer rate
	-h, --help         Display help

  Transports:
	HCI USB BCSP H4 3WIRE

  Commands:
	builddef                       	Get build definitions
	keylen     <handle>            	Get current crypt key length
	clock                          	Get local Bluetooth clock
	rand                           	Get random number
	chiprev                        	Get chip revision
	buildname                      	Get the full build name
	panicarg                       	Get panic code argument
	faultarg                       	Get fault code argument
	coldreset                      	Perform cold reset
	warmreset                      	Perform warm reset
	disabletx                      	Disable TX on the device
	enabletx                       	Enable TX on the device
	singlechan <channel>           	Lock radio on specific channel
	hoppingon                      	Revert to channel hopping
	rttxdata1  <freq> <level>      	TXData1 radio test
	radiotest  <freq> <level> <id> 	Run radio tests
	memtypes                       	Get memory types
	psget      <key>               	Get value for PS key
	psset      <key> <value>       	Set value for PS key
	psclr      <key>               	Clear value for PS key
	pslist                         	List all PS keys
	psread                         	Read all PS keys
	psload     <file>              	Load all PS keys from PSR file
	pscheck    <file>              	Check PSR file
	adc        <mux>               	Read ADC value of <mux> input

  Keys:
	bdaddr country devclass keymin keymax features commands version 
	remver hciextn mapsco baudrate hostintf anafreq anaftrim usbvid 
	usbpid dfupid bootmode 

The one that is most likely to be used is

bccmd psread

can be used to get a list of the current keys that are stored in the flash. Getting the initial list of keys that this returns can be useful in determining if a particular dongle is likely to successfully work in HID Proxy mode.

An example of what this returns is European Laird 820 psread output in its out-of-the-box state.

Resetting the dongle to HCI mode

If you need to change the device that is paired to the dongle, then you are first going to have to reset it into HCI mode before this can be done. The would also be required if you accidentally erased the Jump slot that is paired to the dongle so that you can restart the process described above for getting the TextBlade to work with the dongle.

To do this you start by using the

hid2hci     (or csr-hid2hci if used from within VM)

program.

hid2hci puts the dongle into HCI mode until the dongle is reset (power-cycled). This allows you to use it as a normal bluetooth radio temporarily, or to change configuration such as the paired keyboard. If you need the dongle to stay in HCI mode after resetting it (essentially, restoring it to factory configuration), run

bccmd psset -s 0 0x3cd 0

which will disable HID mode until make-hid.sh is run again.

Advanced use of the Bluetooth dongle

There a number of more complicated scenarios that have been identified for using the dongle:

Although it is believed that all the scenarios are possible they have not yet been validated and a robust procedure identified for implementing any of them.