Difference between revisions of "Sigrok-cli"
Uwe Hermann (talk | contribs) m |
|||
Line 1: | Line 1: | ||
The '''command-line frontend''' cannot display graphical output, but is still sufficient to run through the whole process of hardware initialization, acquisition, protocol analysis and saving the session. It is useful for running on remote or embedded systems. It can display samples on standard output or save them in various file formats. | The sigrok '''command-line frontend''' cannot display graphical output, but is still sufficient to run through the whole process of hardware initialization, acquisition, protocol analysis and saving the session. It can display samples on standard output or save them in various file formats. | ||
It is useful for running on remote or embedded systems, netbooks, PDAs, and for various other use-cases. It can display samples on standard output or save them in various file formats. | |||
== Arguments == | == Arguments == | ||
Line 26: | Line 28: | ||
* '''--time <ms>''' | * '''--time <ms>''' | ||
Sample for <ms> milliseconds, then quit. You can optionally follow the number by 's' to state the number of seconds to sample instead. For example, '2s' will sample for two seconds. | Sample for <ms> milliseconds, then quit. You can optionally follow the number by '''s''' to state the number of seconds to sample instead. For example, '''2s''' will sample for two seconds. | ||
* '''--samples <num>''' | * '''--samples <num>''' | ||
Line 32: | Line 34: | ||
* '''-d, --device <string>''' | * '''-d, --device <string>''' | ||
The device to use for acquisition, specified by ID as report by --list-devices. | The device to use for acquisition, specified by ID as report by '''--list-devices'''. | ||
* '''-p --probes <string>''' | * '''-p --probes <string>''' | ||
A comma-separated list of probes to be used in the session. The default is to use all the probes available on a device. You can name a probe, like this: '1=CLK'. A range of probes can also be given, in the form '1-5'. Thus a probe list given as '1=CLK,2-4' will give output like this: | A comma-separated list of probes to be used in the session. The default is to use all the probes available on a device. You can name a probe, like this: '''1=CLK'''. A range of probes can also be given, in the form '''1-5'''. Thus a probe list given as '''1=CLK,2-4,7''' will give output like this: | ||
CLK:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | CLK:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | ||
2:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | 2:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | ||
3:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | 3:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | ||
4:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | 4:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | ||
7:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | |||
* '''-t, --triggers <string>''' | * '''-t, --triggers <string>''' | ||
A comma-separated list of triggers to use, of the form | A comma-separated list of triggers to use, of the form '''<probe>=<trigger>'''. You can use the name or number of the probe, and the trigger itself is a series of characters: | ||
:* '''0 or 1''': A | :* '''0 or 1''': A low or high value on the pin. | ||
:* '''r or f''': A rising or falling value on the pin. An 'r' effectively corresponds to | :* '''r or f''': A rising or falling value on the pin. An '''r''' effectively corresponds to '''01'''. | ||
:* '''c''': Any kind of change on a pin. | :* '''c''': Any kind of change on a pin. | ||
Not every device supports all of these trigger types. Use the | Not every device supports all of these trigger types. Use the '''-d <device-id>''' argument (with no other arguments) to see which triggers your device supports. | ||
* '''-a, --analyzers <string>''' | * '''-a, --analyzers <string>''' | ||
A string listing the sequence of protocol analysis plugins the signal should go through. Each element of the sequence consists of the plugin's name, with a pipe (|) symbol separating the elements. | A string listing the sequence of protocol analysis plugins the signal should go through. Each element of the sequence consists of the plugin's name, with a pipe ('''|''') symbol separating the elements. | ||
=== Session options === | === Session options === | ||
* '''-o, --device-option <option string>''' | * '''-o, --device-option <option string>''' | ||
Set a device-specific option. The argument takes the form of | Set a device-specific option. The argument takes the form of '''option=value'''. Currently the only option supported is '''samplerate''', with the argument being the samplerate in Hz. The '''--device-option'''' argument can be used multiple times as needed. | ||
* '''-f, --format <format>''' | * '''-f, --format <format>''' | ||
Set the output format to use. | Set the output format to use. Supported formats currently include '''bits''', '''hex''', '''binary''', '''vcd''', and '''gnuplot'''. The '''bits''' or '''hex''' formats, for an ASCII bit display or hexadecimal display, optionally followed by a length argument specifying the number of samples (in bits). Thus '''hex128''' would display 128 bits per line, in hexadecimal: | ||
1:ffff ffff ffff ffff ffff ffff ffff ffff | 1:ffff ffff ffff ffff ffff ffff ffff ffff | ||
2:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 | 2:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00 | ||
The lines always start with the probe number (or name, if defined), followed by a colon. If no format is specified, it defaults to ' | The lines always start with the probe number (or name, if defined), followed by a colon. If no format is specified, it defaults to 'bits64', like this: | ||
1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | 1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 | ||
2:11111111 00000000 11111111 00000000 11111111 00000000 11111111 00000000 | 2:11111111 00000000 11111111 00000000 11111111 00000000 11111111 00000000 |
Revision as of 01:13, 13 April 2010
The sigrok command-line frontend cannot display graphical output, but is still sufficient to run through the whole process of hardware initialization, acquisition, protocol analysis and saving the session. It can display samples on standard output or save them in various file formats.
It is useful for running on remote or embedded systems, netbooks, PDAs, and for various other use-cases. It can display samples on standard output or save them in various file formats.
Arguments
Informational
- -H, --list-hw-plugins
Output a list of all available hardware plugins.
- -D, --list-devices
List devices found on the system.
- -A, --list-analyzer-plugins
Output a list of all available protocol analysis plugins.
- -V, --version
Show version.
Session control
- -L, --load-session-file <filename>
Session file to load previously acquired data from. Any devices or protocols listed in the file will be reused, unless overridden by other commandline arguments.
- -S, --save-session-file <filename>
Save session to file.
- --time <ms>
Sample for <ms> milliseconds, then quit. You can optionally follow the number by s to state the number of seconds to sample instead. For example, 2s will sample for two seconds.
- --samples <num>
Acquire <num> samples, then quit.
- -d, --device <string>
The device to use for acquisition, specified by ID as report by --list-devices.
- -p --probes <string>
A comma-separated list of probes to be used in the session. The default is to use all the probes available on a device. You can name a probe, like this: 1=CLK. A range of probes can also be given, in the form 1-5. Thus a probe list given as 1=CLK,2-4,7 will give output like this:
CLK:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 2:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 3:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 4:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 7:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
- -t, --triggers <string>
A comma-separated list of triggers to use, of the form <probe>=<trigger>. You can use the name or number of the probe, and the trigger itself is a series of characters:
- 0 or 1: A low or high value on the pin.
- r or f: A rising or falling value on the pin. An r effectively corresponds to 01.
- c: Any kind of change on a pin.
Not every device supports all of these trigger types. Use the -d <device-id> argument (with no other arguments) to see which triggers your device supports.
- -a, --analyzers <string>
A string listing the sequence of protocol analysis plugins the signal should go through. Each element of the sequence consists of the plugin's name, with a pipe (|) symbol separating the elements.
Session options
- -o, --device-option <option string>
Set a device-specific option. The argument takes the form of option=value. Currently the only option supported is samplerate, with the argument being the samplerate in Hz. The --device-option' argument can be used multiple times as needed.
- -f, --format <format>
Set the output format to use. Supported formats currently include bits, hex, binary, vcd, and gnuplot. The bits or hex formats, for an ASCII bit display or hexadecimal display, optionally followed by a length argument specifying the number of samples (in bits). Thus hex128 would display 128 bits per line, in hexadecimal:
1:ffff ffff ffff ffff ffff ffff ffff ffff 2:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
The lines always start with the probe number (or name, if defined), followed by a colon. If no format is specified, it defaults to 'bits64', like this:
1:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 2:11111111 00000000 11111111 00000000 11111111 00000000 11111111 00000000