Documentation on HIDKeyboard
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- grantbt
- Posts: 35
- Joined: Mon Dec 10, 2018 7:45 pm
Re: Documentation on HIDKeyboard
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.
I still have reservations about the slow speed, the weak UART implementation and lack of F13-F24 keys.
- bbx10node
- Posts: 148
- Joined: Sun Feb 22, 2015 4:14 pm
Re: Documentation on HIDKeyboard
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.
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.
- grantbt
- Posts: 35
- Joined: Mon Dec 10, 2018 7:45 pm
Re: Documentation on HIDKeyboard
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.
- bbx10node
- Posts: 148
- Joined: Sun Feb 22, 2015 4:14 pm
Re: Documentation on HIDKeyboard
The version is 0.8.0.
- bbx10node
- Posts: 148
- Joined: Sun Feb 22, 2015 4:14 pm
Re: Documentation on HIDKeyboard
Python3 key up/down to BLE HID keyboard. CP2104 + Bluefruit Friend UART running at 115200 with CTS/RTS hardware flow control.
https://BANNED.com/p9Bqn4vd
https://BANNED.com/p9Bqn4vd
- willwade
- Posts: 50
- Joined: Sat Dec 01, 2018 3:04 pm
Re: Documentation on HIDKeyboard
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!)
- grantbt
- Posts: 35
- Joined: Mon Dec 10, 2018 7:45 pm
Re: Documentation on HIDKeyboard
So, just to be clear, the Linux Box + Bluefruit LE Friend dongle looks like a keyboard to a remote iPad? Is that your situation?bbx10node wrote: Even after powering the BF off and back on, it auto reconnects to the iPad. The baudrate is retained across power cycles.
- bbx10node
- Posts: 148
- Joined: Sun Feb 22, 2015 4:14 pm
Re: Documentation on HIDKeyboard
@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.BANNED.com/20 ... h-arduino/
@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.BANNED.com/20 ... h-arduino/
- grantbt
- Posts: 35
- Joined: Mon Dec 10, 2018 7:45 pm
Re: Documentation on HIDKeyboard
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).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.
- bbx10node
- Posts: 148
- Joined: Sun Feb 22, 2015 4:14 pm
Re: Documentation on HIDKeyboard
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.
The coding is very different (no AT commands) but there are examples.
- grantbt
- Posts: 35
- Joined: Mon Dec 10, 2018 7:45 pm
Re: Documentation on HIDKeyboard
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.
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.
- willwade
- Posts: 50
- Joined: Sat Dec 01, 2018 3:04 pm
Re: Documentation on HIDKeyboard
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
- bbx10node
- Posts: 148
- Joined: Sun Feb 22, 2015 4:14 pm
Re: Documentation on HIDKeyboard
@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://BANNED.com/cSxPmvap
AT command sketch for the 840. https://BANNED.com/Ddb3QXN1
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://BANNED.com/cSxPmvap
AT command sketch for the 840. https://BANNED.com/Ddb3QXN1
- willwade
- Posts: 50
- Joined: Sat Dec 01, 2018 3:04 pm
Re: Documentation on HIDKeyboard
@bbx10node - I need to jointly work on this app. Mind if I put it in Github? Happy for me to reference you?! :)
- bbx10node
- Posts: 148
- Joined: Sun Feb 22, 2015 4:14 pm
Re: Documentation on HIDKeyboard
@willwade Feel free to do whatever you want with the code. Much of it comes from examples so it is not all my code.
Please be positive and constructive with your questions and comments.