How to build USB URI without iio_info

Hi, for some reason, I have configured a docker container and installed libiio and pyadi-iio. 

Modules are properly loaded in Python. 

I have a Pluto board connected with USB on the host computer and it is visible from the docker guest. For example, in the docker instance, I can properly reach the Pluto board and log with the serial connection /dev/ttyACM0. It can also be listed with the lsusb command. 

But for some reasons, iio_info is not working. I did not take the time to dig into the problem. 

Before going deeper into darkness, I just wanted to know if the USB URI can be constructed from some system information (lsusb results or some info from /sys/bus/usb/devices/) ? 

Parents Reply
  • I built the library with success but have the same (failing) result.

    In the meantime, I have discovered that the version 0.19 is working as expected while the version 0.21 is failing.

    I have prepared two Dockerfiles for demonstrating the issue. The basic setup is identical, the only difference is on the version of libiio.

    Analog Devices Hardware Python Interfaces - Bug report.tar.gz

    Each Dockerfile just configures the machine and installs the library.

    I run the docker instance once at a time on the same physical host which has the Pluto attached to one USB port.

    Once the shell is ready, I try the command "iio_attr -a -C".

    I have recorded the output of each case in the Dockerfiles : the 0.19 version is success ; the 0.21 fails.

    Let me know if I should port this as an issue on github.

    I consider using the 0.19 version as a good solution so I guess this thread can be marked as solved

  • 0
    •  Analog Employees 
    on Jun 24, 2020 4:31 PM 6 months ago in reply to drdang

    This is more an Docker/Avahi limitation. In v0.21 the IIO tools added support for zeroconf (Avahi) which requires more configuration within a Docker container since standard containers have limited network interface privileges. Hence the error:

    # root@40fbb2ee1832:~# iio_attr -a -C
    # ERROR: Unable to create Avahi DNS-SD client :Daemon not running
    # Scanning for IIO contexts failed: Text file busy

    The auto flag (-a) supports all backends now, so if you don't want this error you will need to re-configure Docker or explicitly define the context to use, and not rely on auto.