Analog Devices publishes a library called
libiio to connect to various platforms, including the AD9361. We will need to install it.
Please follow their instructions on how to install
libiio. It should be fairly straightforward.
There is one thing issue that I have had with installing the Python support. To fix this, do the following.
Navigate to the
libiio/ directory that you cloned during installation.
libiio/bindings/python in the file explorer. There should be a file called
setup.py.cmakein is there but not
setup.py, create a copy of
setup.py.cmakein and rename it
In a terminal at this location, run
sudo python setup.py install (or
sudo python3 setup.py install). This allows us to access libiio from Python.
This will guide you through setting up the AD9361 using the following hardware:
- ADRV9361-Z7035 software-defined radio
- ADRV1CRR-BOB break-out board
Attach the ADRV9361-Z7035 to the ADRV1CRR-BOB. Be sure to push down with some force to make sure it connects firmly.
The ADRV9361-Z7035 should have come with an SD card. Download these two files and copy them to the main directory of the SD card.
Plug the SD card into the ADRV9361-Z7035.
Connect the micro-USB and Ethernet to your host PC. The provided micro-USB did not want to plug into the board very easily.
Connect the DC power supply to the board.
Turn on the big red switch (S5) to power on the board.
With the board connected to your host and powered on, we will now configure the Ethernet connection.
Give the board about a minute to fully boot up before proceeding.
Open a terminal.
sudo screen /dev/ttyUSB0 115200 to remote into the device. (Install
screen if you need to.)
stop network-manager. This fixes some connection issues I had with my board.
ifconfig eth0 192.168.3.2 up. This sets the IP address of the board to
I usually leave this terminal open when working with the device.
Open a new terminal.
ifconfig to see your Ethernet devices (e.g.,
eth1). Choose the one connected to the board. This may take some trial and error. A USB-to-Ethernet dongle is convenient and can be easily identified by unplugging then plugging it in.
sudo ifconfig <Ethernet-device> 192.168.3.5 up where
ping 192.168.3.2 to ensure the connection between the devices is successful.
If you have issues with network stability on your host machine, this may help you. In,
managed=true. Then, run
sudo service network-manager restart.
With the Ethernet connection set up, we can now connect to the device via Python.
To confirm the libiio Python bindings were successfully installed, open a terminal and run
If there is an error message, the Python bindings weren’t installed correctly. (Be sure to use
If there is no error message, that’s good. That means we can try to interface with the device via Python.
Analog Devices publishes a convenient Python library for interfacing with the AD9361 (among other devices) called pyadi-iio.
Install pyadi-iio using the Analog Devices instructions or via
sudo pip install pyadi-iio (or
sudo pip3 install pyadi-iio).
Your First Python Script
If everything is successful so far, we are now ready to actually interface with the board.
In your Python editor of choice, create a script as follows and run it.
Hopefully, everything worked for you.
More information on pyadi-iio can be found at this website.
I will also be posting more notes on this topic.