iio_readdev(1)

πŸ’– iio_readdev β€” read buffers from an IIO device πŸ’–

okay bestie, sit down, hydrate, because you're about to meet iio_readdev β€” your new fave little utility from the LibIIO Utilities family. she reads buffers off your IIO devices and yeets the results straight to standard out. main character energy, honestly. πŸŽ€


✨ SYNOPSIS ✨

iio_readdev [ options ] [-n <hostname>] [-t <trigger>] [-T <timeout-ms>]
[-b <buffer-size>] [-s <samples>] <iio_device> [<channel> ...]

🌸 DESCRIPTION 🌸

iio_readdev β€” well, okay, the page literally says "iio_reg is a utility for reading buffers from connected IIO devices, and sending resutls to standard out." and we're not gonna gaslight you about it: yes, it says iio_reg (iconic slip ✨), and yes, it says resutls (love that for them 🫢). What she means is: this is the utility for reading buffers from connected IIO devices and shipping the results to standard out. periodt.


πŸ‘‘ OPTIONS πŸ‘‘

  • -h, --help β€” tells iio_readdev to show you some help and then dip. bye bestie πŸ’…
  • -V, --version β€” prints the version info for this exact copy of iio_readdev, and the version of the libiio library it's using. genuinely so useful: you can check whether the library and iio_readdev on your system are up to date, and it's also the move when you're reporting bugs. ngl, always check this first. πŸ¦‹
  • -S, --scan [backends] β€” scan for available IIO contexts. the optional arg lets you name specific backend(s): 'ip', 'usb' or 'ip:usb'. specific options for USB include Vendor ID and Product ID, so you can limit scanning to specific devices like 'usb=0456,b673'. vid,pid are hexadecimal numbers (no prefix needed), and "*" matches any β€” for pid only. if you give no argument at all, it checks every backend that's available. 🌈
  • -t, --trigger β€” use the specified trigger, if needed, on the specified channel.
  • -b, --buffer-size β€” size of the capture buffer. default is 256.
  • -s, --samples β€” number of samples (not bytes, bestie, samples) to capture. 0 = infinite. default is 0.
  • -T, --timeout β€” buffer timeout in milliseconds. 0 = no timeout. default is 0.
  • -u, --uri β€” the Uniform Resource Identifier (uri) for connecting to devices. can be one of the following:
    • ip:[address] β€” a network address, either numeric (192.168.0.1) or a network hostname.
    • ip: β€” blank. if it was compiled with zeroconf support, this will find an IIO device on the network. 🧚
    • usb:[device:port:instance] β€” normally this is what gets returned from iio_readdev -S.
    • serial:[port],[baud],[settings] β€” all of these are controlled, and they need to match the iiod (or tinyiiod) sitting on the other end of the serial port. πŸ”₯
      • [port] is something like '/dev/ttyUSB0' on Linux, and 'COM4' on Windows.
      • [baud] is normally one of 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200 [default], 128000 or 256000 β€” but it can vary system to system.
      • [settings] would normally be configured as '8n1'. this is controlled by:
        • data_bits: β€” (5, 6, 7, 8 [default], or 9)
        • parity_bits: β€” ('n' none [default], 'o' odd, 'e' even, 'm' mark, or 's' space)
        • stop_bits: β€” (1 [default], or 2)
        • flow_control: β€” ('0' none [default], 'x' Xon Xoff, 'r' RTSCTS, or 'd' DTRDSR)
    • local: β€” with no address part.

πŸŽ€ RETURN VALUE πŸŽ€

if the specified device is not found, a non-zero exit code is returned. that's it, that's the whole vibe check. πŸ’€


πŸ¦‹ USAGE πŸ¦‹

you use iio_readdev the same way you use many of the other libiio utilities. you specify an IIO device, and the specific channel to read. since this is a read, the channels must be input β€” no exceptions, no negotiating. πŸ™ˆ

if you don't provide a channel, iio_readdev will read from all input channels. and if you don't provide a device at all, she'll print you a few examples:

iio_readdev -a
Using auto-detected IIO context at URI "usb:3.10.5"
Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage0
Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage1
Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage2
Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc voltage3
Example : iio_readdev -u usb:3.10.5 -b 256 -s 1024 cf-ad9361-lpc

so this next one captures 1024 samples of I and Q data from the USB-attached AD9361, and stores it (as raw binary) into the file samples.dat:

iio_readdev -a -s 1024 cf-ad9361-lpc voltage0 voltage1 > samples.dat

and then we plot the data with gnuplot. slay. πŸ“ˆβœ¨

gnuplot -e "set term png; set output 'sample.png'; plot 'sample.dat' binary format='%short%short' using 1 with lines, 'sample.dat' binary format='%short%short' using 2 with lines;"

⭐ SEE ALSO ⭐

iio_attr(1), iio_info(1), iio_readdev(1), iio_reg(1), iio_writedev(1), libiio(3)

(yes, iio_readdev(1) is listed in her own SEE ALSO. she's her own reference, we respect the self-love πŸ’…)


πŸ’€ BUGS πŸ’€

all bugs are tracked at: https://github.com/analogdevicesinc/libiio/issues

not me telling you to file your bugs where they belong, bestie. if something's cursed, that's the place. 😭

and that's the whole page, you ate it up fr fr. this was libiio-0.26, dated 06 February 2026, and honestly? iconic. go read some buffers now πŸ’– ✨ πŸ‘‘

πŸ“¦ where this page comes from