0

Documentation on HIDKeyboard
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: Documentation on HIDKeyboard

by grantbt on Wed Jan 02, 2019 4:15 pm

There is a report elsewhere on this forum that v0.7.7 works OK, whereas v0.8.0 has the no-reconnect issue. I have some people testing it now and will report back on whether or not this module is really usable in multiple environments.

I still have reservations about the slow speed, the weak UART implementation and lack of F13-F24 keys.

grantbt
 
Posts: 28
Joined: Mon Dec 10, 2018 7:45 pm

Re: Documentation on HIDKeyboard

by bbx10node on Sun Jan 06, 2019 10:22 pm

I am using a Bluefruit LE UART Friend with a CP2104 break out board. This combo has CTS and RTS connected for hardware flow control. This is important because the UART speed is running at 115200 (AT+BAUDRATE=115200). This helps reduce the delays caused by the long AT keyboard commands.

The BF is plugged into a Linux computer and is driven by a Python program. The program opens a pygame window to capture key up/down events and send AT+BLEKEYBOARDCODE commands to the BF. This works so far with an iPad.

Even after powering the BF off and back on, it auto reconnects to the iPad. The baudrate is retained across power cycles.

bbx10node
 
Posts: 132
Joined: Sun Feb 22, 2015 4:14 pm

Re: Documentation on HIDKeyboard

by grantbt on Mon Jan 07, 2019 11:32 am

What version of firmware is in your module(s)? I've thought of moving to 115200, but with the problems I was experiencing I expected the basic plumbing to get worse. That needs to be solid before I can tackle the slow speed.

grantbt
 
Posts: 28
Joined: Mon Dec 10, 2018 7:45 pm

Re: Documentation on HIDKeyboard

by bbx10node on Mon Jan 07, 2019 12:31 pm

The version is 0.8.0.

bbx10node
 
Posts: 132
Joined: Sun Feb 22, 2015 4:14 pm

Re: Documentation on HIDKeyboard

by bbx10node on Mon Jan 14, 2019 10:44 pm

Python3 key up/down to BLE HID keyboard. CP2104 + Bluefruit Friend UART running at 115200 with CTS/RTS hardware flow control.

https://pastebin.com/p9Bqn4vd

bbx10node
 
Posts: 132
Joined: Sun Feb 22, 2015 4:14 pm

Re: Documentation on HIDKeyboard

by willwade on Tue Jan 15, 2019 4:13 am

Interesting. Thanks for that. I’m going to order one of these - it seems cp2104 is already on board: https://shop.pimoroni.com/products/adaf ... escription - I’m going to try and follow your lead here (thanks for the code. Neat!)

willwade
 
Posts: 17
Joined: Sat Dec 01, 2018 3:04 pm

Re: Documentation on HIDKeyboard

by grantbt on Tue Jan 15, 2019 12:48 pm

bbx10node wrote:Even after powering the BF off and back on, it auto reconnects to the iPad. The baudrate is retained across power cycles.


So, just to be clear, the Linux Box + Bluefruit LE Friend dongle looks like a keyboard to a remote iPad? Is that your situation?

grantbt
 
Posts: 28
Joined: Mon Dec 10, 2018 7:45 pm

Re: Documentation on HIDKeyboard

by bbx10node on Tue Jan 15, 2019 4:05 pm

@willwade That board looks better than the separate boards. No soldering and cheaper!

@grantbt Take a look at the link to get an idea of what the target is. The Linux + keyboard development system is used to evaluate the Bluefruit Friend running at 115200 but it is not the target. There are assistive tech input methods that do not use physical keyboards but generate key up/down events.

https://haroldpimentel.wordpress.com/20 ... h-arduino/

bbx10node
 
Posts: 132
Joined: Sun Feb 22, 2015 4:14 pm

Re: Documentation on HIDKeyboard

by grantbt on Tue Jan 15, 2019 4:43 pm

bbx10node wrote:@grantbt Take a look at the link to get an idea of what the target is. The Linux + keyboard development system is used to evaluate the Bluefruit Friend running at 115200 but it is not the target. There are assistive tech input methods that do not use physical keyboards but generate key up/down events.


OK, looks interesting. Just be sure to test on whatever devices+OS (tablet, phone, PC) you hope to use in the end. I've found surprises and disappointments (mostly on the PC side).

grantbt
 
Posts: 28
Joined: Mon Dec 10, 2018 7:45 pm

Re: Documentation on HIDKeyboard

by bbx10node on Wed Jan 16, 2019 1:13 am

I ran BLE HID keyboard examples on a Adafruit Feather nRF52840. It reconnects after power cycling to my Android phone, iPad, and Win 10 computer without re-pairing. Auto connect works better than the BF Friend. Of course, there are lots of versions of Android, Windows, and IOS so these are just three data points.

The coding is very different (no AT commands) but there are examples.

bbx10node
 
Posts: 132
Joined: Sun Feb 22, 2015 4:14 pm

Re: Documentation on HIDKeyboard

by grantbt on Wed Jan 16, 2019 12:37 pm

Thanks, that's refreshing to hear. It seems like a pretty different beast to the nRF51822 based LE UART.

I'll have to see if there is an equivalent to the Adafruit Feather nRF528xx with an interface that a micro can use to control it (UART would be great) and minimum extra hardware for price saving. I'm basically looking for a "slave" device to my micro that allows me to create a full-featured BLE HID keyboard or generic/raw BLE HID device.

grantbt
 
Posts: 28
Joined: Mon Dec 10, 2018 7:45 pm

Re: Documentation on HIDKeyboard

by willwade on Thu Jan 17, 2019 1:56 pm

Wow. @bbx10node you are a hero. This works! AMAZING! Amazing that there is no arduino/soldering/arduino code needed with the v3 of that module. Awesome

willwade
 
Posts: 17
Joined: Sat Dec 01, 2018 3:04 pm

Re: Documentation on HIDKeyboard

by bbx10node on Thu Jan 17, 2019 8:06 pm

@willwade I'm glad to hear it works.

I found the nRF52840 Feather does a better job at reconnecting after a power cycle on Win10 so I created a small sketch that implements the AT+BLEKEYBOARDCODE command. This makes the 840 work with the Python program even though the 840 does not understand any other AT command.

Updated ble_uart.py to include support for the 840. https://pastebin.com/cSxPmvap

AT command sketch for the 840. https://pastebin.com/Ddb3QXN1

bbx10node
 
Posts: 132
Joined: Sun Feb 22, 2015 4:14 pm

Re: Documentation on HIDKeyboard

by willwade on Fri Jan 18, 2019 11:45 am

@bbx10node - I need to jointly work on this app. Mind if I put it in Github? Happy for me to reference you?! :)

willwade
 
Posts: 17
Joined: Sat Dec 01, 2018 3:04 pm

Re: Documentation on HIDKeyboard

by bbx10node on Sat Jan 19, 2019 5:05 am

@willwade Feel free to do whatever you want with the code. Much of it comes from examples so it is not all my code.

bbx10node
 
Posts: 132
Joined: Sun Feb 22, 2015 4:14 pm

Please be positive and constructive with your questions and comments.