Skip to content

Troubleshooting

farzad edited this page Oct 7, 2026 · 2 revisions

Troubleshooting

No frames / tools return nothing

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 simulate in one terminal and peykan server in 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 running peykan 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, ...), or peykan record --simulate to capture a simulated drive and analyse the file.
  • On Linux, a vcan0 SocketCAN interface is shared across processes: PEYKAN_CAN_INTERFACE=socketcan PEYKAN_CAN_CHANNEL=vcan0. The simulator refuses non-virtual interfaces unless PEYKAN_SIMULATOR_ON_HARDWARE=true.

A tool returns status "blocked"

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.

The simulator won't start: "Refusing to run the ECU simulator on interface ..."

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.

UDS / VIN requests time out

  • 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.

Can't reach the server from another machine or container

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.

Browser-based client can't connect (CORS)

Check PEYKAN_CORS_ALLOW_ORIGINS; the default ["*"] suits local tools. If you narrowed it, the client's origin must be listed. See Configuration.

analyze_can_log says the path is outside the log directory

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.

JSON output mixed with log lines

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).

Ollama: slow, stuck on "working...", or "No Response from Model"

  • Turn thinking off in ollmcp with /tm; with thinking on, ollmcp sometimes drops the tool call and replies take 20–60 s.
  • Use a model with tool support that fits in GPU memory (qwen3:8b is a good start).
  • Check ollama ps while it answers: on laptops with two GPUs, Ollama may pick the integrated one. Set OLLAMA_VULKAN=0 and OLLAMA_CONTEXT_LENGTH=8192, then fully restart Ollama.

See Connecting MCP Clients.

Installing next to another MCP tool fails or breaks it

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).

Upgraded from mcp-can and settings are ignored

Rename MCP_CAN_* variables to PEYKAN_*. Environment variables with the old prefix still work, but .env file keys aren't migrated. See Configuration.

The DBC changed but the server shows old signals

load_dbc is cached; restart the server after editing the DBC.

Clone this wiki locally