geekhack

geekhack Community => Keyboards => Topic started by: njbair on Sat, 19 September 2015, 14:14:10

Title: What to do with a nice keyboard with lousy firmware?
Post by: njbair on Sat, 19 September 2015, 14:14:10
I bought a Varmilo VA87M from Massdrop. It's a pretty cool-looking board:

(https://farm1.staticflickr.com/710/21447336176_7f801a7bf9_k.jpg)
Varmilo VA87MR (https://flic.kr/p/yFecQd) by Nick Bair (https://www.flickr.com/photos/njbair/), on Flickr

...but it's got a problem. The firmware is garbage. It doesn't support 6KRO mode at all. Instead, it uses a hacked-together USB NKRO mode which emulates multiple keyboard devices (basically the firmware splits the keys into 3-4 groups, with each group appearing in Device Manager as a separate keyboard. This means it doesn't work on Macs, and it also won't work with hasu's USB to USB converter, which I can't use any of my preprogrammed layers or macros.

I'm trying to weigh my options for modding this board into something useful.

1. Firstly, I can totally remove the PCB and hand-wire it. I'm sure I could fit a Teensy in there if I take the PCB out, but this is not ideal because the board will lose some rigidity without the PCB backing.

2. I could try removing the existing controller chip and somehow wiring in my own. This way I could take advantage of the PCB's switch matrix and LED circuits. Only I'm not sure if I could get a Teensy in there if I don't take the PCB out, since the board has such a slim case.

3. Write this thing off and sell it to someone who doesn't care about programmability or Mac compatibility.

Any advice?
Title: Re: What to do with a nice keyboard with lousy firmware?
Post by: keshley on Sat, 19 September 2015, 14:18:04
I haven't taken mine apart yet - do you know what controller its using? Would be super awesome if TMK was already compatible.
Title: Re: What to do with a nice keyboard with lousy firmware?
Post by: njbair on Sat, 19 September 2015, 14:22:32
I haven't taken mine apart yet - do you know what controller its using? Would be super awesome if TMK was already compatible.

It's using a Holtek-branded chip, no idea what architecture though. I looked at it through a loupe, but I should have snapped some photos while I had it open. I don't think it's AVR-compatible, though, because AVR chips don't have the ability to emulate multiple boards.

Maybe I can hire hasu to reverse-engineer it for me!
Title: Re: What to do with a nice keyboard with lousy firmware?
Post by: microsoft windows on Sat, 19 September 2015, 14:57:20
IF THE FIRMWARE ON THE KEYBOARD IS NO GOOD, JUST THROW THE KEYBOARD IN THE TRASH AND BUY A NEW ONE. IT'S THE 21ST CENTURY...TIME TO GET WITH THE TIMES AND LIVE THE DISPOSABLE LIFESTYLE.
Title: Re: What to do with a nice keyboard with lousy firmware?
Post by: digi on Sat, 19 September 2015, 14:58:56
IF THE FIRMWARE ON THE KEYBOARD IS NO GOOD, JUST THROW THE KEYBOARD IN THE TRASH AND BUY A NEW ONE. IT'S THE 21ST CENTURY...TIME TO GET WITH THE TIMES AND LIVE THE DISPOSABLE LIFESTYLE.

YES!! HE'S BACK LADIES AND GENTLEBUTT'S!
Title: Re: What to do with a nice keyboard with lousy firmware?
Post by: hoggy on Sun, 20 September 2015, 01:34:40
You know, I kinda missed him...
Title: Re: What to do with a nice keyboard with lousy firmware?
Post by: Findecanor on Sun, 20 September 2015, 11:00:13
It's using a Holtek-branded chip, no idea what architecture though. I looked at it through a loupe, but I should have snapped some photos while I had it open. I don't think it's AVR-compatible, though, because AVR chips don't have the ability to emulate multiple boards.
There are two ways for a controller to emulate multiple boards. The first is to emulate a hub. The second is to be a "composite device" with multiple logical devices. Keyboards with built-in mice are most often composite devices.
The Noppoo Choc Mini which is known to not work with Mac is a composite device, but the problem is not that it is a composite device but because of a small bug in the keyboard's firmware and MacOS interpreting the protocol strictly.

How do you know that the Varmilo does not work on Macs? What does MacOS say?
Maybe you could persuade Hasu to modify his USB-USB converter to support composite devices.

Modern microcontrollers from Holtek that are used in keyboards are often based on an ARM core.
BTW, AVR does support being a composite device- that is how Hasu's firmware supports ps/2 mouse (or trackpoint) in and mousekeys.
Title: Re: What to do with a nice keyboard with lousy firmware?
Post by: suicidal_orange on Sun, 20 September 2015, 11:10:11
Teensy's are pretty damn small and the back of that board is raised so I'm sure you could fit one in.  You can remove the controller chip by circling a mini blowtorch or blue flame lighter around the legs and knocking it off.

Before you do that though you'll need to consider how hard the matrix will be to map out, and having lots of LEDs makes it likely to be quite hard.