Post Go back to editing

Can't run cn0554_example.py

Category: Software
Product Number: CN0554

Hi Everyone,

I am directly interfacing the CN0554 to an RPI4 running ADI-Kuiper-Linux OS. I followed the instructions in https://wiki.analog.com/resources/tools-software/linux-software/pyadi-iio to install pyadi-iio. 

After that I downloaded the example https://github.com/analogdevicesinc/pyadi-iio/blob/master/examples/cn0554_example.py and tried to run it, but I get the error below

Traceback (most recent call last):
File "/home/analog/code/cn0554_example.py", line 17, in <module>
my_cn0554 = adi.cn0554(uri='local')
AttributeError: module 'adi' has no attribute 'cn0554'

Has anybody else run into this error?

Thanks,

Massimo

Top Replies

  •  Hi Mark,

    Thanks for providing additional information on  the AD7124. 

    I may have overlooked it, but I have not found a method for selecting the filter in the ad7124 class. 

    Using the iio_attr app from the libiio, I can see that the "filter_low_pass_3dB_frequency" value changes as the sampling frequency is changed, but I have not seen how to select SYNC3 (assuming that SYNC4 is the default one).

    I ran a simple test based on some suggestion I found online (see the command reported below), and I found that, with the sampling rate set a 19200 Sa/s, the throughput is about 15.6 kB/s, when retrieving data from 4 channels. Here is the command I used:

    iio_readdev -u ip:localhost ad7124-8 voltage0-voltage1 voltage2-voltage3 voltage4-voltage5 voltage6-voltage7| dd of=/dev/null status=progress
    4715008 bytes (4.7 MB, 4.5 MiB) copied, 303 s, 15.6 kB/s

    Since these are 4-byte words, the effective sampling rate is not quite 1 kSa/s. 

    Yes, not the fastest. Also, with this settings I measured about 1.1 mV RMS noise.

    Well, not very exciting, but it may be good enough for my application.

    Thanks,

    Massimo

  • Hi Dragos,

    Thanks for this. I had the same problem. I followed the instructions at: https://github.com/analogdevicesinc/pyadi-iio/blob/master/README.md.

    This resolved the 'no attribute' problem. However, I came up against some conflicts. First, I received the following error:

    "ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
    pyadi-iio 0.0.17 requires pylibiio>=0.25, but you have pylibiio 0.23.1 which is incompatible."

    Secondly, on installing pylibiio 0.25:

    "pytest-libiio 0.0.13 requires pylibiio>=0.23.1, but you have pylibiio 0.25 which is incompatible."

    'pip install pytest-libiio' results in pylibiio being wound back to 0.23.1.

    This is a circular incompatibility problem. Is there a fix for this? Or have I missed something?

    Regards,

    David