Using BeagleBoneBlack to emulate USB keyboard?

1,070 views
Skip to first unread message

William Park

unread,
Nov 30, 2015, 9:49:57 AM11/30/15
to beagl...@googlegroups.com
Hi,

I have an old BeagleBone Black (A5A, 2GB version), and I would like to
use it to emulate an external USB keyboard. I was thinking... I would
SSH into BBB and run some commands to send keymap data to PC through
- either mini-USB port
- or debug serial-to-USB cable.
As far as PC is concerned, it's receiving key presses.

Is this possible?
Where can I start my reading?
--
William

William Hermans

unread,
Nov 30, 2015, 1:21:15 PM11/30/15
to beagl...@googlegroups.com
Yes, it is possible.

As far as where to start leaning ? Well, you need to learn libusb, and about the USB HID protocol. Passed that, you're going to have to figure out how to write a Windows USB HID driver, prorbably also using libusb . . . It's a fairly complex subject that I also personally did some reading on, but never finished.

--
William

--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

William Hermans

unread,
Nov 30, 2015, 1:23:26 PM11/30/15
to beagl...@googlegroups.com
err, yeah oops. Where ? Use google and keywords "USB HID protocol", "libusb", and just start reading everything you can find.

mickeyf

unread,
Dec 1, 2015, 8:41:16 AM12/1/15
to BeagleBoard
There may be a quick and dirty shortcut to avoid going down the "gotta learn the low-level details of usb" rabbit hole. You can use a usb gadget to make the mini usb port appear as a serial port to your BBB software. Took about 2 lines of bash if I recall. Sorry, I don't have the details handy at the moment, I did this a while back. I think I got this from Jan Axelrod, maybe even on her website. If not, then her USB complete book.

Ed of the Mountain

unread,
Dec 1, 2015, 2:11:45 PM12/1/15
to BeagleBoard, openge...@yahoo.ca

Linux Gadget Drivers + BeagleBone hardware should allow you to emulate a USB keyboard.
http://www.armadeus.com/wiki/index.php?title=USB_Gadget

If you are emulating a keyboard, no PC driver is needed.

-Ed

Philip Polstra

unread,
Dec 1, 2015, 3:37:15 PM12/1/15
to BeagleBoard, openge...@yahoo.ca
I did a talk about how to do this at DEFCON this year.   One device to pwn them all.  Files you need here https://media.defcon.org/DEF%20CON%2023/DEF%20CON%2023%20presentations/DEFCON-23-Phil-Polstra-Extras.rar
--

William Hermans

unread,
Dec 1, 2015, 4:18:49 PM12/1/15
to beagl...@googlegroups.com
So Phil . . . if you're going to send files to others on the group, you may want to leave out files such as "attackWindows.py" . . .heh ! ;)

William Hermans

unread,
Dec 1, 2015, 5:02:44 PM12/1/15
to beagl...@googlegroups.com
SO, the companion slides to go with those files: https://media.defcon.org/DEF%20CON%2023/DEF%20CON%2023%20presentations/DEFCON-23-Phil-Polstra-One-device-to-Pwn-them-all.pdf related material starts at page 22.

Great job Phil. I did not realize creating a faux USB HID device was so easy. Well, "easy" when one lays out in great detail how it's done ;)

William Park

unread,
Dec 2, 2015, 10:17:10 AM12/2/15
to beagl...@googlegroups.com
Thank you.  It's been bookmarked and downloaded.  I'll start reading.  I'm encouraged by the fact that you can script this.
--
William

zspi...@gmail.com

unread,
Mar 3, 2017, 6:38:31 AM3/3/17
to BeagleBoard, openge...@yahoo.ca
Hello Phil,
I try  executing your script would you have information on what to do if /sys/kernel/config is not available, I did search on google with no success
Reply all
Reply to author
Forward
0 new messages