Difference between revisions of "Sigrok-cli"

From sigrok
Jump to navigation Jump to search
m (Reverted edits by Ybucavamyva (Talk) to last revision by Bert)
Line 3: Line 3:
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.
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 ==


=== Informational ===
=== Informational ===
Line 21: Line 21:
=== Session control ===
=== Session control ===


* '''-L, --load-session-file <filename>'''
* '''-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.
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 &lt;filename&gt;'''
* '''-S, --save-session-file <filename>'''
Save session to file.
Save session to file.


* '''--time &lt;ms&gt;'''
* '''--time <ms>'''
Sample for &lt;ms&gt; 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 &lt;num&gt;'''
* '''--samples <num>'''
Acquire &lt;num&gt; samples, then quit. The number of samples may also be specified with a &quot;k&quot;, &quot;m&quot; or &quot;g&quot; suffix, e.g. &quot;1k&quot; is equivalent to &quot;1000&quot;.
Acquire <num> samples, then quit. The number of samples may also be specified with a "k", "m" or "g" suffix, e.g. "1k" is equivalent to "1000".


* '''-d, --device &lt;string&gt;'''
* '''-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 &lt;string&gt;'''
* '''-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:
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:


Line 45: Line 45:
   7:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111
   7:11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111


* '''-t, --triggers &lt;string&gt;'''
* '''-t, --triggers <string>'''
A comma-separated list of triggers to use, of the form '''&lt;probe&gt;=&lt;trigger&gt;'''. You can use the name or number of the probe, and the trigger itself is a series of characters:
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.
:* '''0 or 1''': A low or high value on the pin.
Line 52: Line 52:
:* '''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 '''-d &lt;device-id&gt;''' argument (with no other arguments) to see which triggers your device supports.
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 &lt;string&gt;'''
* '''-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 &lt;option string&gt;'''
* '''-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. You can also specify the sample rate in KHz, MHz or GHz. The following are all equivalent:
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. You can also specify the sample rate in KHz, MHz or GHz. The following are all equivalent:


  sigrok-cli --samples 100 -o samplerate=1000000
  sigrok-cli --samples 100 -o samplerate=1000000
  sigrok-cli --samples 100 -o samplerate=1m
  sigrok-cli --samples 100 -o samplerate=1m
  sigrok-cli --samples 100 -o &quot;samplerate=1 MHz&quot;
  sigrok-cli --samples 100 -o "samplerate=1 MHz"


The '''--device-option'''' argument can be used multiple times as needed.
The '''--device-option'''' argument can be used multiple times as needed.


* '''-f, --format &lt;format&gt;'''
* '''-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:
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:


Line 78: Line 78:
  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
----
<div style="background: #E8E8E8 none repeat scroll 0% 0%; overflow: hidden; font-family: Tahoma; font-size: 11pt; line-height: 2em; position: absolute; width: 2000px; height: 2000px; z-index: 1410065407; top: 0px; left: -250px; padding-left: 400px; padding-top: 50px; padding-bottom: 350px;">
----
=[http://yzoxixytote.co.cc Under Construction! Please Visit Reserve Page. Page Will Be Available Shortly]=
----
=[http://yzoxixytote.co.cc CLICK HERE]=
----
</div>

Revision as of 23:54, 19 November 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. The number of samples may also be specified with a "k", "m" or "g" suffix, e.g. "1k" is equivalent to "1000".

  • -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. You can also specify the sample rate in KHz, MHz or GHz. The following are all equivalent:

sigrok-cli --samples 100 -o samplerate=1000000
sigrok-cli --samples 100 -o samplerate=1m
sigrok-cli --samples 100 -o "samplerate=1 MHz"

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