1SIGROK-CLI(1)               General Commands Manual              SIGROK-CLI(1)
2
3
4

NAME

6       sigrok-cli - Command-line client for the sigrok software
7

SYNOPSIS

9       sigrok-cli [OPTIONS] [COMMAND]
10

DESCRIPTION

12       sigrok-cli  is  a  cross-platform  command  line utility for the sigrok
13       software.
14
15       It cannot display graphical output, but  is  still  sufficient  to  run
16       through the whole process of hardware initialization, acquisition, pro‐
17       tocol decoding and saving the session.
18
19       It is useful for running on remote or embedded systems, netbooks, PDAs,
20       and  for  various  other  use-cases. It can display samples on standard
21       output or save them in various file formats.
22

OPTIONS

24       -h, --help
25              Show a help text and exit.
26
27       -V, --version
28              Show sigrok-cli version and the versions of libraries used.
29
30       -L, --list-supported
31              Show information about supported hardware  drivers,  input  file
32              formats, output file formats, and protocol decoders.
33
34       -d, --driver <drivername>
35              A  driver  must always be selected (unless doing a global scan).
36              Use the -V option to get a list of available drivers.
37
38              Drivers can take options, in the  form  key=value  separated  by
39              colons.
40
41              Drivers  communicating  with  hardware  via a serial port always
42              need the port specified as the conn option. For example, to  use
43              the Openbench Logic Sniffer:
44
45                $ sigrok-cli --driver=ols:conn=/dev/ttyACM0
46
47              Some  USB devices don't use a unique VendorID/ProductID combina‐
48              tion, and thus need that specified as well. This also  uses  the
49              conn option, using either VendorID.ProductID or bus.address:
50
51                $ sigrok-cli --driver=uni-t-ut61e:conn=1a86.e008
52
53       -c, --config <device>
54              A  colon-separated  list  of  device  options, where each option
55              takes the form key=value.  For example, to set the samplerate to
56              1MHz  on  a  device  supported  by the fx2lafw driver, you might
57              specify
58
59                $ sigrok-cli --driver=fx2lafw --config samplerate=1m
60
61              Samplerate is an option common  to  most  logic  analyzers.  The
62              argument  specifies  the  samplerate in Hz. You can also specify
63              the samplerate in kHz, MHz or GHz.  The following are all equiv‐
64              alent:
65
66                $ sigrok-cli --driver fx2lafw --config samplerate=1000000
67
68                $ sigrok-cli --driver fx2lafw --config samplerate=1m
69
70                $ sigrok-cli --driver fx2lafw --config "samplerate=1 MHz"
71
72       -i, --input-file <filename>
73              Load  input  from  a  file  instead of a hardware device. If the
74              --input-format option is not supplied,  sigrok-cli  attempts  to
75              autodetect the file format of the input file.
76
77       -I, --input-format <format>
78              When loading an input file, assume it's in the specified format.
79              If this option is not supplied (in  addition  to  --input-file),
80              sigrok-cli  attempts  to autodetect the file format of the input
81              file. Use the -V option to see a list of  available  input  for‐
82              mats.
83
84              The  format name may optionally be followed by a colon-separated
85              list of options, where each option takes the form key=value.
86
87       -o, --output-file <filename>
88              Save output to a file instead  of  writing  it  to  stdout.  The
89              default  format used when saving is the sigrok session file for‐
90              mat. This can be changed with the --output-format option.
91
92       -O, --output-format <formatname>
93              Set the output format to use. Use the -V option to see a list of
94              available output formats.
95
96              The  format name may optionally be followed by a colon-separated
97              list of options, where each option takes the form key=value.
98
99              Supported formats currently include bits,  hex,  ascii,  binary,
100              vcd, ols, gnuplot, chronovu-la8, csv, and analog.
101
102              The  bits  or hex formats, for an ASCII bit or ASCII hexadecimal
103              display, can take a "width" option,  specifying  the  number  of
104              samples  (in  bits) to display per line. Thus hex:width=128 will
105              display 128 bits per line, in hexadecimal:
106
107               0:ffff ffff ffff ffff ffff ffff ffff ffff
108               1:ff00 ff00 ff00 ff00 ff00 ff00 ff00 ff00
109
110              The lines always start with the  channel  number  (or  name,  if
111              defined),  followed  by  a  colon. If no format is specified, it
112              defaults to bits:width=64, like this:
113
114               0:11111111 11111111 11111111 11111111 [...]
115               1:11111111 00000000 11111111 00000000 [...]
116
117       -C, --channels <channellist>
118              A comma-separated list of channels to be used in the session.
119
120              Note that sigrok always names  the  channels  according  to  how
121              they're  shown  on  the enclosure of the hardware. If your logic
122              analyzer numbers the channels 0-15, that's how you must  specify
123              them  with  this option. An oscilloscope's channels would gener‐
124              ally be referred to as "CH1", "CH2", and so on.  Use the  --show
125              option to see a list of channel names for your device.
126
127              The  default  is  to use all the channels available on a device.
128              You can name a channel like this: 1=CLK.  A  range  of  channels
129              can also be given, in the form 1-5.
130
131              Example:
132
133                $ sigrok-cli --driver fx2lafw --samples 100
134                             --channels 1=CLK,2-4,7
135               CLK:11111111 11111111 11111111 11111111 [...]
136                 2:11111111 11111111 11111111 11111111 [...]
137                 3:11111111 11111111 11111111 11111111 [...]
138                 4:11111111 11111111 11111111 11111111 [...]
139                 7:11111111 11111111 11111111 11111111 [...]
140
141              The  comma-separated  list is processed from left to right, i.e.
142              items farther to the right override previous items. For  example
143              1=CS,CS=MISO will set the name of channel 1 to MISO.
144
145       -g, --channel-group <channel group>
146              Specify the channel group to operate on.
147
148              Some  devices  organize  channels  into  groups, the settings of
149              which can only be changed  as  a  group.  The  list  of  channel
150              groups, if any, is displayed with the --show command.
151
152       -t, --triggers <triggerlist>
153              A  comma-separated  list  of triggers to use, of the form <chan‐
154              nel>=<trigger>.  You can use the name or number of the  channel,
155              and the trigger itself is a series of characters:
156
157              0 or 1: A low or high value on the pin.
158              r  or  f: A rising or falling value on the pin. An r effectively
159              corresponds to 01.
160              e: Any kind of change on a pin (either a  rising  or  a  falling
161              edge).
162
163              Not  every  device  supports all of these trigger types. Use the
164              --show command to see which triggers your device supports.
165
166       -w, --wait-trigger
167              Don't output any sample data (even  if  it's  actually  received
168              from the hardware) before the trigger condition is met. In other
169              words, do not output any pre-trigger data. This option is useful
170              if  you  don't  care about the data that came before the trigger
171              (but the hardware delivers this data to sigrok nonetheless).
172
173       -P, --protocol-decoders <list>
174              This option allows the user to specify a comma-separated list of
175              protocol  decoders  to be used in this session. The decoders are
176              specified by their ID, as shown in the --version output.
177
178              Example:
179
180               $ sigrok-cli -i <file.sr> -P i2c
181
182              Each protocol decoder can optionally be followed by a colon-sep‐
183              arated  list  of  options,  where  each  option  takes  the form
184              key=value.
185
186              Example:
187
188               $ sigrok-cli -i <file.sr>
189                            -P uart:baudrate=115200:parity_type=odd
190
191              The list of supported options depends entirely on  the  protocol
192              decoder.  Every  protocol  decoder has different options it sup‐
193              ports.
194
195              Any "options" specified for a protocol  decoder  which  are  not
196              actually supported options, will be interpreted as being channel
197              name/number assignments.
198
199              Example:
200
201               $ sigrok-cli -i <file.sr>
202                            -P spi:wordsize=9:miso=1:mosi=5:clk=3:cs=0
203
204              In this example, wordsize is an option supported by the spi pro‐
205              tocol decoder. Additionally, the user tells sigrok to decode the
206              SPI protocol using channel 1 as MISO signal for SPI,  channel  5
207              as MOSI, channel 3 as CLK, and channel 0 as CS# signal.
208
209       -A, --protocol-decoder-annotations <annotations>
210              By  default, only the stack's topmost protocol decoder's annota‐
211              tion output is shown. With this option another decoder's annota‐
212              tion can be selected for display, by specifying its ID:
213
214               $ sigrok-cli -i <file.sr> -P i2c,i2cfilter,edid -A i2c
215
216              If  a  protocol  decoder  has multiple annotations, you can also
217              specify which one of  them  to  show  by  specifying  its  short
218              description like this:
219
220               $ sigrok-cli -i <file.sr> -P i2c,i2cfilter,edid
221                            -A i2c=data-read
222
223              Select multiple annotations by separating them with a colon:
224
225               $ sigrok-cli -i <file.sr> -P i2c,i2cfilter,edid
226                            -A i2c=data-read:data-write
227
228              You can also select multiple protocol decoders, with an optional
229              selected annotation each, by separating them with commas:
230
231               $ sigrok-cli -i <file.sr> -P i2c,i2cfilter,edid
232                            -A i2c=data-read:data-write,edid
233
234       -M, --protocol-decoder-meta <pdname>
235              When given, show protocol decoder meta output instead of annota‐
236              tions.   The argument is the name of the decoder whose meta out‐
237              put to show.
238
239               $ sigrok-cli -i <file.sr> -M i2c
240
241              Not every decoder generates meta output.
242
243       -B, --protocol-decoder-binary <binaryspec>
244              When given, decoder "raw" data of various kinds  is  written  to
245              stdout instead of annotations (this could be raw binary UART/SPI
246              bytes, or WAV files, PCAP files, PNG files,  or  anything  else;
247              this  is  entirely  dependent  on  the decoder and what kinds of
248              binary output make sense for that decoder).
249
250              No other information is printed to stdout, so this  is  suitable
251              for piping into other programs or saving to a file.
252
253              Protocol  decoders  that support binary output publish a list of
254              binary classes, for example the UART decoder might have "TX" and
255              "RX". To select TX for output, the argument to this option would
256              be:
257
258               $ sigrok-cli -i <file.sr> -B uart=tx
259
260              If only the protocol decoder is specified, without binary class,
261              all classes are written to stdout:
262
263               $ sigrok-cli -i <file.sr> -B uart
264
265              (this  is only useful in rare cases, generally you would specify
266              a certain binary class you're interested in)
267
268              Not every decoder generates binary output.
269
270       -l, --loglevel <level>
271              Set the libsigrok and libsigrokdecode loglevel.  At  the  moment
272              sigrok-cli  doesn't  support  setting the two loglevels indepen‐
273              dently. The higher the number, the more  debug  output  will  be
274              printed. Valid loglevels are:
275
276              0   None
277              1   Error
278              2   Warnings
279              3   Informational
280              4   Debug
281              5   Spew
282
283       --show
284              Show  information about the selected option. For example, to see
285              options for a connected fx2lafw device:
286
287               $ sigrok-cli --driver fx2lafw --show
288
289              In order to properly get device options for your hardware,  some
290              drivers might need a serial port specified:
291
292               $ sigrok-cli --driver ols:conn=/dev/ttyACM0 --show
293
294              This  also works for protocol decoders, input modules and output
295              modules:
296
297               $ sigrok-cli --protocol-decoders i2c --show
298               $ sigrok-cli --input-format csv --show
299               $ sigrok-cli --output-format bits --show
300
301       --scan Scan for devices that can be detected automatically.
302
303              Example:
304
305               $ sigrok-cli --scan
306               The following devices were found:
307               demo - Demo device with 12 channels: D0 D1 D2 D3 D4 D5 D6 D7 A0
308              A1 A2 A3
309               fx2lafw:conn=3.26  - CWAV USBee SX with 8 channels: 0 1 2 3 4 5
310              6 7
311
312              However, not all devices are auto-detectable (e.g.  serial  port
313              based  ones).   For  those you'll have to provide a conn option,
314              see above.
315
316               $ sigrok-cli --driver digitek-dt4000zc:conn=/dev/ttyUSB0 --scan
317               The following devices were found:
318               Digitek DT4000ZC with 1 channel: P1
319
320       --time <ms>
321              Sample for <ms> milliseconds, then quit.
322
323              You can optionally follow the number by s to specify the time to
324              sample in seconds.
325
326              For example, --time 2s will sample for two seconds.
327
328       --samples <numsamples>
329              Acquire <numsamples> samples, then quit.
330
331              You  can  optionally  follow the number by k, m, or g to specify
332              the number of samples in kilosamples, megasamples,  or  gigasam‐
333              ples, respectively.
334
335              For example, --samples 3m will acquire 3000000 samples.
336
337       --frames <numframes>
338              Acquire <numframes> frames, then quit.
339
340       --continuous
341              Sample continuously until stopped. Not all devices support this.
342
343       --get <variable>
344              Get  the value of <variable> from the specified device and print
345              it.
346
347       --set  Set one or more variables specified with  the  --config  option,
348              without doing any acquisition.
349

EXAMPLES

351       In  order  to  get  exactly 100 samples from the connected fx2lafw-sup‐
352       ported logic analyzer hardware, run the following command:
353
354         sigrok-cli --driver fx2lafw --samples 100
355
356       If you want to sample data for 3 seconds (3000 ms), use:
357
358         sigrok-cli --driver fx2lafw --time 3000
359
360       Alternatively, you can also use:
361
362         sigrok-cli --driver fx2lafw --time 3s
363
364       To capture data from the first 4 channels  using  the  Openbench  Logic
365       Sniffer lasting 100ms at 10 MHz starting at the trigger condition
366              0:high, 1:rising, 2:low, 3:high, use:
367
368       sigrok-cli --driver ols:conn=/dev/ttyACM0 --config samplerate=10m \
369              --output-format bits --channels 0-3 --wait-trigger \
370              --triggers 0=1,1=r,2=0,3=1 --time 100
371
372       To turn on internal logging on a Lascar EL-USB series device:
373
374       sigrok-cli --driver lascar-el-usb:conn=10c4.0002 \
375              --config datalog=on --set
376

EXIT STATUS

378       sigrok-cli exits with 0 on success, 1 on most failures.
379

SEE ALSO

381       pulseview(1)
382

BUGS

384       Please  report any bugs via Bugzilla (http://sigrok.org/bugzilla) or on
385       the sigrok-devel mailing list (sigrok-devel@lists.souceforge.net).
386

LICENSE

388       sigrok-cli is covered by the GNU General  Public  License  (GPL).  Some
389       portions  are  licensed under the "GPL v2 or later", some under "GPL v3
390       or later".
391

AUTHORS

393       Please see the individual source code files.
394
395       This manual page was written by Uwe Hermann  <uwe@hermann-uwe.de>.   It
396       is licensed under the terms of the GNU GPL (version 2 or later).
397
398
399
400                                 May 04, 2014                    SIGROK-CLI(1)
Impressum