Post Go back to editing

PLUTO SDR TypeError: 'Context' object is not callable

RX LO 2000000000
Traceback (most recent call last):
  File "pluto.py", line 66, in <module>
    sdr.tx(iq)
  File "/usr/local/lib/python3.8/dist-packages/pyadi_iio-0.0.9-py3.8.egg/adi/rx_tx.py", line 396, in tx
  File "/usr/local/lib/python3.8/dist-packages/pyadi_iio-0.0.9-py3.8.egg/adi/rx_tx.py", line 331, in _tx_init_channels
  File "/usr/local/lib/python3.8/dist-packages/iio.py", line 1013, in __init__
    self._ctx = device.ctx()
TypeError: 'Context' object is not callable

Using Python3 on Ubuntu 20 LTS

Parents
  • There is a known issue with the python bindings from libiio.

    Can you try downgrading pylibiio first by running:

    sudo pip3 install pylibiio==0.21.0 --no-binary :all:

    -Travis

  • python 3.8.10 (default, Jun  2 2021, 10:49:15)
    [GCC 9.4.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import adi
    >>> sdr = adi.Pluto('ip:192.168.2.1') # or whatever your Pluto's IP is
    >>> sdr.sample_rate = int(2.5e6)
    >>> sdr.rx()
    ERROR: Open unlocked: -16
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/local/lib/python3.8/dist-packages/pyadi_iio-0.0.9-py3.8.egg/adi/rx_tx.py", line 252, in rx
      File "/usr/local/lib/python3.8/dist-packages/pyadi_iio-0.0.9-py3.8.egg/adi/rx_tx.py", line 173, in __rx_complex
      File "/usr/local/lib/python3.8/dist-packages/pyadi_iio-0.0.9-py3.8.egg/adi/rx_tx.py", line 129, in _rx_init_channels
      File "/usr/local/lib/python3.8/dist-packages/iio.py", line 1010, in __init__
        self._buffer = _create_buffer(device._device, samples_count, cyclic)
      File "/usr/local/lib/python3.8/dist-packages/iio.py", line 64, in _check_null
        raise OSError(err, _strerror(err))
    OSError: [Errno 16] Device or resource busy

  • Do you have another application like IIO-Scope running alongside pyadi?

    -Travis

  • Hi, No i don't have any other application running if so sdr = adi.Pluto('ip:192.168.2.1') shouldn't working. i am using pluto web fw.

  •  ps -a | grep py*
       2301 pts/0    00:00:00 sudo
       2305 pts/0    00:00:00 python3
       3540 pts/1    00:00:00 ping
       4837 pts/1    00:00:00 ps
       4838 pts/1    00:00:00 grep

  • Can you run and return the output:

    iio_readdev -u ip:192.168.2.1 cf-ad9361-lpc -s 1024 > d.dat

    ls -ls d.dat

    -Travis

  • Hi,

    iio_readdev -u ip:192.168.2.1 cf-ad9361-lpc -s 1024 > d.dat
    ERROR: Open unlocked: -16
    Unable to allocate buffer: Device or resource busy (16)

  • ssh root@192.168.2.1
    The authenticity of host '192.168.2.1 (192.168.2.1)' can't be established.
    ECDSA key fingerprint is SHA256:OxqSaO9GsDbBiWRHlLi3/DOqpb6A8YreUViW8WnKfnk.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added '192.168.2.1' (ECDSA) to the list of known hosts.
    root@192.168.2.1's password:
    Welcome to:
    ______ _       _        _________________
    | ___ \ |     | |      /  ___|  _  \ ___ \
    | |_/ / |_   _| |_ ___ \ `--.| | | | |_/ /
    |  __/| | | | | __/ _ \ `--. \ | | |    /
    | |   | | |_| | || (_) /\__/ / |/ /| |\ \
    \_|   |_|\__,_|\__\___/\____/|___/ \_| \_|

    v0.30-27-gd5bb-dirty
    wiki.analog.com/.../pluto

    PlutoWeb v3.0

    http://pluto.local/

    Run settings.sh to see available options.

    Dual-core enabled
    70-6000Mhz range enabled

    Auto-reboot disabled
    Auto-updates disabled

Reply
  • ssh root@192.168.2.1
    The authenticity of host '192.168.2.1 (192.168.2.1)' can't be established.
    ECDSA key fingerprint is SHA256:OxqSaO9GsDbBiWRHlLi3/DOqpb6A8YreUViW8WnKfnk.
    Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
    Warning: Permanently added '192.168.2.1' (ECDSA) to the list of known hosts.
    root@192.168.2.1's password:
    Welcome to:
    ______ _       _        _________________
    | ___ \ |     | |      /  ___|  _  \ ___ \
    | |_/ / |_   _| |_ ___ \ `--.| | | | |_/ /
    |  __/| | | | | __/ _ \ `--. \ | | |    /
    | |   | | |_| | || (_) /\__/ / |/ /| |\ \
    \_|   |_|\__,_|\__\___/\____/|___/ \_| \_|

    v0.30-27-gd5bb-dirty
    wiki.analog.com/.../pluto

    PlutoWeb v3.0

    http://pluto.local/

    Run settings.sh to see available options.

    Dual-core enabled
    70-6000Mhz range enabled

    Auto-reboot disabled
    Auto-updates disabled

Children
No Data