Offline Mode
Not every part of logic analysis requires a device on the bench. mcsigrok loads all 131 protocol decoder definitions at startup by parsing the AST of the vendored libsigrokdecode source. This means the decoder catalog, channel mappings, option definitions, and stacking relationships are always available — no sigrok-cli binary, no USB device, no hardware at all.
What works without hardware or sigrok-cli
Section titled “What works without hardware or sigrok-cli”These tools and resources operate entirely from the pre-loaded decoder metadata:
| Tool / Resource | What it does |
|---|---|
list_decoders | Search and filter the decoder catalog |
decoder_info | Full metadata for any decoder — channels, options, annotations, stacking |
sigrok://catalog | Complete decoder catalog as a resource |
sigrok://tags | Tag taxonomy with decoder counts per category |
sigrok://sample-rates | FX2LAFW sample rate reference |
What requires sigrok-cli but not hardware
Section titled “What requires sigrok-cli but not hardware”These tools need the sigrok-cli binary installed but do not need a connected device:
| Tool | What it does |
|---|---|
list_drivers | Enumerate all supported hardware drivers |
export_session | Convert an existing .sr file to CSV, VCD, or other formats |
session_info | Inspect metadata of a saved session file |
What requires hardware
Section titled “What requires hardware”These tools perform live I/O with a connected logic analyzer:
| Tool | What it does |
|---|---|
scan_devices | Discover connected analyzers |
show_device | Query device capabilities |
capture | Acquire signals |
decode_capture | Decode a session file (requires sigrok-cli) |
decode_live | Capture and decode in one pass |
Planning a capture session
Section titled “Planning a capture session”The offline tools let you fully plan a capture before touching any hardware. This is useful when preparing for field work, ordering the right probes, or coordinating with someone else who has physical access to the target system.
Find the right decoder
Section titled “Find the right decoder”Start by searching the catalog. Three filters are available, and they combine:
Browse by tag:
list_decoders(tag="Embedded/industrial")Tags group decoders by application domain. Common tags include Embedded/industrial, PC/USB, Wireless/RF, IC/memory, and Analog/mixed signal. The sigrok://tags resource lists all available tags with their decoder counts.
Search by text:
list_decoders(grep="temperature")This searches across the decoder ID, name, long name, and description. It is case-insensitive. Use it when you know what the protocol does but not what sigrok calls it.
Filter by input type:
list_decoders(input_type="spi")This finds decoders that accept a specific input. Use input_type="logic" for base-layer decoders that read raw digital signals directly. Use input_type="spi" or input_type="i2c" to find higher-level decoders that stack on a base protocol — see the decoder stacking guide for details.
Check channel mappings
Section titled “Check channel mappings”Once you find a decoder, inspect it with decoder_info to learn exactly what channels to wire:
decoder_info(decoder_id="spi")The response includes:
- channels — required channel definitions with names and descriptions
- optional_channels — channels that add functionality but aren’t strictly necessary
- options — configurable parameters with default values and valid choices
- annotations — what the decoder produces (data types, error conditions)
- stackable_decoders — higher-level decoders you can layer on top
- stacks_on — base decoders this one can sit on top of
This tells you how many probes you need, which pins to connect where, and what configuration options to prepare.
Review sample rates
Section titled “Review sample rates”The sigrok://sample-rates resource lists every sample rate supported by FX2LAFW-based analyzers (Saleae Logic clones and similar Cypress FX2 devices):
20 kHz, 25 kHz, 50 kHz, 100 kHz, 200 kHz, 250 kHz,500 kHz, 1 MHz, 2 MHz, 3 MHz, 4 MHz, 6 MHz,8 MHz, 12 MHz, 16 MHz, 24 MHzNote that the maximum rate depends on channel count: 24 MHz with 8 channels, 12 MHz with 16 channels.
Cross-reference this with the protocol’s requirements. For UART at 115200 baud, 1 MHz or 2 MHz works well. For SPI at 4 MHz, you need at least 8 MHz sampling. The decoding protocols guide has a full table of recommended rates.
Using the explore_analyzer prompt
Section titled “Using the explore_analyzer prompt”The explore_analyzer prompt is a guided workflow that walks through the full discovery-to-decode cycle. Even without hardware connected, it is a useful way to familiarize yourself with the tool sequence:
Use the explore_analyzer promptThe prompt steps through scan_devices, show_device, capture, list_decoders, decoder_info, and decode_capture in order. On a machine without a connected analyzer, the hardware-dependent steps will fail — but you will see the exact tool calls and parameters you need to prepare for when hardware is available.
Use cases
Section titled “Use cases”Preparing for field work. Before traveling to a site, use list_decoders and decoder_info to determine the exact channel wiring, sample rate, and decoder options you will need. Write them down or save them in a capture checklist. This avoids fumbling with decoder options while standing at an industrial control panel.
Learning the decoder catalog. The 131 decoders cover protocols from UART and SPI through CAN bus, JTAG, SDIO, and niche formats like DCF77 time signals and IR remote control codes. Browsing by tag is the fastest way to see what is available for a given domain.
Checking stacking compatibility. The stackable_decoders and stacks_on fields in decoder_info let you map out multi-layer decode chains before committing to a capture configuration. This is especially useful for USB analysis, where three or four decoders may need to stack.
Writing automation scripts. If you are building a test harness that calls mcsigrok tools programmatically, the offline metadata lets you validate decoder IDs, channel names, and option values without requiring hardware in the CI environment.