Little 418

The resulting entity body MAY be short and stout

Google Glass and the Twiddler 3

Update: Greg Priest-Dorman tipped me off about an issue with these instructions. XE12 has a bug that causes keys to repeat if you type quickly. I’m quite slow on my Twiddler, but I was able to reproduce it with this command:

$  adb shell input text "abcdefghijklmnopqrstuvwxyz-0123456789"

Which yields this

repeated keys on XE12

Greg reports that XE8 works well, but downgrading that far is tricky. I’m going to experiment with flashing earlier versions and update this post with my findings.

Voice commands are perfect for commands, but something I’ve always dreamed of doing on Google Glass is taking notes. The Twiddler 3 seems like the perfect input device, and we all know that the best text input software is Vim.

Getting all of these to work together took a little bit of hacking. This blog entry guides you through the process of pairing Glass with the Twiddler 3, and using it to type your first words into VimTouch on Glass.

Here’s a summary of what’s involved:

  • Root and downgrade to XE12
  • Disable automatic updates
  • Pair your Twiddler 3
  • Install and run VimTouch

Warning: This tutorial includes steps that will void your Google Glass warranty. Proceed at your own risk. If you accidentally brick your Glass, don’t complain to me! :)

Root and downgrade to XE12

Current versions of the Glass operating system such as XE22 do not pair with Bluetooth HID devices like the Twiddler. However, older versions that were based on Android 4.0 Ice Cream Sandwich do play well with them. Before we can pair Glass with the Twiddler we need to downgrade to XE12 and disable automatic system updates.

Download XE12

Why are we downgrading to XE12? Because it was the highest version based on Ice Cream Sandwich. It has the most features and bug fixes included. You can also use XE10 or XE11, if you prefer.

All of the boot loaders and system images for Glass are available from the System and Kernel Downloads page in the official Glass documentation. Scroll down past the warnings and download and boot.img.

glass system image downloads

Root and downgrade

Now the scary part: flash the rooted bootloader and downgrade to XE12. This is the step that voids your warranty and could brick your Glass. It also erases any data on Glass, so download your photos and video before flashing.

The instructions for flashing these images to Glass is on the very same page. Run these commands using the adb and fastboot tools included with the Android SDK. These instructions work best from Linux, so flash from there if possible.

Note If you’re flashing from a Mac, Glass might crash after each fastboot flash command. If this happens, take a deep breath, power cycle Glass, and use adb reboot bootloader to get back into fastboot. Proceed to the next image.

# enter fastboot mode 
$ adb reboot bootloader            

# verify Glass is in fastboot
$ fastboot devices 

# acknowledge the warning
$ fastboot oem unlock
# actually unlock the bootloader
$ fastboot oem unlock

# flash the rooted bootloader
$ fastboot flash boot boot.img     

# flash partitions with factory images
$ fastboot flash system system.img
$ fastboot flash recovery recovery.img

# reboot into normal mode
$ fastboot reboot

Your Glass is now running XE12. You should see the XE12 log in screen.

Don’t log in yet. You need to disable updates first.

Disable automatic updates

Once you log in, Glass automatically updates to the latest version. You don’t want this, so we need to disable updates. Unfortunately, we need adb access to disable updates. You can work around this, but it requires some silly tricks, and an wifi network that you can disable quickly.

  1. Set up a temporary wifi network. I used the portable hotspot feature of my mobile phone.
  2. Use the Glass setup page to log in to your account. Once you’re logged in immediately disable your wifi network.
  3. Swipe to Settings -> Device Info. Enable USB debugging (adb).
  4. Delete GlassUpdate.apk to disable automatic updates, and restart Glass.
$ adb root

# delete the automatic update app 
$ adb shell rm /system/app/GlassUpdate.apk

# see if Glass already started updating
$ adb shell ls -al /cache
-rw-r--r-- app_5    app_5     5416530 2015-05-24 23:33
drwxrwx--- root     root              1969-12-31 16:00 lost+found

# if it is, delete the zip
$ adb shell rm /cache/

# reboot to kill any remaining running processes
$ adb reboot

Automatic updates are now disabled. You can add your primary wifi network to Glass.

Note: This is a pretty aggressive way to disable updates. I tried other techniques, like disable, but nothing else I tried persisted across restarts. If you figure out a better option, please let me know.

Pair your Twiddler 3 with Glass

Pair the twiddler

The built-in Glass settings software does not know how to pair with Bluetooth HID devices, but HY and PY from the Glass team showed us how to do this in the Hacking Glass session at Google I/O in 2013.

  1. Get your a copy of Settings.apk. You can build it from source or download a binary from a trustworthy source.
  2. Side load Settings.apk and fire off an intent to start it up.
$ adb install ./Settings.apk
$ adb shell am start -S
  1. Turn on your Twiddler, and reset Bluetooth pairing with the special chord N+S ROOO.
  2. Awkwardly use the touchpad to move around the settings app. Go to Bluetooth, scroll down to the Twiddler, and tap to pair. If you get stuck for some reason, use adb input keyevent to simulate arrow key movement.

Fix the settings card

broken settings card

At this point, you may notice that the settings card is broken. You have two apps that respond to the settings intent, but the intent chooser is broken in XE12. To work around this, you can install an alternative launcher like Mike DiGiovanni’s Launchy. Follow these steps to install it.

  1. Check out Launchy. It won’t build out of the box. It depends on a bunch of XE16 GDK stuff, which does not work on your XE12 device.
  2. Edit, and remove all of the code that refers to any class in the package.
  3. Build the apk, and side load it on to your Glass.

You can now tap through the Glass main menu to start Launchy, and Launchy can start Glass’ default settings app.

Install and run VimTouch

vim on glass

At this point we have a Glass running XE12 with a paired keyboard, but none of the built in software responds to text input from a keyboard. To make your Twiddler useful on Glass, you need a keyboard friendly app. What better app to install than the Android variant of Vim?

Clone VimTouch, build it from source, and install it on your Glass.

It runs great, and you can verify your keyboard input right away. It also shows up in Launchy, so you can start it that way in the future.


Is your Glass still working? Great! You’ve rooted it, downgraded it, disabled automatic updates, and typed characters into the best text editor in the world. Congrats!

But the story isn’t over yet. Launching VimTouch from the touchpad is a little bit clunky, and the Glass home app starts each time Glass wakes up. It’s not a useful note taking device yet. We need a way make a sticky text editor that continues across sleep cycles, and a way to launch apps from the Twiddler.

I’ve worked out solutions for both of these, but they’re a story for another blog post. If you’re interested in a writeup, please tweet at me.

A faster way to copy your Raspberry Pi SD cards on OS X

The Raspberry Pi is awesome. One of the reasons that it’s awesome is because it’s so newbie friendly, and has great docs. For example, it has a great guide on creating an SD card image from OS X.

But, that guide does have one problem. The way they tell you to use the dd tool results in a very slow copy.

Default Instructions

Here’s what happened when I followed the instructions to install Raspbian on a cheap SD 16 GB SD card.

mimming@femputer:~$  sudo dd bs=1m if=2015-05-05-raspbian-wheezy.img of=/dev/disk2
Password: correcthorsebatterystaple

3125+0 records in
3125+0 records out
3276800000 bytes transferred in 2903.165983 secs (1128698 bytes/sec)

2903 seconds? That’s like 48 minutes. That’s almost an hour! But, but, but I want to be hacking sooner than that.

Targeting rdisk

Luckily there’s another way! OS X provides /dev/rdisk#. The r stands for raw and provides a more direct interface with the SD card. In this case, more direct = more faster.

mimming@femputer:~$ sudo dd bs=1m if=2015-05-05-raspbian-wheezy.img of=/dev/rdisk2
Password: correcthorsebatterystaple

3125+0 records in
3125+0 records out
3276800000 bytes transferred in 652.856126 secs (5019176 bytes/sec)

The same copy took just over 10 minutes. Not too shabby.

Bigger Chunks

Some Stack Overflow answers indicated that using bigger chunks might speed things up even more. I gave it a try.

mimming@femputer:~$  sudo dd bs=10m if=2015-05-05-raspbian-wheezy.img of=/dev/disk2
Password: correcthorsebatterystaple

312+1 records in
312+1 records out
3276800000 bytes transferred in 653.281030 secs (5015912 bytes/sec)

The result is almost exactly the same. It seems that block size does not matter too much.

A tip about dd progress

While dd is a neat tool, it’s hardly verbose. Sometimes it’s hard to tell if it’s working hard, or if the process is hung (which can happen if your computer goes to sleep).

You can query it for a status update by pressing CTRL + T.

Thanks to that goes to this superuser answer.

A Twiddler 3 review


The Twiddler 3 is the most flexible single-handed wireless input device that I have ever used. It has some rough edges, and it requires significant time investment to learn, but it’s worth it.

What’s a Twiddler 3?

It’s a handheld chorded keyboard. Instead of pressing down on a single key to make a letter, on a Twiddler you lift multiple keys to make a letter (or sequence of letters).

The Twiddler 3 works as a USB or Bluetooth keyboard. It’s targeted at use for mobile devices and wearables.

Unboxing and first moments

The box contains the Twiddler 3 keyboard, a velcro strap, and a MicroUSB cable. I didn’t take any photos, but there are already unboxing videos on YouTube.

After flipping that little switch to power it up, mine started looking for a device to pair with. I was mashing the keys and typing gibberish into my laptop within a minute of opening the box. The unboxing experience is great.

This is where the polish starts to end, and the mildly rough road begins.

Pairing with other stuff

The next thing I wanted to do was verify that the Twiddler could pair with all of my tiny computers. You know, the mobile phone kind. This was when I realized that the box didn’t contain any printed instructions. A quick web search turned up the official docs. They’re a bit disorganized and hard to read, but after a few minutes of clicking around I learned that I could clear the paired state with the special chord N+S R000.

It paired easily with my Moto X, 2013 Nexus 7, and iPhone 6+. It did not pair as easily with
Google Glass, but that’s a story for another day. (Literally another day: I’m drafting a follow up blog post about using the Twiddler 3 with Glass right now.)

Holding it correctly

This may seem like a no-brainer, but my instincts lead me astray here. Initially I grabbed it with my right hand and tightened the velcro band. The docs have detailed guidance about how to hold the Twiddler. The tl;dr: is to hold it with your non-dominant hand, and leave the velcro band pretty loose.

The recommended grip wasn’t very comfortable for me, so I swapped out the velcro for a strip of elastic and gripped it with my thumb.

how Jenny holds her Twiddler

Hacking Layouts

Twiddler Tuner

One of the coolest things about the Twiddler 3 is how configurable it is. The layout is easily programmable with the tuner web app.

Don’t be afraid to experiment with your layout right away. Your layout is a very personal choice. Lots of people like the default one, espiecally those who type with their left hand, but I found it difficult to learn and uncomfortable.

Try these popular layouts.

If none of those work for you, write your own. I did.

Actually using it to type stuff

Expect to invest a lot of time in being productive. Research indicates that you’ll probably get pretty fast, but expect to practice, a lot.

There’s a tutor web app. It works OK, but I gave up on it for a few reasons.

  • Your progress is only saved in a cookie, which is easily lost. You can export your progress, but oddly, you can’t import it.
  • It only supports the default layout.
  • It does not work on mobile.

Instead, I learned from lots of short practice sessions:

After a couple weeks, I got up to about 20 wpm.

Most important

I know what you’re really wondering, can it type emoji? Can I use a single chord to (╯°□°)╯︵ ┻━┻?

Well, no. The tuner does not approve of table flipping. It gets all scrambled when you save it.

(╯°□°)╯︵ ┻━┻

And it might be moot, because I’ve been told that the Twiddler itself may have trouble flipping tables… something to do with the HID spec. Anyway, if I figure out a way to hack around it, I’ll post a follow up.

In conclusion

Becoming awesome with it is hard, but it’s worth it.

Oh, and if you get lonely, drop by the Google+ Wearable Computing community. It seems to be the best place to talk about general purpose werable computing, and input devices like the Twiddler.