LiDAR / laser rangefinder UART decoder
Find out what your laser rangefinder or single-point LiDAR is saying on its serial port: paste a hex dump or plug the module in, and this tool detects the protocol and baud rate, decodes every frame to metres and flags checksum errors.
Open it in the browser, no install: https://erditech.github.io/lrf-uart-protocol-decoder/ (WebSerial in desktop Chrome / Edge; paste mode works in any browser)
Supported modules
| Vendor | Modules | Frame | Default baud | Profile(s) |
|---|---|---|---|---|
| Benewake | TFmini, TFmini-S, TFmini Plus, TF-Luna, TF02-Pro, TF03 | 59 59 DL DH SL SH TL TH SUM, string mode |
115200 | benewake-*, ascii-metres |
| LightWare | SF30/D (binary protocol), SF10 / SF11 (ASCII serial) | AA flags ID data CRC16, 22.48 m\r\n |
115200 | lightware-binary, ascii-metres |
| Chengdu JRT | phase-shift laser distance sensors (U81 / U85 / M88 class) | AA 00 00 22 00 03 dddd qq SUM |
19200 | jrt-aa |
| Nooploop | TOFSense, TOFSense-F | 57 00 16-byte frame, query frame |
921600 | nooploop-tofsense |
| DFRobot | SEN0366 50 / 80 m laser distance sensor and the identical 80 m modules | 80 06 83 "123.456" CS |
9600 | dfrobot-sen0366 |
| ERDI | LRF50H ... LRF1500H, LRF22VB, LRF50VB, LR1000E2 ... LR2000E4, LRF1200A1, LRF3000A1, SPD1200 | 5C lo hi chk, 55 AA fn .. SUM |
460800 / 115200 | erdi-* |
Every profile is built from the vendor's public manual or product page. Frame tables, checksum rules, invalid-reading codes and source links are in docs/PROTOCOLS.md. Missing a module? Open an issue with a hex capture and a link to its manual.
30-second start
Browser. Open the live page, paste bytes from any serial terminal and press Detect & decode. With a USB-UART adapter attached, press Scan baud rates: the page listens at 9600 ... 921600 bps and picks the rate and protocol that explain the most bytes. Tick the request box for modules that only answer when asked (ERDI LR series, JRT, DFRobot SEN0366, TOFSense in query mode).
Python.
pip install "lrf-uart-decoder[serial]"
lrf-decoder "AA 00 00 22 00 03 00 00 05 F6 00 45 65" # auto-detects jrt-aa -> 1.526 m
lrf-decoder --hex-file dump.txt # text hex dump from any terminal
lrf-decoder --file capture.bin --profile benewake-tf-luna
lrf-decoder --port COM5 --scan --probe # find baud + protocol on a live port
lrf-decoder --port /dev/ttyUSB0 --profile benewake-tfmini-s --json
lrf-decoder --list # every profile with its source
from lrf_decoder import Decoder, detect, parse_hex
data = parse_hex("59 59 79 00 00 02 F0 08 25")
print(detect(data)[0]["family"]) # benewake-9
dec = Decoder("benewake-tfmini-s")
for frame in dec.push(data): # feed serial chunks as they arrive
print(frame["distance_m"], frame["strength"], frame["temp_c"], frame["ok"])
JavaScript (browser or Node, no dependencies): docs/decoder.js exports Decoder,
detect, parseHex and the PROFILES table.
What it does
- Protocol detection: every protocol family is tried on the capture and ranked by how many
bytes it explains, so
00 13 59 59 79 ...is identified as Benewake even with noise in front. - Checksum checking: failed frames are kept and highlighted instead of silently dropped, which is usually the first clue for a wrong baud rate, a missing ground or a 5 V / 3.3 V mismatch.
- Per-model rules: TFmini-S
-1/-2/-4codes, TF-Luna and TFmini Plus low-strength zeros, TF02-Pro's 4500 cm, ERDI out-of-range markers and STA bytes are reported as invalid readings rather than real distances. - Requests and replies: host commands in a two-way capture (ERDI
55 AA 88 ..., JRTAA 00 00 20 ..., DFRobot80 06 02 78, TOFSense query) are labelled, so a full logic analyser export reads as a conversation. - Streaming: frames split across USB packets are reassembled; garbage is skipped with byte-level resync.
- Same bytes, different units: an ERDI
5C 02 11 ECis 43.54 m on an H-series module and 4.354 m on a VB module; Benewake has a mm output mode. Detection reports the family and lists the models that share it, so pick by part number.
Tests
node --test tests/ # Node 20+
pip install pytest . && python -m pytest -q python
Both suites read the same golden vectors from tests/vectors.json; each vector says whether its bytes are printed in the cited manual or assembled from the manual's field table.
Contributing a protocol
Add a parser and a PROFILES entry in docs/decoder.js and python/lrf_decoder/core.py, add
vectors to tests/vectors.json, and document the frame with its source URL in
docs/PROTOCOLS.md. Only use values from the manufacturer's manual or a vendor capture.
Related projects
- ErdiTech/erdi-lrf-drivers: Python, Arduino and ROS 2 drivers plus transcribed protocol documents for ERDI modules
- laser-rangefinder-module-database: open dataset of laser rangefinder specifications
- awesome-laser-rangefinder: curated list of laser rangefinder resources
Maintained by ERDI TECH LTD (erdilrf.com), makers of 905 / 1535 nm laser rangefinder modules. Benewake, LightWare, JRT, Nooploop and DFRobot are trademarks of their owners; this project is not affiliated with them.
License
MIT, see LICENSE.
Metadata
Release files for lrf-uart-decoder 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lrf_uart_decoder-1.0.0.tar.gz | 17.4 kB | Without provenance | Details for lrf_uart_decoder-1.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lrf_uart_decoder-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for lrf_uart_decoder-1.0.0-py3-none-any.whl |
Total release size: 33.1 kB
Release files / lrf_uart_decoder-1.0.0.tar.gz
| Download URL | lrf_uart_decoder-1.0.0.tar.gz |
|---|---|
| Size | 17.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
71311e9234673c59c7614c3963822d67ee5f19b83d69fa120e234a5e10ecb77f
|
|
BLAKE2b-256 checksum How to use checksums |
8b52c6bc387f0ef6d90387fe862cd15bbe1203e345468ae6dfcbe186a6c10422
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / lrf_uart_decoder-1.0.0-py3-none-any.whl
| Download URL | lrf_uart_decoder-1.0.0-py3-none-any.whl |
|---|---|
| Size | 15.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6dd432b8b7c469afeab5f3e46a5f67cdc55c382b2d0f49ffa8718b1031166b27
|
|
BLAKE2b-256 checksum How to use checksums |
de0ab0c06f8690f9253ec3d8ac9fc1977780ff72e34113b2b81c93468ff648c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for lrf-uart-decoder 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.