I've been playing around with my Bluefruit (the one that doesn't support mouse) and so far I really like it. I'm almost finished with my project but I'm experiencing a bug that I can't solve and I'm hoping to rule out a problem or limitation with the Bluefruit itself.
I've taken an IBM Model M terminal keyboard and hooked it up to a atmega 32u4 using the awesome tmk_keyboard firmware by @tmk (https://github.com/tmk/tmk_keyboard)
I've reimplemented the output protocol to send the generated HID reports out to the Bluefruit over serial. The project is powered by the USB connection which is hooked up to a PC, and the 32u4 is running PJRC's "usb_debug_only" stack so that I can get info on what is going on inside the program. Eventually I will probably get your usb lipo charger and battery and make it so that I can toggle between Bluetooth and USB or even just charge the keyboard while I'm using Bluetooth.
Anyhow, those details of my project will be chronicled here as I progress further along: http://geekhack.org/index.php?topic=50183.0
Also at that link are some details relating to my question for you, which I will reiterate below:
Everything works fine as long as I only press one key at a time... if I press two, things get a little strange, I'll try to describe this as best I can...
If I press two keys at once, the first key is typed on my PC just fine, as is the second key. However if I release the first key, another HID report gets sent to and the other key gets typed out again (as if there was a key up in between). To better illustrate here is the debug output from pressing and holding 'g', then pressing and holding 'h', then releasing 'h', then releasing 'g':
Code: Select all
Waiting for device:.....
Listening:
Setting host driver...
Initializing serial...
Beginning main loop
rAA wFF [ack]
RESET_RESPONSE: rBF err
RESET: rBF wFF x01wFF x01wFF x01wFF x01wFF [ack]
RESET_RESPONSE: rAA [ok]
KBD_ID: rBF rBF
CONFIG: wF8 [ack]
READY
r34
+------------------------------------+
| HID report to Bluefruit via serial |
+------------------------------------+
| FD 00 00 0A 00 00 00 00 00 |
+------------------------------------+
gr33
+------------------------------------+
| HID report to Bluefruit via serial |
+------------------------------------+
| FD 00 00 0A 0B 00 00 00 00 |
+------------------------------------+
ghrF0 r33
+------------------------------------+
| HID report to Bluefruit via serial |
+------------------------------------+
| FD 00 00 0A 00 00 00 00 00 |
+------------------------------------+
grF0 r34
+------------------------------------+
| HID report to Bluefruit via serial |
+------------------------------------+
| FD 00 00 00 00 00 00 00 00 |
+------------------------------------+
Two things seem to be wrong here:
1) When the second key is released and I send the updated HID report, whatever keys are still pressed get typed out a second time
2) When I hold down a key, it doesn't seem as if the computer is recognizing that the key is held down
In both cases it seems like the PC perceives that the held down keys were released when they in fact were not.
I hope I explained this well, I know it was verbose but I hope that I made it clear enough.
If you need to see any of my code just let me know, I will make it open source once its further along but in the meantime I can post whatever snippets you need to see here.
Thanks