From 2af755c4fc0a3dc44df55aaa8817d6e6abce5c87 Mon Sep 17 00:00:00 2001 From: Satu Koskinen Date: Tue, 11 Oct 2022 09:16:24 +0300 Subject: [PATCH] Update setup.md --- setup.md | 91 +++++++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 71 insertions(+), 20 deletions(-) diff --git a/setup.md b/setup.md index bd3c24a..3267c0b 100755 --- a/setup.md +++ b/setup.md @@ -2,16 +2,22 @@ ## Components -- Raspberry Pi (tested on 2, 4B) +- Raspberry Pi (tested on 4B) - MicroSD card + adapter -- card reader to access the sd card on the computer +- Card reader to access the sd card on the computer +- Audio card connected via USB and a microphone/hydrophone attached to the audio card +- USB GPS receiver +- Depth recording components: + - Pressure sensor + - Adafruit ADS1015 ADC + - breadboard, resistors, jumper wires, 12V battery ## Raspberry OS basic setup ### 1. Install the operating system and set up user, Wi-Fi, ssh access -#### With Raspberry Pi Imager +#### 1.1 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. @@ -30,7 +36,7 @@ Then the following steps: - 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 +#### 1.2 With some other utility If you do not use the Raspberry Pi Imager to set up the SD card, the following steps are required: @@ -50,11 +56,70 @@ If you do not use the Raspberry Pi Imager to set up the SD card, the following s - replace "" with the Wi-Fi password, e.g. "password" -### 2. Installing needed packages +### 2. Setting up the recording programs on the Raspberry Pi + +After flashing the operating system to the SD card, it should show up as volume called "boot". + +To install all the needed components and to configure the Raspberry Pi to start the recordings when it is turned on, four steps are needed: copying the needed files to the SD card, putting the SD card in the Raspberry Pi and connecting to it on the command line over SSH, running an installer script on the command line, and finally letting it restart and verify that everything works as intended. + +#### 2.1 Copy files to the SD card + +Copy the entire `hydrophonitor` folder to the SD card (simple Ctrl+C and Ctrl+V works) + +#### 2.2 Plug the SD card in and connect to the Raspberry Pi over SSH + +Plug the SD card in the Raspberry Pi. Connect the audio card and the GPS receiver over USB to the Raspberry Pi, and plug the power cable. It will take some time for the Raspberry Pi to be ready to accept SSH connections. + +To figure out what IP address the Raspberry Pi has been assigned in the local network, a tool called `nmap` is needed. + +To check whether nmap is already installed on the system, open a terminal, run the following command (write it to the terminal and press Enter): + +``` +nmap --version +``` + +If this prints out version information about nmap (e.g. Nmap version 7.93 ( https://nmap.org)), it is installed. Otherwise, installation instructions can be found here: https://nmap.org/download.html + +After installing, run the following command (it will ask for password, write it and press Enter) to find all devices connected to the local network: + +``` +sudo nmap -sn 192.168.1.0/24 +``` + +The result will contain a series of discovered devices (hosts) with the following information for each device: + +``` +Nmap scan report for 192.168.1.108 +Host is up (0.18s latency). +MAC Address: E4:5F:01:B3:65:DE (Raspberry Pi Trading) +``` + +The Raspberry Pi should show up with its IP address (here, 192.168.1.108), MAC address and a name after the MAC address that should help identifying it (here, it's Raspberry Pi Trading). + +Now, this IP address can be used to connect to the Raspberry Pi over SSH on the command line. Connect by running the command `ssh @`, which with a user called `pi` and an IP address of 192.168.1.108 would be + +``` +ssh pi@192.168.1.108 +``` + +When asked `Are you sure you want to continue connecting (yes/no/[fingerprint])?`, type `yes` and press Enter. Then, write the user's password when asked and press Enter. + +After successfully connecting, your prompt should change to `@raspberrypi:~` or something similar. + +#### 2.3 Run the installer script + +After establishing the SSH connection to the Raspberry Pi, change the current directory to the location of the installer script and run it: + +``` +cd /boot/hydrophonitor/configuration +./setup-raspberry-pi.sh +``` -### 3. Mount SSD +### 3. Configuration options + +### 4. Mount SSD @@ -62,20 +127,6 @@ If you do not use the Raspberry Pi Imager to set up the SD card, the following s -## Set up recording - -### 1. Audio - - - -### 2. GPS - - - -### 3. Water pressure - - - ## Test & run