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/) ?
For USB support to work the backend has to enabled/built into libiio. Have you built libiio this way?
-Travis
Hi, thank you for your response.
I did not build the library ; I actually downloaded the deb package (http://swdownloads.analog.com/cse/travis_builds/master_latest_libiio-ubuntu-18.04-amd64.deb) and added the missing dependencies from the debian standard repos.
Following your indication I will try to build the library. I just have seen there are specific information on the USB support at the end of the libiio wikipage : https://wiki.analog.com/resources/tools-software/linux-software/libiio
I will let you know if I succeed or fail in my tests.
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
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.