What I want to do
Folks are using the Raspberry Pi, a cheap stripped-down computer available for as little as $5, to connect to sensors, record weather data, and even run a DIY spectrometer. But it's hard to get data off of them easily, and hard to set them up.
But there seem to be ways to get them to "act like a keyboard" and, when connected to a computer by USB, to simply "virtually type" out data. This would work on Windows, Linux, and Mac, and be really simple -- no mucking around with Bluetooth, WiFi, SD cards, etc.
I've found a lot of resources on this:
Two approaches to getting a Pi to "act like a keyboard" using the "USB Gadget" system and the "HID" (human interface device) spec:
- http://blog.gbaman.info/?p=699, updated version here: http://blog.gbaman.info/?p=791
There's guidance on how to actually use and test it here:
And a bit more on the actual codes and how to get it to "type" any text here:
What I'd really like is an image of an SD card with all of this set up already -- or a script that'll run on an image very straightforwardly. That way this could be set up with minimal difficulty by folks who are trying to do sensing with Raspberry Pis!
Anyone want to take a crack at it?
Made some progress; i've gotten the "ethernet" usb gadget to work as shown here (and found this much simpler instruction set with lots of helpful comments)
I found there's an actual utility for piping text to the "virtual keyboard" from the commandline: https://github.com/girst/hardpass-passwordmanager/blob/master/send_hid/hardpass-demo.sh
Also found this Android-based implementation with a utility to actually output the correct codes to the device once it's running: https://github.com/pelya/android-keyboard-gadget#scripting (although the above does this too)