You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-31Lines changed: 27 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,19 @@
1
1
# ESP32 Mouse/Keyboard for BLE HID
2
2
ESP32 implementation for HID over GATT Keyboard and Mouse (Bluetooth Low Energy). Including serial API for external modules (similar to Adafruit EZKey HID).
3
3
4
-
A great thank you to Paul Stoffregen for the implementation of the keyboard layouts for his Teensyduino project:
5
-
www.pjrc.com
4
+
### Credits and many thanks to:
5
+
- Paul Stoffregen for the implementation of the keyboard layouts for his Teensyduino project: www.pjrc.com
6
+
- Neil Kolban for his great contributions to the ESP32 SW (in particular the Bluetooth support): https://github.com/nkolban
7
+
- Chegewara for help and support
8
+
6
9
and to Espressif for providing the HID implementation within the esp-idf.
7
10
8
11
9
12
# Control via stdin (make monitor)
10
13
11
-
For basic mouse and keyboard testing, this project includes some commands which
12
-
can be triggered via the make monitor console.
13
-
If there is no command found via this parser, the data is forwarded to the
14
-
parser for the second UART (see following chapter).
14
+
For basic mouse and keyboard testing, some Bluettooh HID reports can be triggered via the
15
+
keyboard when the make monitor console is running (see Espressiv IDF: https://github.com/espressif/esp-idf).
15
16
16
-
Note: To be sure there is no garbage sent to the second parser, please flush
17
-
the buffer via the Enter key. Then type the command and send it via Enter.
18
17
19
18
|Key|Function |Description|
20
19
|---|-----------|-----------|
@@ -24,34 +23,29 @@ the buffer via the Enter key. Then type the command and send it via Enter.
24
23
|w |Mouse up |Move mouse up by 30px |
25
24
|l |Click left |Mouse click right |
26
25
|r |Click right|Mouse click left |
27
-
|Q|Type 'y' |Type the key y with a 1s delay (avoiding endless loops)|
26
+
|q|Type 'y' |just for testing keyboard reports|
28
27
29
-
Any none listed keys are forwarded to the second parser.
30
28
31
29
32
30
# Control via 2nd UART
33
31
34
-
This interface is primarily used to control this module by an external microcontroller (in our case
35
-
either a AVR Mega32U4 in the FABI device or a TeensyLC in the FLipMouse device).
36
-
Each command is started with one or two upper letters and a variable number of parameter bytes.
37
-
A command must be terminated by a '\n' character!
32
+
This interface is primarily used to control mouse / keyboard activities via an external microcontroller.
33
+
Each command is started with a '$' character, followed by a command name (uppercase letters) and a variable number of parameters.
34
+
A command must be terminated by a '\n' character (LF, ASCII value 10)!
38
35
39
-
TBD: currently the UART is not configured, this parser is just used by the stdin console. After testing all
40
-
commands, it will be changed and the configured GPIO pins are stated here.
41
36
42
37
|Command|Function|Parameters|Description|
43
38
|-------|--------|----------|-----------|
44
-
|ID|Get ID|--|Prints out the ID of this module, used to determine version or attached module type|
39
+
|ID|Get ID|--|Prints out the ID of this module (firmware version number)|
45
40
|GP|Get BLE pairings|--|Prints out all paired devices' MAC adress. The order is used for DP as well, starting with 0|
46
-
|DP|Delete one pairing|number of pairing, either as ASCII '0'-'9' or 0x00-0x09|Deletes one pairing. The pairing number is determined by the command GP|
47
-
|PM|Set pairing mode|'0'/'1' or 0x00/0x01|Enables (1) or disables (0) discovery/advertising and terminates an exisiting connection if enabled|
48
-
|ID_FABI|Set BLE device name|--|Set the device name to "FABI" and store permanently. Restarting required.|
49
-
|ID_FLIPMOUSE|Set BLE device name|--|Set the device name to "FLipMouse" and store permanently. Restarting required.|
50
-
|M|Mouse control|4 Bytes|Issue a mouse HID report, parameter description is below|
51
-
|KR|Keyboard, release all|--|Releases all keys & modifiers and sends a HID report|
52
-
|KD|Keyboard, key down|1Byte keycode|Adds this keycode to the 6 available key slots and sends a HID report.|
53
-
|KU|Keyboard, key up|1Byte keycode|Removes this keycode from the 6 available key slots and sends a HID report.|
54
-
|KL|Keyboard, set layout/locale|1Byte|Set the keyboard layout to the given locale number (see below), stored permanently. Restarting required.|
41
+
|DP|Delete one pairing|number of pairing, given as ASCII-characer '0'-'9'|Deletes one pairing. The pairing number is determined by the command GP|
42
+
|PM|Set pairing mode|'0' / '1'|Enables (1) or disables (0) discovery/advertising and terminates an exisiting connection if enabled|
43
+
|NAME|Set BLE device name|name as ASCII string|Set the device name to the given name. Restart required.|
44
+
|M|Mouse control|4 ASCII-integer values (seperated by space or comma)|Issue a mouse HID report, parameter description is below|
45
+
|KA|Keyboard, release all|--|Releases all keys & modifiers and sends a HID report|
46
+
|KH|Keyboard, key hold|keycode as ASCII integer value|Adds this keycode to the 6 available key slots and sends a HID report.|
47
+
|KR|Keyboard, key release|keycode as ASCII integer value|Removes this keycode from the 6 available key slots and sends a HID report.|
48
+
|KL|Keyboard, set layout/locale|locale code as ASCII integer value|Set the keyboard layout to the given locale number (see below), stored permanently. Restarting required.|
55
49
|KW|Keyboard write text|n Bytes|Write a text via the keyboard. Supported are ASCII as well as UTF8 character streams.|
56
50
|KC|Keyboard get keycode for character|2 Bytes|Get a corresponding keycode for the given character. 2 Bytes are parsed for UTF8, if there is only a ASCII character, use the first sent byte only.|
57
51
@@ -60,16 +54,18 @@ commands, it will be changed and the configured GPIO pins are stated here.
0 commit comments