{"id":21201690,"url":"https://github.com/oleander/motorcycle-ble-media-controller","last_synced_at":"2025-03-14T22:25:59.942Z","repository":{"id":155576491,"uuid":"631383290","full_name":"oleander/Motorcycle-BLE-Media-Controller","owner":"oleander","description":"A Bluetooth Low Energy (BLE) single-button media controller for motorcycles, compatible with iPhone and other devices, enabling easy control of music playback, volume, and voice assistant","archived":false,"fork":false,"pushed_at":"2023-06-05T09:25:58.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-21T14:47:38.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/oleander.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-22T21:13:29.000Z","updated_at":"2024-02-07T10:59:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"7c9c35a2-46c1-4cf8-8fa1-0e953789553c","html_url":"https://github.com/oleander/Motorcycle-BLE-Media-Controller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2FMotorcycle-BLE-Media-Controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2FMotorcycle-BLE-Media-Controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2FMotorcycle-BLE-Media-Controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oleander%2FMotorcycle-BLE-Media-Controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oleander","download_url":"https://codeload.github.com/oleander/Motorcycle-BLE-Media-Controller/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243654400,"owners_count":20325893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-20T20:10:32.637Z","updated_at":"2025-03-14T22:25:59.919Z","avatar_url":"https://github.com/oleander.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Motorcycle-BLE-Media-Controller\n\nA Bluetooth Low Energy (BLE) single-button media controller for motorcycles, compatible with iPhone and other devices, enabling easy control of music playback and volume.\n\n## Requirements\n\nThis project is developed using Arduino Studio and tested on an ESP32 microcontroller. The following libraries are required:\n\n1. [ESP32-BLE-Keyboard](https://github.com/T-vK/ESP32-BLE-Keyboard) (with a minor modification, see below)\n2. [OneButton](https://github.com/mathertel/OneButton)\n3. [NimBLE-Arduino](https://github.com/h2zero/NimBLE-Arduino) (required by ESP32-BLE-Keyboard)\n\n## Installing Libraries\n\n### OneButton\n\n1. Open Arduino Studio.\n2. Go to `Tools \u003e Manage Libraries...` or press `Ctrl + Shift + I`.\n3. Search for `OneButton` in the search bar.\n4. Click on the `OneButton` library by Matthias Hertel and click on `Install`.\n\n### NimBLE-Arduino\n\n1. Open Arduino Studio.\n2. Go to `Tools \u003e Manage Libraries...` or press `Ctrl + Shift + I`.\n3. Search for `NimBLE-Arduino` in the search bar.\n4. Click on the `NimBLE-Arduino` library by h2zero and click on `Install`.\n\n### ESP32-BLE-Keyboard\n\n1. Download the library from the [GitHub repository](https://github.com/T-vK/ESP32-BLE-Keyboard).\n2. Unzip the downloaded file.\n3. Rename the unzipped folder to `ESP32_BLE_Keyboard`.\n4. Move the folder to the Arduino `libraries` folder (usually located in your `Documents` folder under `Arduino/libraries`).\n5. Apply the modification mentioned below.\n\n## Modification to ESP32-BLE-Keyboard Library\n\nIn order to prevent iOS from showing a border around the phone (because it thinks it's a keypad instead of a keyboard), a modification to the ESP32-BLE-Keyboard library is required. Inside the `BLEKeyboard.cpp` file, find the following line:\n\n```cpp\nUSAGE(1),           0x06,          // USAGE (Keyboard)\n```\n\nChange it to:\n\n```cpp\nUSAGE(1),           0x07,          // USAGE (Keyboard)\n```\n\n## Pin code\n\nIn `BLEKeyboard.cpp`, below `BLEDevice::init(deviceName);` add the following line:\n\n```cpp\nNimBLEDevice::setSecurityPasskey(111111);\nNimBLEDevice::setSecurityIOCap(BLE_HS_IO_DISPLAY_ONLY);\n```\n\n`111111` is the pin code, you can change it to whatever you want, but it has to be 6 digits.\n\n## Enable NimBLE\n\nIn `BLEKeyboard.h`, uncomment the following line:\n\n```cpp\n// #define USE_NIMBLE\n```\n\n## Implemented Events\n\nThe single button on the motorcycle handlebar can trigger the following events:\n\n* Single click: Play/Pause music\n* Double click: Next track\n* Triple click: Previous track\n* Long press: Volume up\n\n## Setup and Usage\n\n1. Install the required libraries mentioned above.\n2. Apply the modification to the ESP32-BLE-Keyboard library (if not already applied).\n3. Upload the main sketch to the ESP32 microcontroller.\n4. Pair the ESP32 with your iPhone or other devices.\n5. Use the single button to control media playback and volume.\n\n## License\n\nThis project is open-source and available under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Fmotorcycle-ble-media-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foleander%2Fmotorcycle-ble-media-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foleander%2Fmotorcycle-ble-media-controller/lists"}