Post Go back to editing

ADALM-PHASER Example Python Code Not Working

Category: Software
Product Number: CN0566

I followed the quick-start guide and setup the the SD card according to the instructions.  Everything seemed to work ok.  However, when I try to run the examples, I receive an error regarding the NumPy version.  Any help would be appreciated.

analog@phaser:~/pyadi-iio/examples/phaser $ python phaser_find_hb100.py

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last): File "/home/analog/pyadi-iio/examples/phaser/phaser_find_hb100.py", line 50, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 174, in <module>
_check_versions()
File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 159, in _check_versions
from . import ft2font
AttributeError: _ARRAY_API not found
Traceback (most recent call last):
File "/home/analog/pyadi-iio/examples/phaser/phaser_find_hb100.py", line 50, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 174, in <module>
_check_versions()
File "/usr/lib/python3/dist-packages/matplotlib/__init__.py", line 159, in _check_versions
from . import ft2font
ImportError: numpy.core.multiarray failed to import

Parents
  • Hi  ,

    Which exact Kuiper Linux version did you use? It looks like there are two "patch" versions since 2022_r2:

    https://wiki.analog.com/resources/tools-software/linux-software/adi-kuiper_images/release_notes

    Looking back at the QuickStart history, I would have tested the setup scripts with 2022_r2 (no patch), but I don't see any indication that the numpy version was changed in the patches.

    If any updates are needed for compatibility to the latest Kuiper release, I can do that in a day or two. But let's go through your setup thoroughly first.

    -Mark

    Edit: I see numpy>=1.20 in pyadi-iio's requirements.txt:

    https://github.com/analogdevicesinc/pyadi-iio/blob/main/requirements.txt#L1

    I'll take a peek and see exactly which version ends up being installed.

  • Mark,

    I installed 2022_r2 Patch 2, which was the latest version as directed by the instructions on the quick start wiki.

    Thanks.

  • Hi  ,

    Can you send a screenshot of the output of phaser_find_hb100? We don't really do a quantitative amplitude measurement, but it might give us some clues. Also can you post the output file from the phaser_prod_tst.py? It logs a few things - supply voltages, etc.

    Can you post a few photos of your setup, with the antenna attached for the production test? (Often a picture shows us something that might not seem like an obvious problem.)

    If you have a spare, high-quality, 1 meter USB A to micro cable around, give it a try (between the Pluto and Raspberry Pi.) We originally chose the short cable because it's neater than a longer cable, but we've had issues with it and will switch back to the same 1 m cable we ship with the Pluto. It's generic, but fairly thick.

       did we ever find that the supplied short USB cable showed this set of symptoms?

    -Mark

  • Hi Mark,

    here is screenshot from phaser_find_hb100:

    Out of unclear reasons the production test passes now. Here is the output from a successful run of phaser_prod_tst:

    Attempting to connect to CN0566 via ip:localhost...
    Found CN0566. Connecting to PlutoSDR via default IP address...
    PlutoSDR connected.
    Using TX output closest to tripod mount, 10.525 GHz for production test.
    Reading voltage monitor...
    Passes  Board temperature:  31.0
    Passes  1.8V supply:  1.807861326644
    Passes  3.0V supply:  3.0114746069079996
    Passes  3.3V supply:  3.2849121066839997
    Passes  4.5V supply:  4.52544555293338
    Passes  Vtune amp supply:  13.827648914453636
    Passes  USB C input supply:  4.973339839675839
    Passes  Board current:  1.378173826996
    Passes  VTune:  9.95551756996944
    Passes all monitor readings, proceeding...
    Attempting to connect to CN0566 via ip:localhost...
    Found CN0566. Connecting to PlutoSDR via default IP address...
    PlutoSDR connected.
    Using TX output closest to tripod mount, 10.525 GHz for production test.
    Reading voltage monitor...
    Passes  Board temperature:  31.0
    Passes  1.8V supply:  1.807861326644
    Passes  3.0V supply:  3.0114746069079996
    Passes  3.3V supply:  3.2849121066839997
    Passes  4.5V supply:  4.52544555293338
    Passes  Vtune amp supply:  13.827648914453636
    Passes  USB C input supply:  4.973339839675839
    Passes  Board current:  1.378173826996
    Passes  VTune:  9.95551756996944
    Passes all monitor readings, proceeding...

    Setting up Pluto and Getting signal levels...
    Loading filter
    [370.05654826171536, 367.0650734169154, 356.40659161383206, 337.2058261102974, 360.6800044963135, 357.92089770840505, 354.39303828380906, 356.0192263826153]
    Calibrating SDR channel mismatch, gain and phase - place antenna at mechanical boresight in front of the array.



    Calibrating SDR channel mismatch, verbosely...
    channel mismatch:  0.6835900182976818  dB

    Calibrating Gain, verbosely, then saving cal file...
    Peak bin at  529  out of  1024
    Calibrating Element 0
    measuring element:  0
    Measured signal level (ADC counts): 359.61563294274504
    Calibrating Element 1
    measuring element:  1
    Measured signal level (ADC counts): 364.29098021031655
    Calibrating Element 2
    measuring element:  2
    Measured signal level (ADC counts): 354.95276468139303
    Calibrating Element 3
    measuring element:  3
    Measured signal level (ADC counts): 326.8331450708
    Calibrating Element 4
    measuring element:  4
    Measured signal level (ADC counts): 354.45110517392305
    Calibrating Element 5
    measuring element:  5
    Measured signal level (ADC counts): 352.54741287704434
    Calibrating Element 6
    measuring element:  6
    Measured signal level (ADC counts): 350.15723687578725
    Calibrating Element 7
    measuring element:  7
    Measured signal level (ADC counts): 352.33783321300274
    gcalibrated values:  [359.61563294274504, 364.29098021031655, 354.95276468139303, 326.8331450708, 354.45110517392305, 352.54741287704434, 350.15723687578725, 352.33783321300274]

    Calibrating Phase, verbosely, then saving cal file...
    Peak bin at  529  out of  1024
    Calibrating Element 0
    Null found at  163.125
    Phase Delta to correct:  16.875
    Calibrating Element 1
    Null found at  151.875
    Phase Delta to correct:  28.125
    Calibrating Element 2
    Null found at  146.25
    Phase Delta to correct:  33.75
    Calibrating Element 3
    Null found at  -87.1875
    Phase Delta to correct:  -92.8125
    Calibrating Element 4
    Null found at  -171.5625
    Phase Delta to correct:  -8.4375
    Calibrating Element 5
    Null found at  -180.0
    Phase Delta to correct:  0.0
    Calibrating Element 6
    Null found at  -168.75
    Phase Delta to correct:  -11.25
    Done calibration
    Test took 62.30778789520264 seconds.

    WooHoo! BOARD PASSES!!

    Please enter serial number of board, then press enter.
    A1002926

    Setting up Pluto and Getting signal levels...
    Loading filter
    [370.05654826171536, 367.0650734169154, 356.40659161383206, 337.2058261102974, 360.6800044963135, 357.92089770840505, 354.39303828380906, 356.0192263826153]
    Calibrating SDR channel mismatch, gain and phase - place antenna at mechanical boresight in front of the array.



    Calibrating SDR channel mismatch, verbosely...
    channel mismatch:  0.6835900182976818  dB

    Calibrating Gain, verbosely, then saving cal file...
    Peak bin at  529  out of  1024
    Calibrating Element 0
    measuring element:  0
    Measured signal level (ADC counts): 359.61563294274504
    Calibrating Element 1
    measuring element:  1
    Measured signal level (ADC counts): 364.29098021031655
    Calibrating Element 2
    measuring element:  2Attempting to connect to CN0566 via ip:localhost...
    Found CN0566. Connecting to PlutoSDR via default IP address...
    PlutoSDR connected.
    Using TX output closest to tripod mount, 10.525 GHz for production test.
    Reading voltage monitor...
    Passes  Board temperature:  31.0
    Passes  1.8V supply:  1.807861326644
    Passes  3.0V supply:  3.0114746069079996
    Passes  3.3V supply:  3.2849121066839997
    Passes  4.5V supply:  4.52544555293338
    Passes  Vtune amp supply:  13.827648914453636
    Passes  USB C input supply:  4.973339839675839
    Passes  Board current:  1.378173826996
    Passes  VTune:  9.95551756996944
    Passes all monitor readings, proceeding...

    Setting up Pluto and Getting signal levels...
    Loading filter
    [370.05654826171536, 367.0650734169154, 356.40659161383206, 337.2058261102974, 360.6800044963135, 357.92089770840505, 354.39303828380906, 356.0192263826153]
    Calibrating SDR channel mismatch, gain and phase - place antenna at mechanical boresight in front of the array.



    Calibrating SDR channel mismatch, verbosely...
    channel mismatch:  0.6835900182976818  dB

    Calibrating Gain, verbosely, then saving cal file...
    Peak bin at  529  out of  1024
    Calibrating Element 0
    measuring element:  0
    Measured signal level (ADC counts): 359.61563294274504
    Calibrating Element 1
    measuring element:  1
    Measured signal level (ADC counts): 364.29098021031655
    Calibrating Element 2
    measuring element:  2
    Measured signal level (ADC counts): 354.95276468139303
    Calibrating Element 3
    measuring element:  3
    Measured signal level (ADC counts): 326.8331450708
    Calibrating Element 4
    measuring element:  4
    Measured signal level (ADC counts): 354.45110517392305
    Calibrating Element 5
    measuring element:  5
    Measured signal level (ADC counts): 352.54741287704434
    Calibrating Element 6
    measuring element:  6
    Measured signal level (ADC counts): 350.15723687578725
    Calibrating Element 7
    measuring element:  7
    Measured signal level (ADC counts): 352.33783321300274
    gcalibrated values:  [359.61563294274504, 364.29098021031655, 354.95276468139303, 326.8331450708, 354.45110517392305, 352.54741287704434, 350.15723687578725, 352.33783321300274]

    Calibrating Phase, verbosely, then saving cal file...
    Peak bin at  529  out of  1024
    Calibrating Element 0
    Null found at  163.125
    Phase Delta to correct:  16.875
    Calibrating Element 1
    Null found at  151.875
    Phase Delta to correct:  28.125
    Calibrating Element 2
    Null found at  146.25
    Phase Delta to correct:  33.75
    Calibrating Element 3
    Null found at  -87.1875
    Phase Delta to correct:  -92.8125
    Calibrating Element 4
    Null found at  -171.5625
    Phase Delta to correct:  -8.4375
    Calibrating Element 5
    Null found at  -180.0
    Phase Delta to correct:  0.0
    Calibrating Element 6
    Null found at  -168.75
    Phase Delta to correct:  -11.25
    Done calibration
    Test took 62.30778789520264 seconds.

    WooHoo! BOARD PASSES!!

    Please enter serial number of board, then press enter.
    A1002926

    Measured signal level (ADC counts): 354.95276468139303
    Calibrating Element 3
    measuring element:  3
    Measured signal level (ADC counts): 326.8331450708
    Calibrating Element 4
    measuring element:  4
    Measured signal level (ADC counts): 354.45110517392305
    Calibrating Element 5
    measuring element:  5
    Measured signal level (ADC counts): 352.54741287704434
    Calibrating Element 6
    measuring element:  6
    Measured signal level (ADC counts): 350.15723687578725
    Calibrating Element 7
    measuring element:  7
    Measured signal level (ADC counts): 352.33783321300274
    gcalibrated values:  [359.61563294274504, 364.29098021031655, 354.95276468139303, 326.8331450708, 354.45110517392305, 352.54741287704434, 350.15723687578725, 352.33783321300274]

    Calibrating Phase, verbosely, then saving cal file...
    Peak bin at  529  out of  1024
    Calibrating Element 0
    Null found at  163.125
    Phase Delta to correct:  16.875
    Calibrating Element 1
    Null found at  151.875
    Phase Delta to correct:  28.125
    Calibrating Element 2
    Null found at  146.25
    Phase Delta to correct:  33.75
    Calibrating Element 3
    Null found at  -87.1875
    Phase Delta to correct:  -92.8125
    Calibrating Element 4
    Null found at  -171.5625
    Phase Delta to correct:  -8.4375
    Calibrating Element 5
    Null found at  -180.0
    Phase Delta to correct:  0.0
    Calibrating Element 6
    Null found at  -168.75
    Phase Delta to correct:  -11.25
    Done calibration
    Test took 62.30778789520264 seconds.

    WooHoo! BOARD PASSES!!

    and some photos from the setup in the lab:

      

    However, the problems remain using phaser_gui; There is no beam visible and in the FFT tab we only see noise (with a level that is independent of the state of the HB100 (on or off)).

    The USB cable in the kit is about 1 m long. We anyhow tested using a different cable but with the same results.

    Do you see something obviously wrong in the HB100 plot ? I notice the second peak at about -35 to -40 dBc but I guess that is not the problem ?

  • Hello Mark,

    I noticed that we (probably) had used the wrong voltage for HB100. Under Software Quick Start we read "Power up the HB100 source with either a 3V benchtop power supply or two AA cells ..". Anyhow, using 5V (as stated on the same page under Hardware requirements) we got the same problem. We also tested using a +10 dBm CW output from a HP 83630A with the same problems. To summarize; it passes the production test, it finds the frequency using phaser_find and it seems to be able to calibrate the array, but phaser_gui is not working. I have made several sd-card installations using different imager softwares (balena etcher and rpi imager). Right now, we are using the firmware linked from https://wiki.analog.com/resources/eval/user-guides/circuits-from-the-lab/cn0566/quickstart, and have not done any software updates of raspbian. We have ordered a second kit and hopefully that will work. Are there any other tests we should do before returning the problematic kit ?

  • Hi  , sorry for the delay. That find_hb100 plot looks great - did you hit "y" to save out the frequency when done?

    That should be enough to get the GUI up and running, even if the calibration fails. With a very low supply voltage, it's concievable that the HB100 would drift between saving out the calibration file and running the GUI, but if you power with 5V, maybe give it a few minutes to warm up, then re-run find_hb100, run the GUI right away.

    I'll see if I can think of anything else. Also you can run the GUI using the vivaldi antenna and TX output - I forget the exact GUI setup but I can dig into that as well.

      any thoughts?

    -Mark

  • Hi Mark, yes the .pkl files are generated. I tested warming up and immediately running _find_hb100 and then _gui with the same results. I also tried to test using the TX2 output after changing in config.py with the same results. Perhaps other changes are needed in that case though. I also tested running the code that initializes and recieves samples from PLUTO, found at https://pysdr.org/content/phaser.html. The ADC count is then about 1-2 and the PSD:s seem noise-like (similar to the FFT tab in _gui).

  • Hi Mark, got the second eval kit from Digikey today, and that one seems to work. Using phaser_gui the beamforming seems good.

    -Jan

  • Hi Jan,

    We'll follow up by email.

    -Mark

    Tagging:  

  • Hello Mark, we need advise how to proceed, so please email .

    -Jan

  • Hello, as a suggested test in your mail we changed "Rx_freq" in "config.py" from int(2.2e9) to int(1.9e9) and the phaser card that seemed faulty now seems to work similarly to the second kit we bought. Will the change to 1.9 GHz have any side effects ?

    -Jan

  • Wow, fantastic!

    That shouldn't have any side effects. We've been recommending 1.9 GHz in similar situations. The choice of the IF is somewhat arbitrary.

    Do let us know if you encounter any other odd behavior.

    -Mark

Reply Children
No Data