{"id":51102626,"url":"https://github.com/cycbox/esp-nus","last_synced_at":"2026-06-24T12:01:03.059Z","repository":{"id":364906537,"uuid":"1269680501","full_name":"cycbox/esp-nus","owner":"cycbox","description":"High-throughput BLE UART bridge","archived":false,"fork":false,"pushed_at":"2026-06-15T03:41:38.000Z","size":100,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-15T04:12:17.291Z","etag":null,"topics":["ble","esp32","uart"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cycbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-15T02:01:18.000Z","updated_at":"2026-06-15T03:47:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/cycbox/esp-nus","commit_stats":null,"previous_names":["cycbox/esp-nus"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/cycbox/esp-nus","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycbox%2Fesp-nus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycbox%2Fesp-nus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycbox%2Fesp-nus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycbox%2Fesp-nus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cycbox","download_url":"https://codeload.github.com/cycbox/esp-nus/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cycbox%2Fesp-nus/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34731256,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ble","esp32","uart"],"created_at":"2026-06-24T12:01:02.283Z","updated_at":"2026-06-24T12:01:03.040Z","avatar_url":"https://github.com/cycbox.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-nus — High-throughput BLE 5 UART bridge (ESP32-C6)\n\nA transparent UART-BLE cable replacement for the ESP32-C6, exposing the\nNordic UART Service (NUS) and tuned for throughput.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"esp32-c6-devkitc.webp\" alt=\"ESP32-C6-DevKitC test board\" width=\"420\"\u003e\n\u003c/p\u003e\n\n\u003e Tested on the ESP32-C6-DevKitC.\n\nBytes arriving on the hardware UART RX pin are streamed to the connected BLE\ncentral as TX notifications; bytes the central writes to the RX characteristic\nare clocked out the UART TX pin.\n\n## NUS GATT layout\n\n| Role | UUID | Properties |\n|------|------|-----------|\n| Service | `6E400001-B5A3-F393-E0A9-E50E24DCCA9E` | primary |\n| RX (central → device) | `6E400002-…` | Write, Write No Response |\n| TX (device → central) | `6E400003-…` | Notify |\n\n## What makes it \"high throughput\"\n\nNegotiated on every connection (each best-effort; a central may decline any):\n\n- **LE 2M PHY** — `ble_gap_set_prefered_le_phy()`, ~2× the raw 1M rate.\n- **Data Length Extension** — `ble_gap_set_data_len()` requests 251-byte\n  link-layer payloads so large notifications aren't fragmented on air.\n- **Large ATT MTU (preferred up to 512)** — set as the preferred MTU; the\n  central initiates the exchange. For best efficiency use an MTU of **247**:\n  the resulting 244-byte payload (247 − 3 ATT) plus the 4-byte L2CAP header is\n  exactly 251 bytes, so each notification/write rides in a **single link-layer\n  PDU** with DLE — no on-air fragmentation.\n- **7.5 ms connection interval** — `ble_gap_update_params()` for the minimum\n  interval and zero latency.\n- **Flow-controlled notifications** — a credit pool (`NUS_TX_CREDITS`, default\n  16) keeps several notifications pipelined to the controller without ever\n  exhausting the NimBLE mbuf pool. Credits are returned on\n  `BLE_GAP_EVENT_NOTIFY_TX`, so a fast UART source applies natural backpressure\n  instead of dropping data or spinning.\n\n## Build, flash, monitor\n\n```sh\n. ~/esp/esp-idf/export.sh\nidf.py set-target esp32c6\nidf.py build\nidf.py -p /dev/ttyACM0 flash monitor\n```\n\n## Configuration\n\n`idf.py menuconfig` → **UART\u003c-\u003eBLE Bridge**:\n\n| Setting | Default | Notes |\n|---------|---------|-------|\n| Advertised BLE device name | `ESP-NUS` | |\n| UART port number | `0` | console is moved to USB-Serial-JTAG, freeing UART0 |\n| UART baud rate | `921600` | match expected BLE throughput |\n| UART TX / RX GPIO | `16` / `17` | C6 UART0 default pads |\n| HW (RTS/CTS) flow control | off | **recommended at high baud** to avoid RX overruns |\n| RTS / CTS GPIO | `6` / `7` | when flow control enabled |\n| Driver RX / TX buffers | `8192` each | absorb bursts while the other side drains |\n| UART read chunk / timeout | `1024` B / `20` ms | latency vs. BLE write size |\n| BLE→UART stream buffer | `16384` | hold a full inbound N×244 B batch |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycbox%2Fesp-nus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcycbox%2Fesp-nus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcycbox%2Fesp-nus/lists"}