# smongrot SDK > Read-only (level 1) Honda motorcycle ECU diagnostics over a K-Line cable: ECU identity, live engine data, stored fault codes (beta). Machine-readable spec + golden test vectors; SDKs in JavaScript (npm `@smongrot/sdk`) and Dart (pub `smongrot_sdk`), MIT, v0.1. Source of truth is the JSON spec. An implementation is correct only if it passes every vector in `vectors/`. ## Rules an implementation MUST follow - K-Line 10400 baud 8N1. Strip the TX echo from every read-back (spec/kline.json `echo_strip`). - Checksum = (0x100 − (sum mod 256)) mod 256; always mask to 8 bits (a body summing to 0x100 has checksum 0x00). Never a plain sum. - Wake = LOW 70 ms timed atomically on the adapter, then 130 ms idle. Retry wake + StartComm + liveness up to 4 times. - Send StartDiag `72 05 71 00 18` before any live table read. - Take reply data only from the LAST checksum-valid `02 L ` frame; a reply shorter than the table's data_len is no data. - A missing or sentinel value is "absent", never 0; an out-of-range value is "invalid" and is never replaced by a fallback source. - Keep each value's provenance (bench / field / reference / provisional); do not hide "provisional". - Fault codes are beta: decode only Keihin boxes; anything that does not parse is "unreadable", never guessed. - Level 1 sends no write, erase or state-changing frame (no DTC clear). Never call a network from the decoder. - The model name is optional and comes from `GET https://api.smongrot.com/v1/ecu/identify?ecm=<10 hex>` with a free API key. A failed lookup gives model null and never breaks identify, live data or fault codes. ## Platforms (v0.1) - Cable only: desktop Chrome / Edge (WebSerial), Node (`serialport`), Flutter desktop (`smongrot_sdk_libserialport`), Android USB-OTG (`smongrot_sdk_usb_serial`). - Not yet: iOS (no USB serial on iOS) and the SMR Bluetooth board, both in v0.2. ## Spec - [spec/kline.json](https://developers.smongrot.com/spec/kline.json): wire, wake, session, checksum, echo strip, timing - [spec/live.json](https://developers.smongrot.com/spec/live.json): live data profiles, extraction, value rule, detection - [spec/dtc.json](https://developers.smongrot.com/spec/dtc.json): fault-code read and decode (beta) - [spec/board-ble.json](https://developers.smongrot.com/spec/board-ble.json): SMR board BLE, level-1 commands only (board support is v0.2) - JSON Schemas: [common.schema.json](https://developers.smongrot.com/spec/schema/common.schema.json), [kline.schema.json](https://developers.smongrot.com/spec/schema/kline.schema.json), [live.schema.json](https://developers.smongrot.com/spec/schema/live.schema.json), [dtc.schema.json](https://developers.smongrot.com/spec/schema/dtc.schema.json), [board-ble.schema.json](https://developers.smongrot.com/spec/schema/board-ble.schema.json); vector suites use `vectors-.schema.json` in the same folder ## Vectors - [vectors/checksum.json](https://developers.smongrot.com/vectors/checksum.json), [vectors/echo.json](https://developers.smongrot.com/vectors/echo.json), [vectors/session.json](https://developers.smongrot.com/vectors/session.json) - Live: [vectors/live/extract.json](https://developers.smongrot.com/vectors/live/extract.json), [vectors/live/detect.json](https://developers.smongrot.com/vectors/live/detect.json), [vectors/live/t17.sub8.json](https://developers.smongrot.com/vectors/live/t17.sub8.json), [vectors/live/t17.sub4.json](https://developers.smongrot.com/vectors/live/t17.sub4.json), [vectors/live/t13.type7.json](https://developers.smongrot.com/vectors/live/t13.type7.json), [vectors/live/t11.type1.json](https://developers.smongrot.com/vectors/live/t11.type1.json), [vectors/live/generic.t17.json](https://developers.smongrot.com/vectors/live/generic.t17.json) - [vectors/dtc.json](https://developers.smongrot.com/vectors/dtc.json) ## Docs Read in this order: - [Overview](https://developers.smongrot.com/docs): what v0.1 is, three things to build, 60-second quickstart, platforms, what it does not do - [Concepts](https://developers.smongrot.com/docs/concepts): session lifecycle, ECM-ID, live profiles, field status (`ok` / `absent` / `invalid`), makers, timing - [Hardware](https://developers.smongrot.com/docs/hardware): K-Line cable, connector signals, FTDI VCP, 10400 8N1, Android OTG, why iOS has no cable - [Safety](https://developers.smongrot.com/docs/safety): read-only frames, absent is not 0, provisional values, beta fault codes - [Quickstart: JavaScript](https://developers.smongrot.com/docs/quickstart-js): browser WebSerial and Node `serialport` - [Quickstart: Dart](https://developers.smongrot.com/docs/quickstart-dart): Flutter desktop (`smongrot_sdk_libserialport`) and Android OTG (`smongrot_sdk_usb_serial`) - [Examples](https://developers.smongrot.com/docs/examples): Node CSV logger, browser gauge, Flutter live screen, Android OTG, DTC read, API key - [Identify and API key](https://developers.smongrot.com/docs/identify): ECM-ID offline, model name via `GET /v1/ecu/identify`, errors that do not break identify - [API reference](https://developers.smongrot.com/docs/api): every exported function, type, option and error, JS and Dart - [Protocol overview](https://developers.smongrot.com/docs/protocol): wire format, wake, session bytes, live extraction, fault-code reads - [Troubleshooting](https://developers.smongrot.com/docs/troubleshooting): every `code` (`ECU_SILENT`, `API_*`, …) with cause and fix, plus look-alike symptoms - [FAQ](https://developers.smongrot.com/docs/faq): free MIT SDK, free API key, 1000 requests/day, commercial use, privacy, v0.2 roadmap ## Optional - [llms-full.txt](https://developers.smongrot.com/llms-full.txt): every doc and spec file in one text, generated ## ภาษาไทย (Thai) - [llms.txt](https://developers.smongrot.com/th/llms.txt) - [llms-full.txt](https://developers.smongrot.com/th/llms-full.txt)