{"id":50466041,"url":"https://github.com/v0l/jktool-rs","last_synced_at":"2026-06-01T07:32:35.007Z","repository":{"id":354167396,"uuid":"1220746396","full_name":"v0l/jktool-rs","owner":"v0l","description":"JK BMS (JIKONG) cli tool","archived":false,"fork":false,"pushed_at":"2026-04-27T12:52:39.000Z","size":58,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-27T13:22:02.176Z","etag":null,"topics":["bms","jkbms"],"latest_commit_sha":null,"homepage":"","language":"Rust","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/v0l.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-04-25T09:22:14.000Z","updated_at":"2026-04-27T12:52:43.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/v0l/jktool-rs","commit_stats":null,"previous_names":["v0l/jktool-rs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/v0l/jktool-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v0l%2Fjktool-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v0l%2Fjktool-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v0l%2Fjktool-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v0l%2Fjktool-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/v0l","download_url":"https://codeload.github.com/v0l/jktool-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/v0l%2Fjktool-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33765378,"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-01T02:00:06.963Z","response_time":115,"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":["bms","jkbms"],"created_at":"2026-06-01T07:32:34.211Z","updated_at":"2026-06-01T07:32:35.001Z","avatar_url":"https://github.com/v0l.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jktool-rs\n\nRust implementation of [jktool](https://github.com/sshoecraft/jktool) — a command-line tool for communicating with JIKONG (JK) Battery Management Systems.\n\nSupports the JK02 (24S/32S) and JK04 protocol variants, with automatic detection based on the BMS model string. Provides a reusable library (`jk_bms`) and a CLI (`jktool`).\n\n## Features\n\n- **Multi-transport**: Serial, Bluetooth (optional), with the same `transport:target` syntax as the original\n- **Protocol support**: JK02_24S, JK02_32S (PB2/BD/HY series), JK04 (auto-detected from info frame)\n- **Live data**: Cell voltages, temperatures, SOC/SOH, power, errors, MOSFET states\n- **Settings read/write**: Full register map with human-readable names, scaling, and write frame generation\n- **Output formats**: Text, CSV, JSON (with pretty-print)\n- **BLE frame assembly**: Handles fragmented BLE notifications with CRC verification\n- **Frame assembler**: Reassembles 300-byte JK frames from small BLE MTU chunks\n\n## Building\n\n```bash\ncargo build\n```\n\nWith Bluetooth support:\n\n```bash\ncargo build --features bluetooth\n```\n\n## Usage\n\nTransports are specified as `transport:target[,options]` — same syntax as the original jktool.\n\n### Serial\n\n```bash\njktool -t serial:/dev/ttyUSB0,9600\n```\n\n### Bluetooth\n\n```bash\njktool -t bt:01:02:03:04:05:06,ffe1\n```\n\n### Read live data (default)\n\n```bash\njktool -t serial:/dev/ttyUSB0,9600\n```\n\n### Read settings\n\n```bash\njktool -t bt:01:02:03:04:05:06 settings\n```\n\n### Write a setting\n\n```bash\njktool -t serial:/dev/ttyUSB0,9600 set max_charge_current 50.0\njktool -t bt:01:02:03:04:05:06 set charging on\n```\n\n### List supported settings\n\n```bash\njktool list-settings\n```\n\n### Output to file (JSON)\n\n```bash\njktool -t serial:/dev/ttyUSB0,9600 -f json -o pack.json\n```\n\n### Scan for Bluetooth devices\n\n```bash\njktool scan\n```\n\n## Library\n\nThe `jk_bms` crate provides the core protocol implementation:\n\n```rust\nuse jk_bms::{MybmmPack, FrameAssembler, getdata, get_info_command, get_cell_info_command};\n\nlet mut pack = MybmmPack::new(\"pack1\");\nlet mut assembler = FrameAssembler::new();\n\n// Feed raw bytes from any transport\nassembler.feed(\u0026bytes);\nif let Some(frame) = assembler.try_decode() {\n    let flags = getdata(\u0026mut pack, \u0026frame);\n    println!(\"Voltage: {:.3} V\", pack.voltage);\n    println!(\"Cells: {}\", pack.cells);\n}\n```\n\n## Protocol versions\n\n| Version | Models | Cell voltages | Max cells |\n|---------|--------|---------------|-----------|\n| JK02_24S | JK-B2AxxS | 2-byte LE mV | 24 |\n| JK02_32S | JK_PB2, JK-BD, JK_HY | 2-byte LE mV (16-byte offset) | 32 |\n| JK04 | Older JK-BMS | IEEE 754 float | 24 |\n\nAuto-detected from the BMS info frame model string.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv0l%2Fjktool-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fv0l%2Fjktool-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fv0l%2Fjktool-rs/lists"}