<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <title>Avnav Installation</title>
    <link href="styles.css" rel="stylesheet" type="text/css">
  </head>
  <body data-order="300">
    <h1 class="western">AvNav Installation</h1>
    <div class="toc"> </div>
    <h2> Releases </h2>
    <p>A description of the releases and download links can be found in the <a
        href="release.html">releases document</a>.</p>
    <p>To provide a "ready to go" solution there are some images for the
      raspberry pi you can use. The kind of image we recommend mainly depends on
      your intended usage.</p>
    <p>For the "classical" approach (raspberry pi only used as a server, display
      on some mobile device) you should use the <a href="#headless">headless
        images</a>. For those images a raspberry pi 3B(+) gives a sufficient
      hardware basis. If you would like to have a monitor directly connected to
      your pi (and potentially also keyboard and mouse) just have a look at <a
        href="#openplotter">OpenPlotter</a>. For OpenPlotter we recommend a Pi4
      with at least 4GB of memory (potentially 2GB will be sufficient but there
      is not much room for future needs). There are also dedicated AvNav touch
      images - but currently they are outdated.</p>
    <h2><a name="Headless"></a><a name="headless"></a>Image without attached
      display (Headless)</h2>
    <p>Those images are maintained by <a href="https://www.segeln-forum.de/user/27970-blacksea/">BlackSea</a>
      (many thanks...). A description is available on<a href="https://github.com/free-x/avnav/wiki">
        his page</a>.<br>
      The images can be downloaded from&nbsp; <a href="https://www.free-x.de/raspbian/buster/">free-x</a>
      and installed on a SD card as described at <a href="http://www.raspberrypi.org/downloads">http://www.raspberrypi.org/downloads</a>
      (raw images). <br>
      The images come with </p>
    <ul>
      <li>avnav</li>
      <li><a href="https://github.com/wellenvogel/avnav-update-plugin">avnav-update-plugin</a></li>
      <li><a href="hints/ocharts.html">avnav-ocharts-plugin</a></li>
      <li><a href="https://github.com/wellenvogel/avnav-mapproxy-plugin">avnav-mapproxy-plugin</a></li>
      <li><a href="https://github.com/wellenvogel/avnav-history-plugin">avnav-history-plugin</a></li>
      <li><a href="hints/CanboatAndSignalk.html">SignalK</a></li>
      <li><a href="hints/CanboatAndSignalk.html">Canboat</a></li>
      <li>Support for <a href="https://www.gedad.de/projekte/projekte-f%C3%BCr-privat/gedad-marine-control-server/">MCS</a></li>
    </ul>
    They are preconfigured to route NMEA0183 traffic from all interfaces to
    AvNav and from there to <a href="hints/CanboatAndSignalk.html">SignalK</a>.
    AvNav will additionally fetch all data from SignalK and is able to display
    it.<br>
    NMEA2000 data will flow via Canboat to SignalK and in parallel to AvNav.<br>
    For details refer to <a href="hints/CanboatAndSignalk.html">CanBoatAndSignalK</a>.<br>
    <h3>Image Preparation</h3>
    <p>new as of 20210322</p>
    <p>Before inserting the SD card into your Raspberry (after you wrote the
      image to it) you should adapt a couple of settings (especially passwords).<br>
      The images hold a configuration file "avnav.conf" in the first partition
      of the SD card (boot partition). This file can be adapted using a text
      editor.</p>
    <p>More easily you can use a simple GUI that is provided <a href="../configGen/index.html">here</a>.
    </p>
    <a href="../configGen/index.html"><img src="en_ConfigImagesUi.png" alt="" class="fimage"></a>
    <p>The meaning of the fields:</p>
    <table border="1" width="100%">
      <tbody>
        <tr>
          <td>name</td>
          <td>default</td>
          <td>description</td>
        </tr>
        <tr>
          <td style="width: 187px;">Wifi SSID</td>
          <td style="margin-left: 112px; width: 229px;">avnav</td>
          <td style="margin-left: 127px;">The name of the Wifi network created
            by the raspberry. The images are prepared to create multiple
            networks - if you e.g. decide to add an additional Wifi stick, the
            software will append a 1 digit number to this name</td>
        </tr>
        <tr>
          <td>Wifi Password</td>
          <td>avnav-secret</td>
          <td>The password for the Wifi network. In any case you should change
            this. Just keep in mind that everybody that can connect to this Wifi
            network is able to influence your navigation.</td>
        </tr>
        <tr>
          <td>User pi password</td>
          <td>raspberry</td>
          <td>This is the password for the user pi whenever you connect e.g.
            with ssh or by attaching a monitor and keyboard. Also change this
            one!</td>
        </tr>
        <tr>
          <td>Configure MCS</td>
          <td>false</td>
          <td>When activated the image will set up the necessary software to
            interact with the <a href="https://www.gedad.de/projekte/projekte-f%C3%BCr-privat/gedad-marine-control-server/">Marine
              Control Server from GeDad</a>. This will cause an additional
            reboot of the Pi when it starts up for the first time.</td>
        </tr>
      </tbody>
    </table>
    <p>After filling the values you need to click the download button and store
      the file avnav.conf into the first partition of your SD card (overwriting
      the existing example there!). To be able to do this, your SD card must be
      visible on your computer (on Windows you will only see the first
      partition). Potentially it could be necessary to eject, remove and
      reinsert the SD card after you have written the image before the card
      becomes visible.</p>
    <p>It would also be a a good idea to additionally backup the downloaded file
      at a safe place to be able to use it again whenever you need to create a
      new SD card.</p>
    <p>You can now insert the SD card into your raspberry and power it on. The
      first boot will take some time as it is rebooting once to enlarge the file
      system on your card. If you selected the MCS it will reboot twice.</p>
    <p>Now you will be able to connect to your pi.</p>
    <h3><a name="connecting"></a>Connecting to your Raspberry Pi</h3>
    <p>Basically you can connect to the Wifi network established by the
      raspberry (you have just defined name and password for it) - or you can
      use an ethernet cable.<br>
      To connect to AvNav you need to find the address of the raspberry. <br>
      The most simple approach is to use <a href="https://en.wikipedia.org/wiki/Multicast_DNS">MDNS</a>
      (also named Bonjour or Avahi). This is supported on all desktop systems.
      So you can just type into the address bar of your browser:</p>
    <div class="code">http://avnav.local</div>
    <p>This should take you to the <a href="userdoc/index.html">start page</a>
      of AvNav. You should also be able to use avnav.local if you want to
      connect to the raspberry using some SSH terminal software (e.g. <a href="https://www.putty.org/">putty</a>
      on Windows).<br>
      If you try to connect using an ethernet cable it depends whether you only
      directly connect your computer with the pi - or if you have a home network
      were both are connected to. If you directly connect with a network cable
      you need to check if your computer assigns an IP address on this interface
      (should start with 169....). This can potentially take some time (also on
      the pi). So maybe you need to wait for up to 2 Minutes. If you have a home
      network things should go faster - but you need to know that both the pi
      and your computer have to be within the same network - otherwise
      avnav.local will not work.<br>
      On images prior to 20210322 you potentially need to add :8080 to the
      address you type into your browser.</p>
    <p>Unfortunately avnav.local will not work on Android. Therefore I recommend
      using a tool that handles this: <a href="https://play.google.com/store/apps/details?id=de.wellenvogel.bonjourbrowser">BonjourBrowser
        </a>. On IOS a <a href="https://play.google.com/store/apps/details?id=de.wellenvogel.bonjourbrowser">similar
        tool</a> is available - although avnav.local will work. You will find
      your pi with the avnav image with the service name "avnav-server".
      Typically you will also see a second entry "avnav" - this is <a href="hints/CanboatAndSignalk.html">SignalK</a>
      on the raspberry.<br>
      If you can see your pi in the BonjourBrowser but failing to connect this
      could be caused by some strange behavior of Android when connected to the
      internet by mobile data. In this case you should switch off mobile data on
      your device.</p>
    <p>If you have a system that is just connected to the Wifi network of the pi
      (with no other internet connection established) it should also be possible
      to connect using</p>
    <div class="code">http://avnav.avnav.de</div>
    <p>If this does not work the last resort is always to use the ip address.<br>
      For the wifi connection the primary ip would be</p>
    <div class="code">http://192.168.20.10</div>
    <p>If this fails too you may try: 192.168.30.10, 192.168.40.10,
      192.168.50.10.<br>
      If you are connected with an ethernet cable you only will be able to
      determine the IP if you have access to the router/dhcp server of your
      network. You need to check there for the ip address of the pi.</p>
    <p>The password has been set using the config file above. When connecting
      via ssh login with the user name pi. If your selected password does not
      work, try again with the default ('raspberry'). Potentially you did not
      store the avnav.conf correctly.<br>
      You can enter a root shell with sudo -i. </p>
    <h3>Technical Details<br>
    </h3>
    <p>The pi will set up one (or more) wifi networks using the internal adapter
      or additional wifi sticks. These networks will have addresses like
      192.168.20.0/24, 192.168.30.0/24, 192.168.40.0/24, 192.168.50.0/24. The pi
      itself has the address 192.168.x.10.</p>
    <p>There is a DHCP server and a DNS server (dnsmasqd). </p>
    <p>If the pi is connected to a wired network it tries to obtain an ip via
      DHCP. It has (NAT) forwarding from it's wifi to the wired network. This
      way you can easily connect to the internet if you are in the wifi network
      of the pi.<br>
      If you connect additional wifi sticks, more access points will be
      established.</p>
    <h3>Wifi Client Connection</h3>
    <p> A wifi stick like in the picture (on newer Pi4 use the blue socket close
      to the PCB) will allow you to connect to another wifi network - i.e. you
      can use this to connect to a network in a marina or your LTE router
      network. The internal name will be wlan-av1. You can configure the access
      to other wifi networks via <a href="userdoc/wpapage.html">the app</a>. </p>
    <img class="fimage" src="raspi3-wlan.jpg">
    <p>Port 80 is forwarded to the standard listener port of AvNav (8080).</p>
    <p>If you are connected to the pi via ssh you can check the
      status/start/stop with </p>
    <div class="code">sudo systemctl status avnav
sudo systemctl start avnav
sudo systemctl stop avnav</div>
    <p> </p>
    <h2 class="western"><a name="Touch"></a></h2>
    <p>For most actions ssh access to the pi is not required. To update you
      should use the preinstalled <a href="https://github.com/wellenvogel/avnav-update-plugin">Update
        Plugin</a> . The server configuration can now be accomplished within the
      AvNav app - at the <a href="userdoc/statuspage.html">Server/Status</a>
      page.</p>
    <h2>Image with Display (avnav-touch)</h2>
    <span>If you prefer to directly connect a display to your pi, this image is
      for you. </span>Holger (<a href="https://www.segeln-forum.de/user/13545-pandel/">pandel</a>)
    is maintaining an own image line for this set up. Great documentation is
    available at his <a href="https://open-mind.space/">AvNav-Touch website</a>.
    Download is possible from the <a href="https://open-mind.space/download/">download
      page</a>.<br>
    You still will be able to connect additional external displays.<br>
    <b>Important Hint</b>: <span style="color: red;">Currently (12/2020) those
      images are outdated. You need to set up the package repository as
      described in the next chapter and update the packages from there. We are
      working on an update.</span><br>
    <h2 class="western"><a name="Packages"></a>Package Installation</h2>
    Thanks to Oleg there are ready to go package repositories you can use in
    your debian based system. This will work on the pi as well as on any other
    debian (like ubuntu).<br>
    Information is available at his github <a href="https://github.com/free-x/avnav/wiki">wiki</a>.
    <p>To set up the repository on your system, run the following commands (only
      required if you don't use the headless or the AvNav touch images):</p>
    <div class="code">sudo date -s "2020/12/03 14:30" <br>wget https://www.free-x.de/debian/oss.boating.gpg.key
sudo apt-key add oss.boating.gpg.key
wget https://www.free-x.de/debian/boating.list
sudo cp boating.list /etc/apt/sources.list.d/
sudo apt-get update</div>
    <p>The first line (date -s...) is only necessary if you start e.g. with the
      headless image or another images that lacks time synchronization. Change
      date and time to your current time.<br>
    </p>
    <p>To install packages on a raspberry you need the run the following command
      after setting up the package repository:</p>
    <div class="code">sudo apt-get install avnav avnav-raspi avnav-update-plugin</div>
    The raspberry will start avnav with the user pi.<br>
    <br>
    For a different debian or if you don't want AvNav to reconfigure your
    operating system you execute:<br>
    <div class="code">sudo apt-get install avnav </div>
    <br>
    Afterwards you can start AvNav as any user with <br>
    <div class="code">avnav</div>
    <br>
    With <br>
    <div class="code">sudo systemctl enable avnav
sudo systemctl start avnav</div>
    you can enable avnav to start with the user avnav on system reboot.<br>
    Alternatively you can download all packages from my download pages:<br>
    <ul>
      <li><a title="downloads/releases" href="../downloads/release">Releases</a></li>
      <li><a href="../downloads/daily">Daily Builds</a></li>
    </ul>
    After downloading you can install them on a raspberry pi with:<br>
    <div class="code">sudo dpkg -i avnav_xxxxxxxx_all,deb
sudo dpkg -i avnav-raspi_xxxxxxxx_all.deb
sudo apt-get install -f</div>
    The first commands will usually complain about missing dependencies, the
    last one should fix these.<br>
    <p> You should install the avnav-raspi package only if you agree to the
      network settings being changed to AvNav's defaults. Otherwise pick the
      basic avnav package.</p>
    <p>On any other linux just install with:</p>
    <div class="code">sudo dpkg -i avnav_xxxxxxxx_all.deb
sudo apt-get install -f</div>
    <p>I would also recommend to install the <a href="https://github.com/wellenvogel/avnav-update-plugin">AvNav
        Update plugin</a> - either from the package repositories with</p>
    <div class="code">sudo apt-get install avnav-update-plugin</div>
    <p>or by downloading it directly from <a href="https://github.com/wellenvogel/avnav-update-plugin">GitHub.</a></p>
    <p>If you didn't install the avnav-raspi package you need some additional
      steps to automatically start up AvNav:</p>
    You could start up AvNav as user pi from the command line with avnav.<br>
    If you prefer to run it as a system service you need to create the
    directory:<br>
    /usr/lib/systemd/system/avnav.service.d<br>
    and copy the file <a href="https://github.com/wellenvogel/avnav/blob/master/raspberry/raspberry.conf">raspberry.conf</a>
    there.<br>
    Afterwards you still need to change line 5 in this file as you do not have
    the rasperry specific template. Change it to:<br>
    <br>
    <div class="code"><span style="color: rgb(36, 41, 46); font-family: SFMono-Regular, Consolas, &quot;Liberation Mono&quot;, Menlo, monospace; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: pre; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">ExecStart=/usr/bin/avnav -q -b /home/pi/avnav/data -t /usr/lib/avnav/avnav_template.xml</span></div>
    Afterwards you can enable and start avnav as system service with<br>
    <div class="code">sudo systemctl daemon-reload<br>sudo systemctl enable avnav
sudo systemctl start avnv</div>
    <p>If you did not create/copy the raspberry.conf file avnav will not run as
      user pi but as user avnav.</p>
    <p>If you wish a lightweight GUI for chart conversion on your desktop you
      should install the package 'python-wxgtk3.0'. You can start the GUI with</p>
    <div class="code">avnav -g</div>
    <p> </p>
    <h2><a name="openplotter"></a>OpenPlotter</h2>
    <p>For <a href="https://openmarine.net/openplotter">OpenPlotter</a> we have
      a complete integration for AvNav (thanks to <a href="https://github.com/e-sailing">e-sailing</a>).
      In the repository <a href="https://www.free-x.de/deb4op/">https://www.free-x.de/deb4op/</a>
      (that is already active in OpenPlotter) the necessary packages are already
      available. So you can install them simply with</p>
    <div class="code">sudo apt update
sudo apt install openplotter-avnav</div>
    <p> </p>
    <p>Since 2021/03 AvNav is already officially available in OpenPlotter. Sou
      if you update OpenPlotter you should already have openplotter-avnav being
      included.</p>
    <p>Do not install avnav-raspi_xxx.deb on OpenPlotter as this will interfere
      with the OpenPlotter network configuration. Within the OpenPlotter AvNav
      configuration you can change the port for AvNav (default 8080 and 8082 for
      ocharts) if this conflicts with other applications.</p>
    <p>When installing AvNav this way it will receive all NMEA data from SignalK
      (and will not open up any USB devices on its own). So you can make any
      interface configuration changes in OpenPlotter or SignalK.</p>
    <p><br>
    </p>
    <h2><a name="Windows"></a>Windows</h2>
    For Windows there is an installer, however it will not be updated on every
    release. The current version is <a href="../downloads/latestwindows">here</a>.<br>
    I recommend to use the AvNavNetSetup-jjjj-mm-dd-0.exe installer as this one
    will download the AvNav software directly and is able to update it without a
    new installer.<br>
    The Windows version is focussed on <a href="charts.html#windows">chart
      conversion</a> but offers the complete functionality otherwise. You can
    connect further displays.<br>
    <br>
    <br>
  </body>
</html>
