BMCLI daemon
Background process keeping channels open for low-latency command execution. Communicates via TCP socket on 127.0.0.1:4502 (cross-platform, same on Windows and Linux).
On Linux, daemon state follows the XDG base-directory convention:
- PID:
$XDG_RUNTIME_DIR/bmcli/daemon_4502.pid; fallback/tmp/bmcli-<uid>/daemon_4502.pid. - Log:
$XDG_STATE_HOME/bmcli/daemon_4502.log; fallback~/.local/state/bmcli/daemon_4502.log. - IPC remains the loopback TCP endpoint above; there is no filesystem socket.
Recommendation: Always specify the real timing, role/mode, and termination or pull-up at startup. The bus type is inferred from channel capability. Incorrect defaults can disturb a physical CAN or LIN network.
daemon start
Section titled “daemon start”# Recommended: stable SN/port and explicit CAN parametersbmcli daemon start --channel=10356/0 --nbitrate=500k --dbitrate=2M --termination=120
# Multi-channel on same devicebmcli daemon start --channel=10356/0,10356/1 --nbitrate=250k --dbitrate=1M --mode=normal --termination=120
# Multi-devicebmcli daemon start --channel=10356/0,10357/0 --nbitrate=500k --termination=120
# LIN master startupbmcli daemon start --channel=10356/4 --mode=master --bitrate=19200 --pullup=1k --power=on
# Legacy index remains supported for temporary interactive usebmcli daemon start --channel=0 --nbitrate=500 --dbitrate=2000 --termination=120| Option | Default | Description |
|---|---|---|
--channel |
— | Channels to open at startup |
--mode |
CAN normal; LIN listen-only |
CAN mode or LIN role |
--nbitrate |
500 |
CAN nominal bitrate kbps |
--dbitrate |
2000 |
CAN data bitrate kbps |
--bitrate |
19200 |
LIN bitrate bps |
--termination |
120 |
CAN termination: 120 or off |
--pullup |
mode default | LIN pull-up: 1k or off |
--power |
mode default | LIN 12 V output: on or off |
--lin-version |
2.2 |
LIN protocol version |
--checksum |
auto |
LIN checksum model |
Blocks until daemon socket is ready (up to 10s).
daemon stop
Section titled “daemon stop”bmcli daemon stopdaemon restart
Section titled “daemon restart”Close and capability-reopen all CAN and LIN channels. Re-applies saved TX tasks; CAN routes are also restored.
bmcli daemon restartdaemon status
Section titled “daemon status”bmcli daemon statusShows: open channel count, PID, uptime.
Daemon features
Section titled “Daemon features”- SN-based channel identification: Channels are tracked by SN+port internally, so recovery after USB reconnection always finds the correct device regardless of enumeration order
- BUSOFF recovery: CAN channels are checked without consuming traffic and recovered through
BM_RecoverBusOff; if recovery fails, the daemon capability-reopens the channel and restores its persistent configuration. LIN channels are excluded from CAN BUSOFF handling. - USB reconnect: On USB disconnect (ILLOPERATION), waits 1s then re-enumerates and reopens using stored SN+port
- Config persistence: Txtasks and routes are re-applied after channel recovery
- Background threads: Host logging and replay run in separate threads
Source of truth: bmcli_reference.md in the BMCLI repository. Run bmcli help <category> <action> --format=json for the exact contract of the installed version.