{"id":19871439,"url":"https://github.com/esp32beans/ble_hid_client","last_synced_at":"2026-02-28T13:32:19.144Z","repository":{"id":44697491,"uuid":"512914270","full_name":"esp32beans/BLE_HID_Client","owner":"esp32beans","description":"ESP32 NimBLE Bluetooth Low Energy HID Client/Central and Mouse Pass Through","archived":false,"fork":false,"pushed_at":"2022-09-19T21:06:25.000Z","size":43,"stargazers_count":31,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-02T09:48:42.914Z","etag":null,"topics":["arduino","ble","ble-central","ble-client","bluetooth","bluetooth-low-energy","esp32","hid","mouse","nimble","pass-through"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/esp32beans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-11T21:31:50.000Z","updated_at":"2025-04-03T00:37:59.000Z","dependencies_parsed_at":"2023-01-18T14:45:18.510Z","dependency_job_id":null,"html_url":"https://github.com/esp32beans/BLE_HID_Client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/esp32beans/BLE_HID_Client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esp32beans%2FBLE_HID_Client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esp32beans%2FBLE_HID_Client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esp32beans%2FBLE_HID_Client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esp32beans%2FBLE_HID_Client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esp32beans","download_url":"https://codeload.github.com/esp32beans/BLE_HID_Client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esp32beans%2FBLE_HID_Client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29935364,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T13:16:57.922Z","status":"ssl_error","status_checked_at":"2026-02-28T13:11:15.149Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","ble","ble-central","ble-client","bluetooth","bluetooth-low-energy","esp32","hid","mouse","nimble","pass-through"],"created_at":"2024-11-12T16:12:20.986Z","updated_at":"2026-02-28T13:32:19.123Z","avatar_url":"https://github.com/esp32beans.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESP32 NimBLE HID Client\n\nThis demo configures ESP32 NimBLE as a BLE client/central which connects to BLE\nHID servers/peripherals such as BLE mice. It has been tested with\n[ESP32-NimBLE-Mouse](https://github.com/wakwak-koba/ESP32-NimBLE-Mouse) and\na real BLE trackball mouse.\n\nThe mouse input parameters (for example, x, y, buttons) can be used to control\nmotors, servos, and LEDs.\n\n## Libraries\n\nInstall the following use the Arduino IDE Library Manager.\n\n* \"NimBLE-Arduino\" by h2zero\n\n## Examples\n\nThe sketch code has been moved to the examples directory.\n\n### BLE_HID_Joystick\n\nArduino library for a BLE Gamepad/Joystick. The BLE HID code is moved\ninto BLE_Client_Joystick.cpp/.h. The example sketch is now very short\nwith callback functions for stick movement and button presses.\n\n### BLE_HID_Client\n\nThe original BLE HID client demo.\n\nThe following HID devices work.\n\n* ESP32 running ESP32-NimBLE-Mouse\n* BLE Trackball mouse https://www.amazon.com/dp/B09HHHDZZG/\n* Microsoft Bluetooth Mouse https://www.amazon.com/dp/B07Y41YMMJ/\n* BLE Gamepad/Joystick https://www.amazon.com/dp/B09QJLV6JJ/\n\n### BLE_HID_Mouse_USB\n\nThis demo converts BLE mouse movements and button clicks to USB mouse.\nWorks with a real trackball mouse. Must use an ESP32 S3 to get BLE and\nUSB on the same board. ESP32 S2 has USB but not BLE. ESP32 original has\nBLE but not USB.\n\nWARNING: sendReport.patch is required to add USBHIDMouse::sendReport.\n\nWorks with the following.\n* ESP32 running ESP32-NimBLE-Mouse\n* BLE Trackball mouse https://www.amazon.com/dp/B09HHHDZZG/\n\n## Sample output from BLE_HID_Client\n\nThe BLE mouse is actually another ESP32 running ESP32-NimBLE-Mouse.\n\n```\nStarting scan\nAdvertised Device found: Name: ESP32-Mouse, Address: 4c:75:25:xx:yy:zz, appearance: 962, serviceUUID: 0x1812\nFound HID device\nScan Ended\nConnected\nReconnected client\nConnected to: 4c:75:25:xx:yy:zz\nRSSI: -39\n0x2a4d Value: \nHID_REPORT_MAP 0x2a4b Value: 5,1,9,2,A1,1,9,1,A1,0,5,9,19,1,29,5,15,0,25,1,75,1,95,5,81,2,75,3,95,1,81,3,5,1,9,30,9,31,9,38,15,81,25,7F,75,8,95,3,81,6,5,C,A,38,2,15,81,25,7F,75,8,95,1,81,6,C0,C0,\nDone with this device!\nSuccess! we should now be getting notifications!\nNotification from 4c:75:25:xx:yy:zz: Service = 0x1812, Characteristic = 0x2a4d, Value = 1,0,0,0,0, buttons: 0x01 x: 0 y: 0 wheel: 0 hwheel:0\nNotification from 4c:75:25:xx:yy:zz: Service = 0x1812, Characteristic = 0x2a4d, Value = 0,0,0,0,0, buttons: 0x00 x: 0 y: 0 wheel: 0 hwheel:0\n```\n\nThe HID_REPORT_MAP is a HID report descriptor. Pasting the hex digits into\nhttp://eleccelerator.com/usbdescreqparser/ produces the following.\n```\n0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)\n0x09, 0x02,        // Usage (Mouse)\n0xA1, 0x01,        // Collection (Application)\n0x09, 0x01,        //   Usage (Pointer)\n0xA1, 0x00,        //   Collection (Physical)\n0x05, 0x09,        //     Usage Page (Button)\n0x19, 0x01,        //     Usage Minimum (0x01)\n0x29, 0x05,        //     Usage Maximum (0x05)\n0x15, 0x00,        //     Logical Minimum (0)\n0x25, 0x01,        //     Logical Maximum (1)\n0x75, 0x01,        //     Report Size (1)\n0x95, 0x05,        //     Report Count (5)\n0x81, 0x02,        //     Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)\n0x75, 0x03,        //     Report Size (3)\n0x95, 0x01,        //     Report Count (1)\n0x81, 0x03,        //     Input (Const,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)\n0x05, 0x01,        //     Usage Page (Generic Desktop Ctrls)\n0x09, 0x30,        //     Usage (X)\n0x09, 0x31,        //     Usage (Y)\n0x09, 0x38,        //     Usage (Wheel)\n0x15, 0x81,        //     Logical Minimum (-127)\n0x25, 0x7F,        //     Logical Maximum (127)\n0x75, 0x08,        //     Report Size (8)\n0x95, 0x03,        //     Report Count (3)\n0x81, 0x06,        //     Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)\n0x05, 0x0C,        //     Usage Page (Consumer)\n0x0A, 0x38, 0x02,  //     Usage (AC Pan)\n0x15, 0x81,        //     Logical Minimum (-127)\n0x25, 0x7F,        //     Logical Maximum (127)\n0x75, 0x08,        //     Report Size (8)\n0x95, 0x01,        //     Report Count (1)\n0x81, 0x06,        //     Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)\n0xC0,              //   End Collection\n0xC0,              // End Collection\n\n// 67 bytes\n\n// best guess: USB HID Report Descriptor\n```\n\nThe Notification lines appear when a button is pressed and released on the\nESP32 mouse or trackball mouse.\n\n## Warning if using ESP32 S3\n\nArduino-esp32 2.0.4 works fine except for a few problems with ESP32 S3.\nIf you are not planning to use ESP32 S3, just use the latest stable\nrelease. If you have problems with ESP32 S3, try the previous release,\n2.0.3.\n\nArduino-esp32 2.0.5 seems to work fine on ESP32 S3 when using\nBLE_HID_Mouse_USB.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesp32beans%2Fble_hid_client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesp32beans%2Fble_hid_client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesp32beans%2Fble_hid_client/lists"}