Repository navigation
Troubleshooting
Almost always the same cause: python-can's virtual bus exists only inside one Python process. Two processes with the same virtual / bus0 settings don't see each other.
-
peykan simulatein one terminal andpeykan serverin another won't see each other's traffic. - A CLI command in a second terminal (
frames,obd-request,vin,uds-dtcs,fault, ...) won't reach the simulator inside a runningpeykan demo.
Fixes:
- Use
peykan demo(simulator and server in one process), and drive it through MCP tools. - For CLI experiments, use commands that don't need a live bus (
decode,j1939-decode,dbc-info,log-info, ...), orpeykan record --simulateto capture a simulated drive and analyse the file. - On Linux, a
vcan0SocketCAN interface is shared across processes:PEYKAN_CAN_INTERFACE=socketcan PEYKAN_CAN_CHANNEL=vcan0. The simulator refuses non-virtual interfaces unlessPEYKAN_SIMULATOR_ON_HARDWARE=true.
The transmit policy refused it; the message says which setting is needed. On real hardware, reads need PEYKAN_ALLOW_TRANSMIT=true; clearing codes, resets, fault injection and replay also need PEYKAN_ALLOW_WRITE_SERVICES=true. With PEYKAN_TRANSMIT_ALLOWLIST set, the request ID (and the ID flow control goes out on) must be listed. get_transmit_log shows the policy and recent attempts.
You've configured a real adapter. The simulator would flood a vehicle network with fake traffic, so it refuses. Use peykan server for real hardware, or PEYKAN_SIMULATOR_ON_HARDWARE=true for an isolated bench.
- On the virtual bus: the simulator isn't in the same process (see the first section).
- On a vehicle: the ignition must be on; check the bitrate (
PEYKAN_CAN_BITRATE, usually 500000 for OBD); the ECU may use other IDs (--request-id/--response-id); some modules need a diagnostic session or security access first.
It listens on 127.0.0.1 by default. Use --host 0.0.0.0 or PEYKAN_MCP_HOST=0.0.0.0 (the Docker image already does). A request with a non-local Host header to a loopback server gets HTTP 421, which is the DNS-rebinding protection working.
Check PEYKAN_CORS_ALLOW_ORIGINS; the default ["*"] suits local tools. If you narrowed it, the client's origin must be listed. See Configuration.
MCP clients can only read files under PEYKAN_LOG_DIR (default: the server's working directory) and the bundled sample. Start the server from the folder holding your logs, or set PEYKAN_LOG_DIR. The CLI (peykan log-info) reads any path.
Logs go to stderr and data to stdout, so peykan uds-dtcs > out.json gives clean JSON. If you see log lines in a file, you redirected stderr too (2>&1).
- Turn thinking off in
ollmcpwith/tm; with thinking on,ollmcpsometimes drops the tool call and replies take 20–60 s. - Use a model with tool support that fits in GPU memory (
qwen3:8bis a good start). - Check
ollama pswhile it answers: on laptops with two GPUs, Ollama may pick the integrated one. SetOLLAMA_VULKAN=0andOLLAMA_CONTEXT_LENGTH=8192, then fully restart Ollama.
Peykan needs the mcp 2.x SDK (>=2.1.1). A tool pinned to mcp 1.x can't share an environment with it; install one of them in its own virtual environment (or with pipx).
Rename MCP_CAN_* variables to PEYKAN_*. Environment variables with the old prefix still work, but .env file keys aren't migrated. See Configuration.
load_dbc is cached; restart the server after editing the DBC.
Getting started
Reference
Protocols
Features
Operating it
Contributing