Posted on 28 Comments

NanoVNA Saver on the Raspberry Pi

UPDATED 14-April 2023: The latest version of NanoVNA Saver requires PyQt6 which is not yet available for the Pi. I will update these instructions when it’s available.

NanoVNA Saver is an excellent package that provides a host of useful features for owners of the NanoVNA V1 and V2. When looking around the Internet for Pi installation instructions, I found several conflicting and out-of-date posts, so decided to develop my own. I thought it might be helpful if I post my solution here.

NanoVNA Saver works well on the Raspberry Pi models 3, 4 and 400, but installation requires a few simple steps as shown here. These instructions assume you’re using the latest Raspberry Pi OS.

Open a terminal session (Ctl-Atl-T) and enter the following commands sequentially.

cd ~

sudo apt install -y python3-pyqt5 python3-scipy

git clone https://github.com/NanoVNA-Saver/nanovna-saver

cd nanovna-saver

sudo chmod +r ~/nanovna-saver/nanovna-saver.py

You can now run NanoVNA Saver by entering: python3 nanovna-saver.py

To create a desktop link for NanoVNA Saver, use the following steps:

Create a new file called NanoVNA-Saver.desktop, add the following content and save it in the desktop folder.

[Desktop Entry]

Name=NanoVNA-Saver

Comment=Runs NanoVNA Saver from the nanovna-saver folder

Icon=/usr/share/pixmaps/openbox.xpm

Exec=python3 /home/pi/nanovna-saver/nanovna-saver.py

Type=Application

Encoding=UTF-8

Terminal=false

Categories=None;

28 thoughts on “NanoVNA Saver on the Raspberry Pi

  1. GREAT! Thank you very much! This was exactly what I was looking for.
    Best regards
    Dieter

    1. Hi Dieter,

      Pleased to hear it was useful. I went through a few iterations myself before I found a working solution.

      Regards,

      Mike – G4WNC

      1. I really appreciate people like you sharing their knowledge! My Linux skills were not at all sufficient to get NanoVNA-Saver to work on the Pi.
        I am considering building a standalone VNA with a NanoVNA 2plus4, a Raspi and a 10 inch touch screen.
        The alternative software would be NanoVNA QT. I found an AppImage that runs nicely on the Pi. It’s a quite slim but less powerful than Saver.
        Thanks again, Mike!
        Dieter DL5RDO

  2. Thanks for the instructions, Dieter, I got it installed immediately. However, connecting to the nanovna fails. If necessary, I can send you the error messages but they are the same when connecting to my W10-system when not having run de cypressdriverinstaller (sometimes W10 restores the standard ones out of itself). I have tried running it with sudo but that gives the same error apart from some more warnings. The system I am using is a RPi3 with the latest version of Raspian is 11.1, bullseye.
    To check that there is not an issue with the acm_cdc driver I also installed the Arduino IDE from scratch. That did not give any problem.
    I hope you have another idea I can check?

    1. I’ll run some checks today. I’ve been having problems building FLDIGI on Bullseye and it looks like there are several common dependencies missing in the new OS. I’ll be working on it today and will let you know how I get on.

      Mike – G4WNC

      1. Sorry, Mike, I mistakenly took Dieter for your name.
        Thanks in advance for the efforts.

        1. Following your remark concerning Bullseye, I tried Buster. Took a while to locate a working image but I got one. I dist-upgraded it completely. Unfortunately this gives the same result: crashes after pressing connect!

          1. Hi Ger,

            That’s odd. I’ve just setup NanoVNA-Saver on a Pi-4 with Bullseye and the latest updates and it’s working fine with a NanoVNA H4 and a NanoVNA V2 plus. I should make sure you have all the latest updates and fixes. There is usually a sharp increase in update activity after a new OS release.

            Let me know if that doesn’t fix it.

            Regards,

            Mike

  3. Thanks Mike. I have played around a bit with the software itself, an interesting experience in itself. I already see to what complications in the software the different versions lead. Regarding the settings for the Serial port I am a bit surprised by how little is preset. The other values are assumed to have their default value and I wonder whether this assumption is correct.
    At this moment I have the strong feeling that there may be a timing issue. Further on in this week I have some more time to have a look into this.
    I will keep you posted.

  4. Well Mike, an intermediate result: success!
    I enlarged the WRITE_DELAY in the subroutine readVersion to 5 seconds (line 214) and now the errors are gone; 1 second did not work. Question is whether this is the issue or whether already a previous command required delay; as there is no response waited for I cannot tell yet.
    In the same file NanoVNA_V2.py the WRITE_DELAY is set to 0.05 s.
    Continuing research, albeit slowly.
    Ger

    1. Final messages: 2 seconds suffices for WRITE_SLEEP (used wrong term in previous email). No better place found. Issue posted on github #441.

  5. Hello Mike,

    Can I ask are these software packages suitable for the NanoVNA – H ?

    Thanks Dennis G6YBC

    1. Hi Dennis,

      Yes, NanoVNA-Saver works very well with the -H and -H4.

      Regards,

      Mike – G4WNC

  6. Thanks Mike!

    It works well on RPi4 running the latest Buster (2022-01-28-raspios-buster-armhf.zip “legacy” version). It crashed the very first time I clicked connect but it has been stable since then.

    I deviated a little from your instructions by replacing the icon path in NanoVNA-Saver.desktop with:
    Icon=/home/pi/nanovna-saver/icon_48x48.png
    and it works as expected.

    73 Johan SM6LKM

    1. Hi Johan,

      Glad it worked for you and thanks for the feedback. Mike – G4WNC

  7. Will work with raspberry pi 2b version 1?

    1. Hi, I’ve not tried it but it should work ok but it could be a bit slow. I should just try it.

      Regards,

      Mike – G4WNC

  8. Installed per instructions. Program works from the command line (even got it to recognize my nano vna) but I cannot get the desktop icon directions to work? I am new at this so please bear with. In the command lines for the desktop icon do I need to change anything for my specific device, ie; instead of just “pi”? Using a new Pi4 with Raspbian. Any help is appreciated.

    1. Hi Derek,

      It’s probably a typo. However, there is an alternative way to assign an icon to a desktop link.
      1. Right-click on the desktop link
      2. Select Properties
      3. Click on the icon image – this will open a panel where you can choose your desired icon.
      4. Once you have your selected icon hit OK to exit the panel and you’re done.

      Let me know how you get on.

      Regards Mike – G4WNC

  9. Hi Mike,
    Can you confirm that the above instructions still work with the latest NanoVNA-Saver release 0.5.4? I find that the programme runs but aborts on connection to the NanoVNA. (AttributeError: module ‘scipy’ has no attribute ‘signal’ – Aborted). Using Pi4 with OS Bullseye 64 bit.
    Regards
    Bob

    1. Hi Bob,

      I’ve just used the instructions to install NanoVNA Saver (0.5.4) on a fresh copy of 64-bit Bullseye and it’s working fine with my NanoVNA-H4 and NanoVNA V2 plus

      Regards,

      Mike

  10. Hi Mike,
    Many thanks for checking the instructions. I reloaded and now nanoVNS-Saver works OK on the Pi, although I note that there were changes made yesterday to NanoVNA-Saver software and I am not doing anything different from the day before!
    Thanks again.
    PS Your book “NanoVNAs Explained’ is exellent and very useful to any nanoVNA user.

    1. Hi Bob,

      Glad to hear that you’ve got it going. Also very pleased to hear that you’ve found my book useful. I was trying to make it a practical rather then a theoretical resource.

      Regards,

      Mike – G4WNC

  11. Hi Mike –
    Thank you so much for this posting. I can get the software to work from the command line but not the desktop. That’s ok I’ll figure it out. But what is the trick in getting the NanoVNA to shake hands with the pi?

    Best .
    Tim

    1. Hi Tim,

      It’s usually automatic because Linux loads the appropriate driver as soon as a new hardware connection is detected.

      You can check to see if your NanoVNA is being detected as follows.
      With your NanoVNA disconnected, open a terminal session and enter ls /dev/ttyAMA*
      This will list any connected serial ports
      Next, plug in the NanoVNA and run the command again. The NanoVNA will normally appear as /dev/ttyAMA0

      Mike – G4WNC

  12. I’m running “buster” on a Pi 3b+ and I’ve installed NanoVNA Saver per your instructions. When I run it from the command line, I get this output:

    rcnixon@raspberrypi:~/nanovna-saver $ python3 nanovna-saver.py
    Traceback (most recent call last):
    File “/home/rcnixon/nanovna-saver/nanovna-saver.py”, line 28, in
    from NanoVNASaver.__main__ import main
    ModuleNotFoundError: No module named ‘NanoVNASaver’

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
    File “/home/rcnixon/nanovna-saver/nanovna-saver.py”, line 33, in
    from NanoVNASaver.__main__ import main
    File “src/NanoVNASaver/__main__.py”, line 31, in
    from PyQt6 import QtWidgets
    ModuleNotFoundError: No module named ‘PyQt6’
    rcnixon@raspberrypi:~/nanovna-saver $

    Do you have any enlightenment for me?

    Thanks.

    1. Hi Russ,

      Unfortunately, the latest version of NanoVNA Saver requires PyQt6, which is not currently available or easy to install on the Raspberry Pi. When this situation changes I’ll update the instructions.

      Regards,

      Mike

  13. These instructions still work on the latest raspbian (2/24). Just do NOT download :
    git clone https://github.com/NanoVNA-Saver/nanovna-saver

    Instead just download and unzip/extract the 5.5 version:
    https://github.com/NanoVNA-Saver/nanovna-saver/archive/refs/tags/v0.5.5.zip
    or
    https://github.com/NanoVNA-Saver/nanovna-saver/archive/refs/tags/v0.5.5.tar.gz

    Works like a champ on a pi5! The initial screen may come up larger than the display, so just use Alt-(mouse-left-click), or sometimes FN(WindowsKey)-(mouse-left-click) which allows you to drag the image so it can be resized from the corner.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.