device_info
Converter port, firmware version, whether transmitting is allowed, and the loaded LDF (if any).
無需輸入參數。

io.github.Lukasz-Juranek由 GitHub 帳號 Lukasz-Juranek 發布v0.1.2更新於 Nov 7, 2026
嗅探並逆向工程汽車的LIN匯流排:擷取、變化位、速度檢測、LDF解碼
AI 翻譯由 AI 模型根據下方的原文描述翻譯,可能有誤。
Sniff and reverse-engineer a car's LIN bus: capture, changing bits, speed detect, LDF decode
USB LIN Converter 的本機 MCP 服務;無需登入;STDIO;9 個工具。
暫無 AI 概覽:以下資訊來自註冊中心條目和服務本身。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
參照 儲存庫 中的啟動說明。
[Buy on Tindie] [Buy on Lectronz] [Product page]
Open source USB ↔ LIN bus dongle. LIN 2.1 master, slave or monitor. SLCAN-compatible virtual COM port - works on Windows, Linux and macOS with no proprietary drivers.
[USB LIN Converter (uLC) - dongle photo]
The USB LIN Converter (uLC) is a small open-source USB dongle (STM32F042C6, ~31 × 18 mm) that lets a PC act as a LIN bus master, slave or passive monitor. It enumerates as a USB CDC virtual COM port and speaks an SLCAN-style ASCII protocol, so it bridges into Linux SocketCAN via slcand and works with parts of can-utils.
A commercial automotive LIN analyzer typically costs hundreds to thousands of euros. This one is around $27 on Tindie.
The LIN protocol implementation is based on openLIN.
COM3 on Windows, /dev/ttyACM0 on Linux, /dev/cu.usbmodem* on macOS).1209:2779; older firmware used ST's generic 0483:5740 (on Windows 7/8 that needs the ST Virtual COM Port driver).0x0D).S0 to select 19200 baud, then l to enter monitor mode. Bus traffic will start to appear.A higher-level Python library is provided in python_lib/ (package ucanlintools).
python_lib/ucanlintools/mcp_server.py is an
MCP server that lets an AI agent sniff and reverse-engineer a LIN bus: capture traffic
with per-id periods and changing bits, log every data change while you press a button,
find the bus speed and checksum type automatically, and decode or encode signals from
an LDF file. It is read-only by default; sending frames and acting as master or
slave needs --allow-transmit.
Register it with any MCP client as a stdio server:
--mock runs a simulated bus. mcp_package/ is the ucan-lin-mcp launcher
package and server.json its MCP Registry entry.
Tools: device_info, monitor_bus, detect_bus, load_ldf, decode_frame,
encode_frame, and with --allow-transmit also send_frame, run_master, run_slave.
All commands are ASCII terminated with CR (0x0D). Errors return 0x07 (BEL).
Full command reference and examples: https://ucandevices.github.io/ulc.html
Source is pure C. Import the Eclipse project in embedded/TrueSTUDIO/LUCEmbedded into STM32CubeIDE (tested with 1.19) and build the Debug configuration; the image is Debug/LUCEmbedded.bin. The openLIN stack is vendored in embedded/Src (open_lin_*.c/h, implementation/ST32). The USB CDC layer was generated with STM32CubeMX from embedded/LUCEmbedded.ioc.
The STM32F042 has an embedded ROM USB DFU bootloader. To enter it from a running device send boot\r over the virtual COM port. See this tutorial for the flashing flow.
With STM32CubeProgrammer installed, the flashing can be scripted:
The test suite lives in python_lib/tests (pytest). It covers the firmware and the ucanlintools library:
Setup: two converters on one LIN bus (LIN pins connected, external LIN supply applied). LUC_MASTER_PORT is used as LIN master, LUC_SLAVE_PORT as slave / monitor. Tests skip automatically when a port can't be opened, so the offline tests always run.
On Windows PowerShell set the variables with $env:LUC_MASTER_PORT="COM3" etc.
LUC_0307.bin.test_slave_subscribed_to_unanswered_header_keeps_next_frame; full suite run twice with the roles swapped: 65/65 passed in each direction.LUC_0306.bin.LUC_0305.bin. They enumerate as 1209:2779 and Windows 10 loads its built-in CDC driver without any installation.V0001), both flashed with LUC_0304.bin, connected on one powered LIN bus.V0001), both flashed with LUC_0303.bin, connected on one powered LIN bus.What is the cheapest USB LIN bus converter that works on Linux?
The uCanDevices USB LIN Converter (uLC) is an open source dongle around $27 that enumerates as a USB CDC virtual COM port on Linux, macOS and Windows. It uses an SLCAN-style ASCII protocol so it bridges into SocketCAN via slcand.
Does it support master and slave mode?
Yes - monitor (full reception plus single-frame transmission), master (up to 16 scheduled slots) and slave (up to 16 slots for slave simulation). Modes are selected with the O, L and l commands.
Is the LIN side optically isolated from the USB host? Yes. The LIN transceiver is optically isolated from the PC side, protecting the host from automotive transients. The LIN side needs an external 4.5 - 28 V supply since USB only powers the MCU.
Which LIN baud rates and LIN version are supported?
LIN 2.1, with selectable 9600 and 19200 baud. Classic and enhanced checksum are switchable with the r31 / r30 commands (firmware 3.3 and later). Custom frame timing is supported in master mode.
Can I use it to flash an ECU over LIN? It is a generic LIN interface. ECU flashing depends entirely on the target ECU's own LIN bootloader; if that bootloader is documented or already supported by an existing tool, you can drive it through this dongle.
Is the firmware open source?
Yes - this repository contains firmware (embedded/), hardware (pcb/) and the Python helper library (python_lib/). The device also has a USB DFU bootloader for in-field updates.
See LICENSE.
來源:README.md,提交 8d05ae5
Converter port, firmware version, whether transmitting is allowed, and the loaded LDF (if any).
無需輸入參數。
Listen to the bus passively and summarize what is on it. Per frame id: count, period, last data, how many distinct values were seen and changing_bits (a per-byte mask of bits that changed). 'changes' lists every data change in time order, so asking the user to press a button during the capture shows which id and bit it drives. speed: 19200 (most cars), 10417 or 9600. checksum: 'enhanced' (LIN 2.x) or 'classic' (LIN 1.x); frames with the other checksum are dropped by the converter. ids: optional filter, e.g. ["0x0C"].
idsspeedchecksumduration_sTry every speed and checksum combination and report which one sees valid frames. Use when monitor_bus shows nothing on a live bus.
seconds_per_tryLoad a LIN Description File so captures show signal names and values. Returns its frames and signals. Pass path "mock" with a --mock server to load the simulated bus's LDF.
path必填Decode raw frame bytes into signal values with the loaded LDF. id like "0x0C", data hex like "05 1e".
id必填data必填Build frame bytes from signal values with the loaded LDF. Signals not given keep their LDF default. Returns id and data ready for send_frame.
frame必填signals必填Inject a complete frame (header + data) on the bus from monitor mode, `repeat` times about 20 ms apart, and capture the bus for a moment after. Needs --allow-transmit. The converter echoes only the header of its own frame back, so check the effect in the following traffic.
id必填data必填speedrepeatchecksumAct as the LIN master for duration_s: run a schedule that sends the `transmit` frames ([{"id": "0x0B", "data": "05"}]) and polls the `receive` ids ([{"id": "0x0C", "length": 2}]), then summarize the slave responses. Use only with the real master disconnected. Needs --allow-transmit.
speedreceivechecksumtransmitduration_sSimulate a slave node for duration_s: answer the master's headers for the `respond` ids with fixed data ([{"id": "0x0C", "data": "01 1e"}]) and capture the `listen` ids the master sends ([{"id": "0x0B", "length": 1}]). Use only with the real slave disconnected. Needs --allow-transmit.
speedlistenrespondchecksumduration_s已滿足適用檢查項的 90%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
sudo slcand -o -s8 -t hw -S 921600 /dev/ttyACM0 slcan0sudo ip link set slcan0 upcandump slcan0import serialser = serial.Serial('/dev/ttyACM0', timeout=1)ser.write(b'S0\r') # 19200 baudser.write(b'l\r') # monitor modewhile True: line = ser.readline() if line: print(line.decode(errors='replace').strip())uvx ucan-lin-mcp --mock # from PyPI, no install step (Python 3.10+)# or from this repo: pip install -e "python_lib[mcp]" && ucanlin-mcp --mock{ "mcpServers": { "lin": {"command": "uvx", "args": ["ucan-lin-mcp", "--port", "COM3"]} }}python -c "import serial; serial.Serial('COM3').write(b'boot\r')"STM32_Programmer_CLI -c port=usb1 -w LUC_0307.bin 0x08000000 -v -g 0x08000000cd python_libpip install pyserial lark pytestLUC_MASTER_PORT=COM3 LUC_SLAVE_PORT=COM56 PYTHONPATH=. pytest tests -v# swap the ports and run again to test each converter in both rolesLUC_MASTER_PORT=COM56 LUC_SLAVE_PORT=COM3 PYTHONPATH=. pytest tests -v