I work with SDR boards based on the AD9361 chip, which we control with IIO Oscilloscope connecting via IP.
We wanted to develop python scripts to control transmissions and make general tests, so we investigated and found out about "libiio" and "pyadi-iio".
We are trying to get it installed in a Ubuntu based system, but we reached a point where we have some errors that we can't figure out how to solve. Even though I think that libraries are correctly installed, because certain functions do work and I can get the SDR device into "fdd" ensm mode, and turning it back to "sleep", the instructions that appear on official script examples don't work.
Instructions like:
sdr.tx_lo = 4000000000
sdr_tx_rf_bandwidth = 2000000
result in errors of type:
Initial ensm_mode: sleep
Traceback (most recent call last):
File "/home/alen/VSC_projects/auto/auto.py", line 12, in <module>
sdr.tx_lo = 4000000000
File "/home/alen/.local/lib/python3.10/site-packages/adi/ad936x.py", line 206, in tx_lo
self._set_iio_attr_int("altvoltage1", "frequency", True, value)
File "/home/alen/.local/lib/python3.10/site-packages/adi/attribute.py", line 94, in _set_iio_attr_int
self._set_iio_attr(channel_name, attr_name, output, value, _ctrl)
File "/home/alen/.local/lib/python3.10/site-packages/adi/attribute.py", line 71, in _set_iio_attr
raise ex
File "/home/alen/.local/lib/python3.10/site-packages/adi/attribute.py", line 69, in _set_iio_attr
channel.attrs[attr_name].value = str(value)
File "/home/alen/.local/lib/python3.10/site-packages/iio.py", line 704, in <lambda>
lambda self, x: self._write(x),
File "/home/alen/.local/lib/python3.10/site-packages/iio.py", line 736, in _write
_c_write_attr(self._channel, self._name_ascii, value.encode("ascii"))
File "/home/alen/.local/lib/python3.10/site-packages/iio.py", line 62, in _check_negative
raise OSError(-result, _strerror(-result))
OSError: [Errno 22] Invalid argument
We've been with this a few days, and the issue might be easy to solve and we aren't able to do so because we don't have the required SW knowledge background, but I would very much appreciate community aid.