<?php
// RELEASE v1.2.0
session_start();
// require_once "./Resources/config.php";
// These vars will be grabbed from db eventually to enable faster modifications to the whole site.
// Technically just for experimentation with site design, but could be kept for production build.
// Primary content:
$primaryBG = "#020202"; // Very dark grey (nearly black)
$primaryC = "#ffffff"; // White
// Site stuff:
$siteName = "Ventus";
$siteHeaderName = "Ventus";
$logoSubtext = "Getting Started";
// Other:
$adminURLC = "#f585ff"; // Admin URL color (set to pink)
$navBG = ""; // Nav bar background color (not implemented)
$navC = ""; // Nav bar text color (not implemented)
// For enforcing font usage, made into a variable for things where there isn't a quote left to use. (Stylizing PHP echo things)
$montserrat = "font-family: 'Montserrat', sans-serif !important;";

// Footer content:
$ftBG = "#151515"; // Dark Grey
$ftBG2 = "#101010"; // Darker grey
$ftC = "#ffffff"; // White
$ftC2 = "#fefefe"; // Very light grey
// Footer link extensions
$liEXT = "dylanjhbuchanan"; // LinkedIn extension
$ghEXT = "BehemothNano"; // GitHub extension
?>
<!doctype html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <?php echo "<title>$siteName - Getting Started</title>"; ?>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
    <link rel="preconnect" href="https://fonts.googleapis.com">
    <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
    <link href="https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100;0,200;0,300;0,400;1,100;1,200;1,300;1,400&display=swap" rel="stylesheet">
    <link href="./Resources/global.css" rel="stylesheet">
    <script defer type="text/javascript" src="./Resources/global.js"></script>
    <script defer type="text/javascript" src="./Resources/ventus-getting-started.js"></script>
  </head>
  <?php
  echo "
  <body style='background-color: $primaryBG; color: $primaryC; $montserrat font-weight: 200;'>
  ";
  ?>
    <div id="contextOverlay" class="overlay" onclick="overlay('contactOverlay', 0)">
      <div class='d-flex justify-content-center overlayText'>
        <h2 class='ms-4' id='contact' style="font-family: 'Montserrat', sans-serif !important;">Contact Us:</h2>
      </div>
      <div class='wrapper d-flex justify-content-center overlayText'>
        <?php
          echo "
          <form action='./contact.php' method='post' style='$montserrat'>
            <div class='form-group ms-4'>
              <label for='msg'>Message:</label><br />
              <input type='text' name='msg' value=''>
              <br />
              <br />
              <label for='name'>Email:</label><br />
              <input type='text' name='name' value=''>
              ";
          if (isset($_SESSION['userID'])) {
            $authorID = $_SESSION['userID'];
            echo "
              <input type='hidden' name='authorID' value='$authorID'>
            ";
          }
          echo '
            </div>
          </form>
          ';
        ?>
      </div>
    </div>
    <?php
      if (isset($_SESSION["fatal"]) && $_SESSION["fatal"]) {
        if (isset($_SESSION['failureMSG'])) {
          $failureMSG = $_SESSION['failureMSG'];
        } else {
          $failureMSG = "An error occured. Please try again later.";
        }
        echo "
        <div class='alert alert-dismissible fade show' style='background-color: #ff6e7c; color: #96181e; $montserrat' role='alert'>
          $failureMSG
          <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close' style='$montserrat'></button>
        </div>
        <br />
        <br />
        ";
        $_SESSION["fatal"] = false;
        $_SESSION["failureMSG"] = "";
      }
      if (isset($_SESSION["oSuccess"]) && $_SESSION["oSuccess"]) {
        if (isset($_SESSION['successMSG'])) {
          $successMSG = $_SESSION['successMSG'];
        } else {
          $successMSG = "Operation successful.";
        }
        echo "
        <div class='alert alert-dismissible fade show' style='background-color: #abedbb; color: #5cb85c; $montserrat' role='alert'>
          $successMSG
          <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close' style='$montserrat'></button>
        </div>
        <br />
        <br />
        ";
        $_SESSION["oSuccess"] = false;
        $_SESSION["successMSG"] = "";
      }
    ?>
    <?php
      // Temp alert to tell users that this page is currently outdated and a new one is coming soon/exists
      // Other info text colors "#105c75", #0a3847 | original: #187796
      echo "
      <div class='alert alert-dismissible fade show' style='background-color: #54b4d3; color: #187796; $montserrat' role='alert'>
        Update (1-14-24): This page is currently outdated, and is now only relevant to the enterprise-focused version of Ventus.
        <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close' style='$montserrat'></button>
      </div>";
      echo "
      <div class='alert alert-dismissible fade show' style='background-color: #abedbb; color: #5cb85c; $montserrat' role='alert'>
        Update (4-19-24): This page is still outdated, but the documentation for the non-enterprise-focused version of Ventus can 
        now be found <a href='./projects.php'>here</a>. More information on project progress can be found 
        <a href=''>here</a>.
        <button type='button' class='btn-close' data-bs-dismiss='alert' aria-label='Close' style='$montserrat'></button>
      </div>";
    ?>
    <div style="text-align: center; font-family: 'Montserrat', sans-serif !important; font-size: 80px; font-weight: 300;">
      <?php
        echo "
        <p class='mtsrt' style='display: inline; $montserrat'>$siteHeaderName</p>
        <p class='mtsrt' style='font-size: 16px !important; $montserrat'>$logoSubtext</p>
        ";
      ?>
    </div>
    <nav class="navbar navbar-expand-lg" style="background-color: #101010; font-family: 'Montserrat', sans-serif !important;">
      <div class="container-fluid">
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent" style="font-family: 'Montserrat', sans-serif !important;">
          <ul class="navbar-nav me-auto mb-2 mb-lg-0">
            <li class="nav-item">
              <a class="nav-link navbar-brand" style="color: #ffffff;" aria-current="page" href="./home.php">Home</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" style="color: #ffffff;" href="./projects.php">My Work</a>
            </li>
            <li class="nav-item">
              <a class="nav-link" style="color: #ffffff;" href="./news.php">News</a>
            </li>
          </ul>
          <li class="nav-item dropstart me-4" style="list-style: none;">
            <a class="nav-link" style="color: #ffffff;" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
              Menu
            </a>
            <ul class="dropdown-menu">
              <li><a class="dropdown-item" onclick="overlay('contactOverlay', 1)" style="font-family: 'Montserrat', sans-serif !important; font-weight: 200 !important;">Contact</a></li>
              <li><a class="dropdown-item" onclick="overlay('supportOverlay', 1)" style="font-family: 'Montserrat', sans-serif !important; font-weight: 200 !important;">Support</a></li>
              <li><a class="dropdown-item" href="./settings.php" style="font-family: 'Montserrat', sans-serif !important; font-weight: 200 !important;">Settings</a></li>
              <li><hr class="dropdown-divider"></li>
              <?php
                if (isset($_SESSION["loggedIn"]) && $_SESSION["loggedIn"]) {
                  if ($_SESSION["scope"] == "admin") {
                    echo "
                    <a class='dropdown-item' style='color:$adminURLC; $montserrat font-weight: 200 !important;' href='./Helpers/edit-announcements.php'>Edit Announcements</a>
                    <a class='dropdown-item' style='color:$adminURLC; $montserrat font-weight: 200 !important;' href='./Helpers/edit-quotes.php'>Edit Projects</a>
                    <div class='dropdown-divider'></div>
                    ";
                  }
                  echo "
                  <li><a class='dropdown-item text-secondary' style='$montserrat font-weight: 200 !important;' href='./reset.php'>Reset Password</a></li>
                  <li><a class='dropdown-item text-danger' style='$montserrat font-weight: 200 !important;' href='./logout.php'>Log Out</a></li>
                  ";
                } else {
                  echo "
                  <li><a class='dropdown-item text-secondary' style='$montserrat font-weight: 200 !important;' href='./login.php'>Log In</a></li>
                  <li><a class='dropdown-item text-primary' style='$montserrat font-weight: 200 !important;' href='./register.php'>Sign Up</a></li>
                  ";
                }
              ?>
            </ul>
          </li>
        </div>
      </div>
    </nav>
    <div class="ms-4 me-4">
      <p class='ms-4 me-4 mtsrt' style='font-size: 32px !important; font-weight: 200 !important; text-align: center;'>
        Note: The build tutorial is a work in progress, but you can still download the project files on my <a href="https://github.com/BehemothNano/Ventus">GitHub</a>.
        <br />
        Other note: This guide is written for the way I set the original system up, but you can modify things as you see fit. Also, note that I had 3 normal drones, and one leader drone (more on this later.)
      </p>
      <br />
      <p style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Overview:
      </p>
      <br />
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        This guide was written for the way I set up my system. Note that I tried to make it as comprehensive as possible, but if you significantly deviate from the recommended setup procedure, you may encounter difficulties not discussed here.
        <br />
        <br />
        In other words, don't expect fully comprehensive support, especially if you modify the project files.
        <br />
        <br />
        <span style='font-size: 32px !important;'>Sections:</span>
        <br />
        <div class='ms-3'>
          • <a href='#terminology'>Terminology</a><br />
          • <a href='#materials'>Supplies</a><br />
          • <a href='#hardware1'>Hardware Setup</a><br />
          • <a href='#hardware2'>Hardware Assembly</a><br />
          • <a href='#software'>Software Setup</a><br />
          • <a href='#usage'>Usage</a><br />
          • <a href='#troubleshooting'>Troubleshooting</a><br />
          • <a href='#modification'>Modification Guidelines</a><br />
          • <a href='#legal'>Legal Information</a>
        </div>
      </div>
      <hr />
      <p id='hardware1' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Terminology:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        Due to the extent of the project, I've put some terminology I use below so that things don't have to be explained each time they're used.
        <br />
        <br />
        Drones:
        <br />
          There are two main classes of drones: leaders, and followers. The leader class has a single drone, whereas the follower class can have multiple depending on your configuration.
          If you're using a similar configuration to the one I use, then your follower class will have two sub classes: co-leaders, and actual followers. Details on classes and sub-classes 
          are below. 
          <br />
          <br />
          • Leader/Leader drone/Primary drone - this is the drone that is equipped with cameras and a basic networking thing. It sends captured footage to the other (Follower) drones for classification.
          <br />
          <br />
          • Co-leader/Co-leader drone/Secondary drone - In reality, these drones actually have the most authority over the fleet. The co-leader is a single drone equipped with classification 
          technology as well as a GPS RTK module. This is critical in determining the approximate location of any people found. The co-leader also handles fleet management. If any updates are 
          sent with regards to the formation of the fleet, or instructions to go to a certain place, the co-leader makes sure all of the drones know what to do. It is considered the co-leader 
          however since it is still capable of classifying images, and doesn't have the camera equipment the leader drone has. If you are going to change the local WiFi network's host, make 
          the co-leader do it.
          <br />
          <br />
          • Followers/Follower drones/Tertiary drones - These drones only have classification and networking technology on board (Jetson, Raspberry Pi, LoRa gear.) If desired, when a person is found, a 
          follower can be dispatched from the fleet to investigate further. Note that this requires the follower drones to have cameras sufficient at getting an image of a person so that 
          they can follow that person. These are not called followers because they can be configured to follow people, but rather because they follow the leader/co-leader.
        <br />
        <br />
        <br />
        Misc:
          • Home server/Base station - This refers to the computer you will use as your primary interface for the project. This device runs all management software, and communicates with the drones. I 
          used a Raspberry Pi 4 Model B with 8 GB of RAM for this, but you could use any computer you wish, just don't expect everything to be plug and play. Note that this is also your source of GPS 
          RTK correction data. While it is the interface for the system, you can connect a seperate device to it if putting it in a fairly remote location is necessary for your setup. I.e. on some big 
          pole in a savannah, and you'd rather run a cable or ssh into it than head over to it with peripherals every time you want to use the system.
          <br />
          <br />
      </div>
      <hr />
      <p id='materials' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        What you'll need:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        Use the buttons below to sort the list of materials. The buttons also affect the format of the downloadable CSV, but not the Excel spreadsheet. (Currently not implemented)
        <br />
        <button class='btn btn-primary me-3 mb-6 mt-2' onclick='sortBySupplier()'>Sort by Supplier</button><button class='btn btn-primary ms-3 mb-6 mt-2' onclick='sortByDrone()'>Sort by Drone</button>
        <br />
        <br />
        Click <a id='mtCSV' href="./Resources/material_list-sbs.csv" download>here</a> to download a CSV file with all needed materials, pricing information, and links to purchase them.
        <br />
        Alternatively, click <a href="./Resources/material_list.xlsx" download>here</a> to download a comprehensive Excel spreadsheet with cost calculators. This is a much nicer view of the materials needed than the CSV.
        <br />
        <br />
        Most items in the list link to a place to purchase that item. These are not affiliate links, and I do not receive any compensation if you buy these products from the linked websites.
        <br />
        <div id='material_list' class='ms-3 me-3 mtsrt'>
          • <a href="https://www.github.com/BehemothNano/Ventus" target="_blank">Project Files (software)</a>
          <br />
          • <a href="#">Project Files (hardware), link not yet active</a>
          <br />
          • <a href='https://www.bhphotovideo.com/c/product/1730098-REG/dji_cp_en_00000414_sb_mavic_3_thermal_with.html' target="_blank">DJI Mavic 3 Enterprise Thermal (DJI Mavic 3T)</a>
          <br />
          • Drones that can carry one kilo | min. 2, max however many will connect to leader's local WiFi network (recommended 4-5)
          <br />
          • <a href='https://www.amazon.com/dp/B084DSDDLT' target="_blank">Nvidia Jetson Nano x3</a>
          <br />
          • Raspberry Pi 4 Model B or newer, min 4 GB RAM x3
          <br />
          • Raspberry Pi 4 Model B or newer, min 8 GB RAM x1 (or any other computer that can be constantly be running several python scripts, just generally easier w/ a Raspberry Pi due to things that need to connect.)
          <br />
          • Raspberry Pi Small (zero?) - the best small one you can find
          <br />
          • Raspberry Pi Battery thing
          <br />
          • GPS RTK Module thing x2
          <br />
          • LoRa Networking Stuff (each drone needs an antenna, plus one for your base station, each kit has two)
          <br />
          • A lot of screws, McMaster-Carr is fantastic (details on screw specifics coming soon)
          <br />
          • Other hardware things (standoffs, washers, rubber tubing, again more details later)
          <br />
          • SparkFun QWIIC stuff, or another way to connect different boards to one another
          <br />
          • Three power banks (details coming soon)
          <br />
          • Three 1ft USB type A to USB type C cables, 0.5m works too
          <br />
          • Three 0.5ft USB type A to Micro USB cables, 0.5m works here as well
          <br />
          • Access to a 3D printer, or a way of building fairly precise lightweight custom parts
          <br />
          • A small plastic bag, or two if you want to be safe (these may need fairly frequent replacing)
          <br />
          • <a href='https://www.bhphotovideo.com/c/product/1692705-REG/sandisk_sdsqxav_256g_an6ma_256gb_extreme_uhs_i_microsd.html' target="_blank">Micro SD Cards x8 (64gb+ recommended, I used 256gb, min 32gb)</a>
          <br />
        </div>
      </div>
      <hr />
      <p id='hardware1' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Hardware Setup:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        In this section, we'll set up our Jetsons, Raspberry Pis, LoRa networking equipment, and drones.
        <br />
        <br />
        <span style='font-size: 32px !important;'>Raspberry Pi Setup:</span><br />
          You'll need to do this for every drone you have, as well as one aditional time if you're using a Raspberry Pi as your home server.
          <br />
          First, flash one MicroSDXC card with the Raspberry Pi OS for each Raspberry Pi you have. This can be done with Raspberry Pi Imager found <a href="https://www.raspberrypi.com/software/" target="_blank">here</a>.
          <br />
          Next, insert the MicroSDXC cards into each Raspberry Pi, and follow this <a href="https://www.raspberrypi.com/documentation/computers/getting-started.html" target="_blank">tutorial</a>.
          IMPORTANT: You may need to connect the Raspberry Pis to a WiFi network during setup. Even though you'll eventually make them use a custom local WiFi network, if you need to connect them to WiFi, it's fine.
          <br />
          After that, you can power down each Raspberry Pi, and set them aside. If you want to get ahead, put all of the files in the follower folder onto each Raspberry Pi (except for the Pi Zero, and your home server.)
          <br />
          <br />
          <br />
        <span style='font-size: 32px !important;'>Nvidia Jetson Setup:</span><br />
          Similar to above, you'll need to repeat this process for every drone you have.
          <br />
          First, use a etching software to flash a MicroSDXC card for each Jetson. You'll want to use some distribution of Linux, the exact version doesn't really matter so long as it works with everything else.
          <br />
          Next, go through the setup process for each Jetson by booting them up, either connecting via ssh for a headless setup or using peripherals for a desktop setup, and set them aside. You can also get ahead here by downloading the files in the Follower-Classification folder.
          <br />
          <br />
          <br />
        <span style='font-size: 32px !important;'>Other hardware setup:</span><br />
          LoRa
          GPS RTK
      </div>
      <hr />
      <p id='hardware2' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Hardware Assembly:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        This section features a lot of images, and rough sketches. These are going to be your main source of guidance, as I found the original 
        text based instructions to be somewhat useless when trying to get others to set up the project.
        <br />
        <br />
        Also, if you haven't already downloaded the 3D files for the project, download them <a href='#'>here (link not yet active)</a>. You'll need these 
        for making the enclosures for the equipment on board the drones. The rest of the guide assumes you have all of the equipment and supplies needed, 
        and have already printed the provided 3D files for enclosures, and have completed the hardware setup section.
        <br />
        <br />
        <span style='font-size: 32px !important;'>Follower drone hardware assembly:</span><br />
          You'll use this basic setup for all of the drones except for the leader. So, counting the secondary drone (co-leader), repeat this for each 
          follower drone you have.
        <br />
        <br />
        <span style='font-size: 32px !important;'>Secondary drone additional assembly:</span><br />
        You may have noticed that the secondary drone's hardware setup is currently identical to the other followers. It follows that this needs a little more work.
        <br />
        Start by locating one of your ZED-F9P GPS RTK2 boards, as well as one of your GNSS Multi-Band Magnetic Mount Antennas. To start, you'll attact the GPS RTK 
        board to the top of the enclosure as shown in the diagram below. Note that when the lid is put on the enclosure, your GPS-RTK board should be facing downwards. 
        This is shown in the second diagram.
        <br />
        Insert diagrams here
        <br />
        Next, connect the Qwiic cables to the boards as shown in the images below.
        <br />
        Insert images here
        <br />
        <br />
        <span style='font-size: 32px !important;'>Primary drone assembly:</span><br />
        Find your Raspberry Pi Zero 2W, and your PiJuice Hat. Connect the PiJuice Hat battery to the Raspberry Pi Zero 2W as shown below.
        <br />
        You may want to consider soldering headers to the Pi Zero, though in principle it isn't necessary (you really should given this will be put on a drone).
        <br />
        <br />
        Insert images here
        <br />
        <br />
        Next, put the assembly into a plastic bag (this is how it will be protected when on the drone.)
      </div>
      <hr />
      <p id='software' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Software Setup:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        Software setup placeholder text
      </div>
      <hr />
      <p id='usage' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Usage:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        Assuming you haven't modified anything, Ventus is fairly easy to use. The setup tool will walk you through the majority of the setup, and once everything is ready, 
        you can run init.py on your home server to get everything going. This will require a user. It is highly recommended to not use Ventus unsupervised. This could potentially 
        be catestrophic  if a drone were to hit someone, start a fire, etc. Note that by using Ventus, you are completely liable for anything that arises as a result of its usage, 
        and that I hold no responsibility whatsoever. 
        <br />

        If you've either moved the system (namely the position of the home server's GNSS antenna), or are using it for the first time, run setup.py to get everything ready.
        The setup process requires that all drones are powered on and in close proximity, so make sure you're ready before starting the setup process. If anything fails, all 
        configuration will be reset to default. If you'd like to change the default configuration, edit defaults.json. However, it is recommended to make a copy of defaults.json 
        before altering it in the event that your default configuration is problematic. If you don't, you can always download the original from the GitHub repo. 
        <br />
        <br />
        <span style='font-size: 32px !important; font-weight: 300 !important'>Setup:</span>
        <br />
        <div class='ms-4 me-4'>
          As previously stated, the setup tool will walk you through the majority of the setup. However, there are some hardware setup things you need to do. The previous setup steps 
          had you making the equipment assemblies and getting all of the software set up. Now, we need to actually set up the base station, and make sure that everything knows where it is.
          First, you'll want a big pole, rooftop, or other tall thing you can put stuff on that has an unobstructed view of the sky. This is where you'll put the GNSS antenna for your base 
          station. Note that the antenna's cable is only 5 meters, so you'll have to put your base station fairly close to the antenna. While you could extend the SMA cable, you lose signal 
          strength with longer cables, so if you absolutely have to use an extension, don't use a very long one. The antenna should be placed on top of its metal grounding plate. It has a 
          very strong magnet, but you can bolt it down if necessary. You'll want to attach the base plate to something that won't move with its threaded mount. It's critical that it stays 
          in one place and doesn't move much as you need your correction data to be as accurate as possible.
          <br />
          <br />
          While you're mounting the antenna, you will also want to find a place for the LoRa antenna. This isn't waterproof, so you could put it in a plastic bag, or make your own enclosure.
          Unless you want your base station to be right next to the two antennas, find a USB-C Thunderbolt cable that will be long enough to get from the LoRa antenna to your base station. 
          It's generally hard to find thunderbolt cables over about three meters, and you'll probably want a five meter cable (which would be the same length as the GNSS antenna's cable.) 
          You may have to look at active cables (these have signal boosters as opposed to just being a bundle of wires and shielding) so that the signal isn't lost.
          <br />
          <br />
          Next, reconnect the GNSS antenna's SMA cable to the base station's SMA to U.FL adapter, and your USB-C Thunderbolt cable to the base station. Try not to put too much strain on the 
          adapter, it's quite fragile. 
        </div>
      </div>
      <hr />
      <p id='troubleshooting' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Troubleshooting:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        Due to the nature of the project, several things can easily go wrong, and it can be hard to track down the issue. The goal of this section is to aid in troubleshooting as best as possible.
        However, note that this won't cover every possible issue, primarily the ones I ran into while creating the project, and ones others ran into when I was testing it.
        Subsections:
        <div class='ms-4'>
          • Hardware <br />
          <div class='ms-4 mt-0'>
            • Raspberry Pi Things <br />
            • Jetson Things <br />
            • LoRa Things <br />
            • GPS RTK Things <br />
          </div>
          <br />
          • Software <br />
          <div class='ms-4 mt-0'>
            • General/Shared <br />
            <div class='ms-4 mt-0'>
              • Setup (setup.py) <br />
              • Software Configuration (config.py) <br />
              • Request validation (requests.txt, skutils -> getRequest()) <br />
              • Networking (vts-lora.py, vts-network.py skutils.py) <br />
              • GPS (vts-rtk.py) <br />
              • I/O (interface.py) <br />
              • Readouts (vts-lcd.py) <br />
            </div>
            <br />
            • Server Side <br />
            <div class='ms-4 mt-0'>
              • Server (init.py) <br />
              • Status updates (status.py) <br />
              • Flight Manager (flightmanager.py) <br />
              • Flight Maps (flightdata.vtsx, config.py, setup.py) <br />
            </div>
            <br />
            • Client Side <br />
            <div class='ms-4 mt-0'>
              • Client (vts-client.py) <br />
              • Target location stuff (vts-locate.py) <br />
              • Image preparation (vts-clean.py) <br />
            </div>
            <br />
            • VTSX (Data stuff, see readme.) <br />
            <div class='ms-4 mt-0'>
              • Structures <br />
              <div class='ms-4 mt-0 mb-2'>
                • Loose Structures <br />
                • Strict Structures <br />
              </div>
              • Data Types
              <div class='ms-4 mt-0 mb-2'>
                • Map <br />
                • Matrix <br />
                • Space <br />
              </div>
              • Utils
              <div class='ms-4 mt-0 mb-2'>
                • Subtrack <br />
                • Anchor <br />
                • Drop <br />
                • Update <br />
                • Storage Regions <br />
                • Assembly Agents <br />
                • Process Relegation <br />
              </div>
            </div>
          </div>
        </div>
      </div>
      <hr />
      <p id='usage' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Modification Guidelines:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        Feel free to modify any of the project files as you see fit, however, note that the terms under the "Legal Information" section below still apply, regardless of the extent of the modifications you make.
        <br />
        As far as modifying hardware, there are a few things to consider:
          • The reason I use a Jetson and Raspberry Pi on each drone is so the Raspberry Pi can receive the image from the leader drone, process the image, and 
          send it over to the Jetson for classification. Since the only thing running on the Jetson is the model, nearly all of its proccessing power is used for 
          image classification. You could ditch the Raspberry Pi, and just use the Jetson, but note that you'd need to configure things such that the Jetson can 
          handle the model, and all of the I/O with various accessories such as the LoRa antennas or the GPS RTK modules. The project doesn't natively support 
          this configuration, so you'd have to do a bit of work to make everything work as expected.
          • The carrying capacity on the leader drone I used is very low (116 grams or so). The equipment I've fitted to it is below that weight limit coming in 
          around 96 grams. If you are going to modify this, I'd highly recommend just making one of the other drones handle WiFi/local networking, and just not 
          using anything on the leader.
      </div>
      <hr />
      <p id='legal' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        Legal Information:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        <span style='font-size: 32px !important;'>Liability:</span><br />
        I hold no liability whatsoever for anything that comes as a result of you or anyone else using Ventus. As an open source project, all distributions must include the license below:
        <div class='ms-4 me-4'>
          <br />
          Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
          <br />
          Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. <br />
          Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. <br />
          Neither the name of the University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. <br />
          <br />
          THIS SOFTWARE IS PROVIDED ''AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. <br />
          <br />
          Using the MIT License. (C) 2023 Dylan Buchanan
        </div>
        <br />
        <span style='font-size: 32px !important;'>Privacy:</span><br />
        Ventus does not collect any user data, and no information is required to use be able to use Ventus. Ventus does use GPS RTK, however, this data is local to your system unless you choose to export it.
        With regards to the people captured on video, what you do with the video footage afterwards depends on your local laws. Never use Ventus on a property that is not your own.
      </div>
      <hr />
      <p id='FAQs' style='font-size: 52px !important; font-family: "Montserrat", sans-serif !important; font-weight: 300 !important;'>
        FAQs:
      </p>
      <div class='ms-4 me-4' style='font-size: 20px !important; font-family: "Montserrat", sans-serif !important; font-weight: 200 !important;'>
        <span style='font-size: 32px !important;'>Legal FAQs:</span><br />
        Q: Something bad happened while I was using Ventus (drone hit person, drone started fire, etc.), what can I do? <br />
        A: Call your local authorities, but note that whatever happens, regardless of it being a hardware, software, or user error, it isn't my problem. 
        If you think the error was a result of a bug or a hardware issue, submit a pull request on the GitHub repo. 
        <br />
        <br />
        Q: Can I use this as a normal security system, e.g. in place of a home security system or a commercial security system? <br />
        A: You'd have to check your local laws, it may not be legal to fly drones around your property, or could be considered an invasion of privacy to 
        people nearby. You may also need a license to operate drones in your area. Ventus is not intended to serve as a security system, but rather a system 
        that enables people to better protect environmentally sensitive areas. Misuse of Ventus is highly discouraged.
        <br />
        <br />
        Q: Is Ventus a security system? <br />
        A: Ventus is not a security system, it is a monitoring system designed to alert users of potential tresspassers. It should not be used as a security system.
        <br />
        <br />
        Q: Once my Ventus system is set up and running, do I have to monitor it? <br />
        A: Yes, so long as it is active and there are drones in the air, someone should always be monitoring it to ensure that if something does go wrong, the appropriate 
        response can be carried out as quickly as possible. 
        <br />
        <br />
        Q: Do users require any training to use a Ventus system? <br />
        A: Any user should know how Ventus works, and should have the capacity to disable any process, recall drones, etc.
        <br />
        <br />
        <br />
        <span style='font-size: 32px !important;'>Other FAQs:</span><br />
        Q: What's the point of this? <br />
        A: This is mostly a proof of concept, but is a deployable drone security system aimed at making the protection of environmentally sensitive areas 
        (nature preserves, wildlife reserves, etc.) easier by providing an accessible, modular, and robust monitoring solution.
        <br />
        <br />
        Q: What advantage does this provide over having rangers or other authorities monitoring the area? <br />
        A: In general, Ventus is less disruptive as it is an aerial monitoring system, and over time will generally prove to be more cost effective than hiring employees. 
        <br />
        <br />
        Q: Why doesn't it work? <br />
        A: I don't know. Have you tried the troubleshooting section yet?
        <br />
        <br />
        Q: I tried the troubleshooting section and it still doesn't work. What can I do? <br />
        A: That's unfortunate, and I still don't know.
        <br />
        <br />
        Q: Can I fork the repo and turn this into my own project? <br />
        A: Yes, as long as you give me sufficient credit (see below), and follow the terms of the MIT license.
        <br />
        <br />
        Q: What is considered sufficient credit when modifying or otherwise distributing the project? <br />
        A: Credit should be given to myself and any other applicable authors when distributing or modifying the project. To credit me, including my name (Dylan Buchanan) 
        and website (djhbuchanan.com) is sufficient.
      </div>
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
      <br />
    </div>
    <div style="font-family: 'Montserrat', sans-serif; font-weight: 300;" class='ms-0 mt-0 me-0 mb-0'>
    <?php
      $contactOT = "contactOverlay";
      $contactOS = 1;
      echo "
      <!-- Page Footer -->
      <div style='background-color: $ftBG'>
        <div style='background-color: $ftBG2; color: $ftC2; text-align: center'; class='mb-0'>
          <p style='font-size: 30px; $montserrat font-weight 200 !important;' class='mt-4 mb-3'>Contact:</p>
          <p style='font-size: 18px; $montserrat font-weight 200 !important;'>contact@djhbuchanan.com</p>
          <a style='$montserrat font-weight 200 !important;' onclick='contactOverlay($contactOT, $contactOS)'>Or, send a message</a>
          <hr />
        </div>
        <nav class='navbar navbar-expand-lg mt-0 mb-0' style='background-color: $ftBG; $montserrat font-weight 200 !important;'>
          <div class='container-fluid'>
            <a style='$montserrat font-weight 200 !important;' class='navbar-brand' href='./home.php'>
              <!-- Logo icon: <img src='/path/logo.svg' alt='' width='30' height='24'> -->
              <p style='color: $ftC; $montserrat font-weight 200 !important;' class='ms-2 mt-1'>Logo</p>
            <a>
            <div class='navbar-nav'>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='./Extras/terms-of-service.php'>Terms of Service</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='./Extras/privacy-notice.php'>Privacy Notice</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='./Extras/accessibility.php'>Accessibility</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='./Extras/site-map.php'>Site Map</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='https://github.com/$ghEXT' target='_blank'>GitHub</a>
              <a class='nav-link' style='color: $ftC; $montserrat font-weight 200 !important;' href='https://www.linkedin.com/in/$liEXT' target='_blank'>LinkedIn</a>
            </div>
          </div>
        </nav>
      </div>
      <div style='background-color: $ftBG;'>
        <!-- Bottom Spacer -->
        <br />
      </div>
      ";
    ?>
    </div>
  </body>
</html>

<?php
  // mysqli_close($link);
?>