From 45cc34de3b3a61f14e27e001f19fcbeaadbe64a6 Mon Sep 17 00:00:00 2001 From: Satu Koskinen Date: Sun, 2 Oct 2022 15:24:26 +0300 Subject: [PATCH] Add configuration files, update README, first draft of setup documentation, add todo.md --- README.md | 17 +++++-- configuration/hydrophonitor-config.txt | 13 ++++++ configuration/ssh.txt | 0 configuration/userconf.txt | 1 + configuration/wpa_supplicant.conf | 13 ++++++ setup.md | 64 ++++++++++++++++++-------- todo.md | 23 +++++++++ 7 files changed, 110 insertions(+), 21 deletions(-) create mode 100644 configuration/hydrophonitor-config.txt create mode 100644 configuration/ssh.txt create mode 100644 configuration/userconf.txt create mode 100644 configuration/wpa_supplicant.conf create mode 100644 todo.md diff --git a/README.md b/README.md index 9346be2..5d8140c 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,17 @@ depth-logger | Record depth of the device and save it in `.csv` format. ## Data Formats -Type | Format ------|- -GPS Data | \ No newline at end of file +Type | Output file format | Output file name | Output structure | Content +------------|--------------------|--------------------------------------|------------------| +Audio Data | .wav | _audio.wav | Each recorded chunk will be written to its own file in `audio` folder | Wav audio data, configuration defined in XXX +GPS Data | .csv | _gps.wav | All data written to a single file | Csv data with following fields: GPS time UTC, latitude, longitude, speed, satellites in view +Depth data | .csv | _depth.wav | All data written to a single file | Csv data with following fields: date and time, voltage of depth sensor (V), depth (m) +Log data | .txt | _log.txt | All data written to a single file | Text file where each entry contains the following: date and time, process that writes the entry, logged information + +## Output Locations + +The base location/path for the output directories is defined by a configurable value BASE_DIR_PATH. If directories along this path do not exist, they will be created. If an error occurs or the location is not writable, output will be written to the default location () instead. + + + +A recording session starts when the Raspberry Pi is turned on or booted, and ends on shutdown. Each session will have its output written in its own directory that will be named _recordings. \ No newline at end of file diff --git a/configuration/hydrophonitor-config.txt b/configuration/hydrophonitor-config.txt new file mode 100644 index 0000000..1dc69fd --- /dev/null +++ b/configuration/hydrophonitor-config.txt @@ -0,0 +1,13 @@ +# Audio + +SAMPLE_RATE=44100 +CHANNELS=2 +BITRATE=192k +BATCH_RECORD_LENGTH=60 + +# Output location + +TRY_MOUNT_SSD=true + +DEFAULT_BASE_DIR_PATH=/home/pi/recordings +BASE_DIR_PATH=/home/pi/data diff --git a/configuration/ssh.txt b/configuration/ssh.txt new file mode 100644 index 0000000..e69de29 diff --git a/configuration/userconf.txt b/configuration/userconf.txt new file mode 100644 index 0000000..19ef386 --- /dev/null +++ b/configuration/userconf.txt @@ -0,0 +1 @@ +: \ No newline at end of file diff --git a/configuration/wpa_supplicant.conf b/configuration/wpa_supplicant.conf new file mode 100644 index 0000000..11648d1 --- /dev/null +++ b/configuration/wpa_supplicant.conf @@ -0,0 +1,13 @@ +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev +update_config=1 +country= + +network={ + scan_ssid=1 + ssid="" + psk="" + proto=RSN + key_mgmt=WPA-PSK + pairwise=CCMP + auth_alg=OPEN +} \ No newline at end of file diff --git a/setup.md b/setup.md index 5e38c38..bd3c24a 100755 --- a/setup.md +++ b/setup.md @@ -2,31 +2,59 @@ ## Components +- Raspberry Pi (tested on 2, 4B) +- MicroSD card + adapter +- card reader to access the sd card on the computer ## Raspberry OS basic setup -### 1. OS +### 1. Install the operating system and set up user, Wi-Fi, ssh access + +#### With Raspberry Pi Imager + +The easiest way to install the operating system (Raspberry Pi OS, a Linux Debian-based OS) is to use the official Raspberry Pi Imager utility which works on macOS, Ubuntu and Windows. + +Install from here: https://www.raspberrypi.com/software/ + +After installing, plug the SD card to the computer and launch Raspberry Pi Imager. + +Then the following steps: + +1. Select operating system: click Raspberry Pi OS (other) and then, depending on the Pi, either a 32-bit or 64-bit Raspberry Pi OS Lite +2. Select storage: the sd card should be listed +3. Click the cog icon to set some configurations: + - Enable SSH (use password authentication) + - Set username and password + - Configure wireless LAN: input the name and password of the wi-fi network, select Wireless LAN country + - Set locale settings: select options correct for you +4. Click Write (all existing data on the SD card will be erased and the OS installed) + +#### With some other utility + +If you do not use the Raspberry Pi Imager to set up the SD card, the following steps are required: + +1. Download the 32-bit / 64-bit Rasbperry Pi OS Lite from here: https://www.raspberrypi.com/software/operating-systems/ +2. Flash the image to the SD card with the utility of your choice (options for Mac, Linux, Windows?) +3. Fill in required details in the configuration files in configuration folder and copy them to the boot folder on the SD card (this is the folder that should open when you open the SD card volume on your computer): + - ssh.txt: this enables ssh on the Raspberry Pi, no need to edit the file (it's empty, the existence of the file in the boot folder is enough) + - userconf.txt: creates a user + - replace with the username of choice (e.g. pi) + - replace with an encrypted version of your password which can be created with the openssl command line tool: + - open Terminal, write `openssl passwd` and press Enter + - input your password and press enter (asked twice) + - as output, you will get the encrypted version of the password + - wpa_supplicant.conf: set up Wi-Fi + - replace with your country code (e.g. FI) + - replace "" with the name of your Wi-Fi network, e.g. "explorersden" + - replace "" with the Wi-Fi password, e.g. "password" + + +### 2. Installing needed packages -### 2. Users - - - -### 3. Wifi - - - -### 4. SSH access - - - -### 5. Installing needed packages - - - -## SSD +### 3. Mount SSD diff --git a/todo.md b/todo.md new file mode 100644 index 0000000..182c6d1 --- /dev/null +++ b/todo.md @@ -0,0 +1,23 @@ +# To do list + +- [ ] Configurable, documented setup process for the Raspberry Pi + - [ ] Setup script + - [ ] Copy executables & scripts + - [ ] Required packages to install + - [ ] System configurations + - [ ] Configurable values + - [ ] Test +- [ ] Output formats & location for output data + - [ ] Automatic SSD mounting +- [ ] Audio recording + - [ ] Logging + - [ ] Test +- [ ] GPS recording + - [ ] Logging + - [ ] Test +- [ ] Depth recording + - [ ] Double check formulas to calculate depth & pressure from voltage + - [ ] Logging + - [ ] Test +- [ ] Test autonomous recording as a whole +