start_pcap_file
Starts a non-streaming packet capture on an interface, saves raw pcapng data to a managed file, and returns immediately with a capture ID and path for later retrieval.
Instructions
Start a background, non-streaming packet capture to a pcapng file.
This is the non-streaming counterpart to capture_scan: unlike that streaming tool, it does not block and does not return a dissected summary. It starts a capture, keeps the core WebSocket open in the background, and writes the raw pcapng bytes to a file under a managed directory on the device. Because nothing is held in memory or returned inline, the capture can run far longer than the 60 s capture_scan window — up to the server's configured maximum. The call returns immediately with the capture_id and file path; the capture then runs on its own until duration_s elapses or you call stop_pcap_file. Retrieve the file with fetch_pcap_file(capture_id=...) (a pcapng blob) once it has stopped.
This tool always owns the interface. If a capture is already running on it, this returns an error rather than taking it over — watch that one with capture_observe instead.
Args: interface: Monitor-mode capture interface, always 'wlanpiN' (e.g. 'wlanpi0'), not 'wlan0'. See get_capture_channels. channels: Channel numbers to hop (e.g. [1, 6, 11, 36]); 6 GHz can be given as explicit frequencies in MHz. Omit to hop every channel the adapter supports. width: Channel width in MHz: 20, 40, 80 or 160. dwell_ms: Milliseconds to dwell on each channel (50-60000). duration_s: How long the background capture runs, in seconds, from 1 up to the server maximum (default max 3600). The call itself returns immediately. pcap_filter: Optional BPF/pcap filter, e.g. 'type mgt subtype beacon'.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| width | No | ||
| channels | No | ||
| dwell_ms | No | ||
| interface | No | wlanpi0 | |
| duration_s | No | ||
| pcap_filter | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||