Skip to content

tkoecker/v4_hid_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HID Keyboard and Mouse wrapper for the Vampire 4

The Vampire 4, in its current state, only supports a limited amount of USB Mice and Keyboards. This is a workaround to make more of them work with the V4. Also for already working devices that need to be unplugged and plugged in again in order to get recognized the adapter removes this requirement.

It uses combination of one or two "Pro Micro" (3.3V / 8 MHz version) Arduino clones, and a "Mini USB Host Shield 2.0" board as an adapter in between the keyboard/mouse and the V4.

The one device version can act as an adapter for either a mouse or a keyboard (which can be selected via a jumper).

Adapter

The two device version can act as an adapter for composite mouse+keyboard devices (for example wireless mouse+keyboard combos that only use one USB receiver dongle).

Adapter

Build instructions to build the one device adapter can be found at:

Build instructions to build the two device version: two_device_build.md

3D printable cases can be found at: https://www.thingiverse.com/thing:4397113

Uploading the precompiled hex file to the microcontroller

To ease the installation process I've uploaded a precompiled build: v4_hid_wrapper.hex This file can be uploaded to the microcontroller using AVRDUDE: https://www.nongnu.org/avrdude/

Linux

Most distributions likely have an AVRDUDE package, for example on Ubuntu it can be installed using:

sudo apt-get install avrdude

When you plug in a "fresh" pro-micro the built-in CDC serial port will be recognized as a tty. Here is an example output of dmesg when the microcontroller gets connected:

usb 1-9: new full-speed USB device number 63 using xhci_hcd
usb 1-9: New USB device found, idVendor=1b4f, idProduct=9208, bcdDevice= 1.00
usb 1-9: New USB device strings: Mfr=1, Product=2, SerialNumber=0
usb 1-9: Product: LilyPadUSB
usb 1-9: Manufacturer: SparkFun
cdc_acm 1-9:1.0: ttyACM0: USB ACM device

Here the name of the serial port is ttyACM0. This port can be used to program the microcontroller with the downloaded hex file:

sudo avrdude -v -patmega32u4 -cavr109 -P/dev/ttyACM0 -b57600 -D -Uflash:w:v4_hid_wrapper.hex:i

Windows

You can download a Windows version of AVRDUDE from https://github.com/avrdudes/avrdude/releases.

Extract the AVRDUDE package and place the v4_hid_wrapper.hex file right next to the extracted files. Start a Windows Command Prompt in the same directory (for example by typing cmd.exe in the explorer address bar).

When you plug in a "fresh" pro-micro the built in CDC serial port will be recognized as a new COM port.

In this example the device manager has an entry called USB Serial Device (COM5).

This port can be used to program the microcontroller with the downloaded hex file. In the Windows Command Prompt type:

avrdude.exe -v -patmega32u4 -cavr109 -v -PCOM5 -b57600 -D -Uflash:w:v4_hid_wrapper.hex:i

To build the software for the adapter the following is needed:

On the one device version the adapter software is in mouse mode by default. If a jumper is put between pin 2 and GND the adapter is in keyboard mode.

TODO:

  • Check if mice/keyboards connected via USB hubs can be supported (which would make it possible to share the same mouse and keyboard on different hosts via an USB switch).

About

USB Keyboard / Mouse adapter for the Vampire 4 (to make more devices compatible)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages