"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
-<!-- 2020-06-29 Mon 22:27 -->
+<!-- 2020-06-30 Tue 17:14 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Ninfacyzga-01 Manual</title>
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
-<li><a href="#orgb231d05">1. Location Logging</a>
+<li><a href="#org9fe5754">1. Location Logging</a>
<ul>
-<li><a href="#orga7b5d26">1.1. Narrative</a></li>
-<li><a href="#orgc6050dc">1.2. Description</a>
+<li><a href="#org6b1a17d">1.1. Narrative</a></li>
+<li><a href="#org57c152a">1.2. Description</a>
<ul>
-<li><a href="#org832c363">1.2.1. Hardware</a></li>
-<li><a href="#orgbe37034">1.2.2. Software</a></li>
-<li><a href="#org578c835">1.2.3. Output</a></li>
+<li><a href="#orge971d48">1.2.1. Hardware</a></li>
+<li><a href="#orgd6ea21a">1.2.2. Software</a></li>
+<li><a href="#org2c5d288">1.2.3. Output</a></li>
</ul>
</li>
-<li><a href="#org7bb3aad">1.3. Operating Procedures</a>
+<li><a href="#org2c59433">1.3. Operating Procedures</a>
<ul>
-<li><a href="#orge393fe1">1.3.1. Initial Startup</a></li>
-<li><a href="#orgcaf0980">1.3.2. Normal Startup</a></li>
-<li><a href="#org73571fc">1.3.3. Normal Operation</a></li>
-<li><a href="#orga82b5fb">1.3.4. Normal Shutdown</a></li>
-<li><a href="#org5305842">1.3.5. Unscheduled Shutdown</a></li>
-<li><a href="#org4a5c4af">1.3.6. End of Life Disposal</a></li>
+<li><a href="#org6fcdbad">1.3.1. Initial Startup</a></li>
+<li><a href="#org15d1661">1.3.2. Normal Startup</a></li>
+<li><a href="#org989e70e">1.3.3. Normal Operation</a></li>
+<li><a href="#orged87647">1.3.4. Normal Shutdown</a></li>
+<li><a href="#org5d4c9cd">1.3.5. Unscheduled Shutdown</a></li>
+<li><a href="#org00f1b85">1.3.6. End of Life Disposal</a></li>
</ul>
</li>
</ul>
</ul>
</div>
</div>
-<div id="outline-container-orgb231d05" class="outline-2">
-<h2 id="orgb231d05"><span class="section-number-2">1</span> Location Logging</h2>
+<div id="outline-container-org9fe5754" class="outline-2">
+<h2 id="org9fe5754"><span class="section-number-2">1</span> Location Logging</h2>
<div class="outline-text-2" id="text-1">
<p>
This document was created by Steven Baltakatei Sandoval on
-<span class="timestamp-wrapper"><span class="timestamp"><2020-06-29 Mon 12:14> </span></span> under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons BY-SA 4.0 license</a>. It
-was updated by Steven Baltakatei Sandoval on <span class="timestamp-wrapper"><span class="timestamp"><2020-06-29 Mon 22:06></span></span>.
+<code>2020-06-29T12:14Z</code> under a <a href="https://creativecommons.org/licenses/by-sa/4.0/">Creative Commons BY-SA 4.0 license</a>. It
+was updated by Steven Baltakatei Sandoval on <code>2020-06-30T17:13Z</code>
</p>
</div>
-<div id="outline-container-orga7b5d26" class="outline-3">
-<h3 id="orga7b5d26"><span class="section-number-3">1.1</span> Narrative</h3>
+<div id="outline-container-org6b1a17d" class="outline-3">
+<h3 id="org6b1a17d"><span class="section-number-3">1.1</span> Narrative</h3>
<div class="outline-text-3" id="text-1-1">
<p>
Ninfacyzga-01 records (logs) its position in time and space using a
</p>
</div>
</div>
-<div id="outline-container-orgc6050dc" class="outline-3">
-<h3 id="orgc6050dc"><span class="section-number-3">1.2</span> Description</h3>
+<div id="outline-container-org57c152a" class="outline-3">
+<h3 id="org57c152a"><span class="section-number-3">1.2</span> Description</h3>
<div class="outline-text-3" id="text-1-2">
</div>
-<div id="outline-container-org832c363" class="outline-4">
-<h4 id="org832c363"><span class="section-number-4">1.2.1</span> Hardware</h4>
+<div id="outline-container-orge971d48" class="outline-4">
+<h4 id="orge971d48"><span class="section-number-4">1.2.1</span> Hardware</h4>
<div class="outline-text-4" id="text-1-2-1">
</div>
<ol class="org-ol">
-<li><a id="orgb0e8ddc"></a>Raspberry Pi Zero W<br />
+<li><a id="org21a0c6c"></a>Raspberry Pi Zero W<br />
<div class="outline-text-5" id="text-1-2-1-1">
<p>
See the <a href="https://www.raspberrypi.org/pi-zero-w/">OEM</a> webpage for this product.
</p>
</div>
</li>
-<li><a id="org7b37dcc"></a>PiZ UpTime 2.0<br />
+<li><a id="org002698e"></a>PiZ UpTime 2.0<br />
<div class="outline-text-5" id="text-1-2-1-2">
<p>
See the <a href="https://alchemy-power.com/piz-uptime-2-0/">OEM</a> webpage for this product.
</li>
</ol>
</div>
-<div id="outline-container-orgbe37034" class="outline-4">
-<h4 id="orgbe37034"><span class="section-number-4">1.2.2</span> Software</h4>
+<div id="outline-container-orgd6ea21a" class="outline-4">
+<h4 id="orgd6ea21a"><span class="section-number-4">1.2.2</span> Software</h4>
<div class="outline-text-4" id="text-1-2-2">
<p>
<code>bkgpslog</code> : The bash script that performs the location data
</div>
<ol class="org-ol">
-<li><a id="org0c488b2"></a>Narrative<br />
+<li><a id="org3d64ae8"></a>Narrative<br />
<div class="outline-text-5" id="text-1-2-2-1">
<p>
<code>bkgpslog</code> populates a 60-second buffer with NMEA data from <code>gpsd</code> via
</ol>
</div>
-<div id="outline-container-org578c835" class="outline-4">
-<h4 id="org578c835"><span class="section-number-4">1.2.3</span> Output</h4>
+<div id="outline-container-org2c5d288" class="outline-4">
+<h4 id="org2c5d288"><span class="section-number-4">1.2.3</span> Output</h4>
<div class="outline-text-4" id="text-1-2-3">
</div>
<ol class="org-ol">
-<li><a id="org72b99a5"></a>File Formats<br />
+<li><a id="orgaf12e62"></a>File Formats<br />
<ol class="org-ol">
-<li><a id="orgdb7241e"></a>NMEA<br />
+<li><a id="org8576f09"></a>NMEA<br />
<div class="outline-text-6" id="text-1-2-3-1-1">
<p>
See the <a href="https://en.wikipedia.org/wiki/NMEA_0183">Wikipedia page</a> for this.
</p>
</div>
</li>
-<li><a id="orgeea00c8"></a>GPX<br />
+<li><a id="orge0c91b6"></a>GPX<br />
<div class="outline-text-6" id="text-1-2-3-1-2">
<p>
See the <a href="https://en.wikipedia.org/wiki/GPS_Exchange_Format">Wikipedia page</a> for this. <a href="http://wiki.gis.com/wiki/index.php/WGS84">WGS84</a> is the datum used.
</p>
</div>
</li>
-<li><a id="orgc8b05e7"></a>KML<br />
+<li><a id="org25abef8"></a>KML<br />
<div class="outline-text-6" id="text-1-2-3-1-3">
<p>
See the <a href="https://en.wikipedia.org/wiki/Keyhole_Markup_Language">Wikipedia page</a> for this. <a href="http://wiki.gis.com/wiki/index.php/WGS84">WGS84</a> is the datum used.
</li>
</ol>
</li>
-<li><a id="org5c2a1ad"></a>Encryption Method<br />
+<li><a id="org67f375b"></a>Encryption Method<br />
<div class="outline-text-5" id="text-1-2-3-2">
<p>
Files produced by the bkgpslog script are encrypted against a set of
</p>
</div>
<ol class="org-ol">
-<li><a id="org460d569"></a>Encryption Commands<br />
+<li><a id="org4ff51de"></a>Encryption Commands<br />
<div class="outline-text-6" id="text-1-2-3-2-1">
<p>
Files may be encrypted to several recipients using a command similar to:
</li>
-<li><a id="org1a5268c"></a>Decryption Commands<br />
+<li><a id="org4a3cc4d"></a>Decryption Commands<br />
<div class="outline-text-6" id="text-1-2-3-2-2">
<p>
Files may be decrypted using a command similar to:
</ol>
</div>
</div>
-<div id="outline-container-org7bb3aad" class="outline-3">
-<h3 id="org7bb3aad"><span class="section-number-3">1.3</span> Operating Procedures</h3>
+<div id="outline-container-org2c59433" class="outline-3">
+<h3 id="org2c59433"><span class="section-number-3">1.3</span> Operating Procedures</h3>
<div class="outline-text-3" id="text-1-3">
</div>
-<div id="outline-container-orge393fe1" class="outline-4">
-<h4 id="orge393fe1"><span class="section-number-4">1.3.1</span> Initial Startup</h4>
+<div id="outline-container-org6fcdbad" class="outline-4">
+<h4 id="org6fcdbad"><span class="section-number-4">1.3.1</span> Initial Startup</h4>
<div class="outline-text-4" id="text-1-3-1">
<p>
See OEM (Ozzmaker) <a href="https://ozzmaker.com/berrygps-berrygps-imu-quick-start-guide/">quickstart guide for the BerryGPS-IMU</a>.
</div>
<ol class="org-ol">
-<li><a id="org5d6581b"></a>Physical Setup<br />
+<li><a id="org407a2c4"></a>Physical Setup<br />
<div class="outline-text-5" id="text-1-3-1-1">
<p>
BerryGPS-IMU must be electrically connected to the correct pins on the
</div>
</li>
-<li><a id="orgdf04559"></a>Software Setup<br />
+<li><a id="org5d08a29"></a>Software Setup<br />
<ol class="org-ol">
-<li><a id="org4804e32"></a>Install Executables<br />
+<li><a id="org444d2f8"></a>Install Executables<br />
<div class="outline-text-6" id="text-1-3-1-2-1">
<p>
Install Raspbian 10 Buster onto an SD card image. See the Raspberry Pi
</div>
</li>
-<li><a id="orgcf659dd"></a>Automatic Start Configuration<br />
+<li><a id="org629d57e"></a>Disable Swap File<br />
<div class="outline-text-6" id="text-1-3-1-2-2">
<p>
+Since standard Raspbian 10 install involves copying unencrypted file
+system image to SD card which is mounted by the Raspberry Pi, system
+memory may be written to disk in the form of a Swap file as described
+<a href="https://ideaheap.com/2013/07/stopping-sd-card-corruption-on-a-raspberry-pi/">here</a>. In order to reduce the chance that location log data is ever
+written to disk, swap file functionality must be disabled.
+</p>
+
+<p>
+To view the status of the swap file in Raspbian 10, run <code>free -m</code>:
+</p>
+
+<pre class="example">
+pi@ninfacyzga-01:~$ free -m
+ total used free shared buff/cache available
+Mem: 432 86 36 21 309 268
+Swap: 99 0 99
+</pre>
+
+<p>
+The swap file may be disabled by:
+</p>
+
+<pre class="example">
+pi@ninfacyzga-01:~$ sudo dphys-swapfile swapoff
+pi@ninfacyzga-01:~$ sudo dphys-swapfile uninstall
+pi@ninfacyzga-01:~$ sudo update-rc.d dphys-swapfile remove
+pi@ninfacyzga-01:~$ free -m
+ total used free shared buff/cache available
+Mem: 432 96 33 22 302 258
+Swap: 0 0 0
+</pre>
+</div>
+</li>
+
+<li><a id="orgd9b9b30"></a>Automatic Start Configuration<br />
+<div class="outline-text-6" id="text-1-3-1-2-3">
+<p>
Edit the user cron job list with <code>$ crontab -e</code> to add the following
lines:
</p>
<p>
The <code>age1z2...qkv6p</code> is an <code>age</code> public key string. Please see the
-<a href="#orgc8fd75d">Key Generation</a> section for an explanation.
+<a href="#org82f0a69">Key Generation</a> section for an explanation.
</p>
<p>
</div>
</li>
-<li><a id="org5275559"></a>Log Transfer Configuration<br />
-<div class="outline-text-6" id="text-1-3-1-2-3">
+<li><a id="orgce1df03"></a>Log Transfer Configuration<br />
+<div class="outline-text-6" id="text-1-3-1-2-4">
<p>
Log files may be shared to other machines via <code>syncthing</code>. See <a href="https://docs.syncthing.net/">this</a>
manual for how to set up a shared folder and add Ninfacyzga-01 as a
</div>
</li>
-<li><a id="orgc8fd75d"></a>Key Generation<br />
-<div class="outline-text-6" id="text-1-3-1-2-4">
+<li><a id="org82f0a69"></a>Key Generation<br />
+<div class="outline-text-6" id="text-1-3-1-2-5">
<p>
An <code>age</code> encryption key may be generated like so:
</p>
</ol>
</div>
-<div id="outline-container-orgcaf0980" class="outline-4">
-<h4 id="orgcaf0980"><span class="section-number-4">1.3.2</span> Normal Startup</h4>
+<div id="outline-container-org15d1661" class="outline-4">
+<h4 id="org15d1661"><span class="section-number-4">1.3.2</span> Normal Startup</h4>
<div class="outline-text-4" id="text-1-3-2">
<p>
Turn on Ninfacyzga-01 by supplying 5VDC power to the Raspberry Pi. No
</p>
</div>
</div>
-<div id="outline-container-org73571fc" class="outline-4">
-<h4 id="org73571fc"><span class="section-number-4">1.3.3</span> Normal Operation</h4>
+<div id="outline-container-org989e70e" class="outline-4">
+<h4 id="org989e70e"><span class="section-number-4">1.3.3</span> Normal Operation</h4>
<div class="outline-text-4" id="text-1-3-3">
<p>
No interaction beyond continually supplying approximately 100mA of
</p>
</div>
<ol class="org-ol">
-<li><a id="org55738e2"></a>Log Transfer<br />
+<li><a id="org87c8f03"></a>Log Transfer<br />
<div class="outline-text-5" id="text-1-3-3-1">
<p>
Log files may be transferred by use of <code>syncthing</code> shared folders.
</p>
</div>
</li>
-<li><a id="org16c5bdc"></a>Automatic Updates<br />
+<li><a id="org203d027"></a>Automatic Updates<br />
<div class="outline-text-5" id="text-1-3-3-2">
<p>
The <code>automatic-upgrades</code> package, if installed, should automatically
</li>
</ol>
</div>
-<div id="outline-container-orga82b5fb" class="outline-4">
-<h4 id="orga82b5fb"><span class="section-number-4">1.3.4</span> Normal Shutdown</h4>
+<div id="outline-container-orged87647" class="outline-4">
+<h4 id="orged87647"><span class="section-number-4">1.3.4</span> Normal Shutdown</h4>
<div class="outline-text-4" id="text-1-3-4">
<p>
The system may be shutdown via SSH by running:
</div>
</div>
-<div id="outline-container-org5305842" class="outline-4">
-<h4 id="org5305842"><span class="section-number-4">1.3.5</span> Unscheduled Shutdown</h4>
+<div id="outline-container-org5d4c9cd" class="outline-4">
+<h4 id="org5d4c9cd"><span class="section-number-4">1.3.5</span> Unscheduled Shutdown</h4>
<div class="outline-text-4" id="text-1-3-5">
<p>
Ninfacyzga-01 as described and setup should tolerate unscheduled power
</p>
</div>
</div>
-<div id="outline-container-org4a5c4af" class="outline-4">
-<h4 id="org4a5c4af"><span class="section-number-4">1.3.6</span> End of Life Disposal</h4>
+<div id="outline-container-org00f1b85" class="outline-4">
+<h4 id="org00f1b85"><span class="section-number-4">1.3.6</span> End of Life Disposal</h4>
<div class="outline-text-4" id="text-1-3-6">
<p>
LiPo batteries used by the PiZ Uptime 2.0 module should be disposed of
</div>
</div>
<div id="postamble" class="status">
-<p class="date">Date: 2020-06-29T22:16Z</p>
<p class="author">Author: Steven Baltakatei Sandoval</p>
-<p class="date">Created: 2020-06-29 Mon 22:27</p>
+<p class="date">Created: 2020-06-30 Tue 17:14</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>