Post Go back to editing

PlutoSDR with RaspberryPi4 (Unable to claim interface, device or resource busy)

I am using Pluto with the python binding through the pyadi-iio and pylibiio libraries. I have built the libiio on my Rpi4 (ubuntu 22.04 lts server) and its functional as its supposed to as to my understanding.

With the iio_info -s command I am able to see the usb context of pluto connected as it should be

Using a python script I am trying to receive a signal on my pluto but when I run the script the following error occurs 


Have tried to run my script using sudo and without sudo but the same error occurs every time when the script tries to initialize and connect to the device.

Top Replies

  • sudo vs non-sudo should make no difference here.

    The error itself points to another application trying to use Pluto simultaneously. Do you try to create multiple object that interface with Pluto in your script or have other tools using it like IIO-Scope? Can you try using the IP address as so: 

    sdr = adi.Pluto("ip:192.168.2.1")

    -Travis

  • I mentioned the sudo and non-sudo commands because I thought using sudo, the resources would free up because of sudo but that did not work.
    There is no other application using Pluto while I run my script, and the code only creates a single object.
    I tried using the IP address but no luck because the interface over ethernet isn't shown even in iio_info -s. 

    Running using the IP address: 

    here's a snippet from my code that I am trying to run .

    import adi
    import time
    from scipy import signal
    import matplotlib.pyplot as plt
    import numpy as np
    
    sample_rate = 800e3 # Hz
    bandwidth = 200e3 # Hz
    center_freq = 900600000 # Hz
    num_samps = 10000 # number of samples returned per call to rx()
    
    sdr = adi.Pluto()
    # sdr.gain_control_mode_chan0 = "slow_attack"
    sdr.gain_control_mode_chan0 = 'manual'
    sdr.rx_hardwaregain_chan0 = 50 # dB
    sdr.rx_lo = int(center_freq)
    sdr.sample_rate = int(sample_rate)
    sdr.rx_rf_bandwidth = int(bandwidth) # filter width, just set it to the same as sample rate for now
    sdr.rx_buffer_size = num_samps
    

    The only thing that I can think of that might be occupying the resource is when Pluto is connected and the drive is mounted (the one where we can make the configurations).

    On a side note, when I do the same connection as I do with Rpi in Windows, I am able to see both contexts, IP and USB as shown 

  • I was able to resolve the issue using this custom Linux image at Analog Devices Kuiper Linux. The image is running perfectly on RaspberryPi4 and comes with all requirement pre-installed. Would recommend using this to avoid the hassle of installing dependencies.