From f75812383a9e2f6e6c2503303fe135dc1f8c6504 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:15:24 -0500 Subject: [PATCH 01/10] Move "sudo -i" outside of the sub-windows --- README.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 734e033..aecdc1a 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,15 @@ Follow the instructions corresponding to the OS you used to flash the OS onto th Whichever instructions you followed above will leave you in a command shell on the Pi. Use this shell for the rest of the steps in these instructions. +### Become root on the Pi + +First you need to get into a root shell on the Pi: +``` +sudo -i +``` + +You'll stay in this root shell until you run the "halt" command in the "Set up USB storage functionality" below. + ### Set up the archive for dashcam clips Follow the instructions corresponding to the technology you'd like to use to host the archive for your dashcam clips. You must choose just one of these technologies; don't follow more than one of these sets of instructions: * Windows file share, MacOS Sharing, or Samba on Linux: [Instructions](doc/SetupShare.md). @@ -125,4 +134,4 @@ Then make whatever changes you need to. The next time the system boots the parti ## Meta This repo contains steps and scripts originally from [this thread on Reddit]( https://www.reddit.com/r/teslamotors/comments/9m9gyk/build_a_smart_usb_drive_for_your_tesla_dash_cam/) -Many people in that thread suggested that the scripts be hosted on Github but the author didn't seem interested in making that happen. I've hosted the scripts here with his/her permission. \ No newline at end of file +Many people in that thread suggested that the scripts be hosted on Github but the author didn't seem interested in making that happen. I've hosted the scripts here with his/her permission. From 173f46d7f7872fb31846e39bc0aafc3c11a14697 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:16:00 -0500 Subject: [PATCH 02/10] Update SetupShare.md --- doc/SetupShare.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/SetupShare.md b/doc/SetupShare.md index f09c9f2..07c9259 100644 --- a/doc/SetupShare.md +++ b/doc/SetupShare.md @@ -22,7 +22,6 @@ Now, on the Pi: 1. Run these commands, subsituting your values: ``` - sudo -i export ARCHIVE_SYSTEM="cifs" export archiveserver="Nautilus" export sharename="SailfishCam" @@ -30,4 +29,4 @@ Now, on the Pi: export sharepassword="pa$$w0rd" ``` -Now return to the section "Set up the USB storage functionality" in the [main instructions](/README.md). \ No newline at end of file +Now return to the section "Set up the USB storage functionality" in the [main instructions](/README.md). From 96352abe51f59184cd7691c36a45d2156037f327 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:16:58 -0500 Subject: [PATCH 03/10] Update SetupRSync.md --- doc/SetupRSync.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/doc/SetupRSync.md b/doc/SetupRSync.md index 48e50f4..89c91a0 100644 --- a/doc/SetupRSync.md +++ b/doc/SetupRSync.md @@ -14,7 +14,6 @@ Similar to sftp, rsync by default uses ssh to connect to a remote server and tra 1. Run these commands to to generate an ssh key for the `root` user: ``` - sudo -i ssh-keygen ``` @@ -48,4 +47,4 @@ export RSYNC_USER=pi export RSYNC_SERVER=192.168.1.254 export RSYNC_PATH=/mnt/PIHDD/TeslaCam/ ``` -Now return to the section "Set up the USB storage functionality" in the [main instructions](../README.md). \ No newline at end of file +Now return to the section "Set up the USB storage functionality" in the [main instructions](../README.md). From f30e96d0d36df34baf9c587f76cb87436d44af21 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:18:26 -0500 Subject: [PATCH 04/10] Update SetupRSync.md --- doc/SetupRSync.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/SetupRSync.md b/doc/SetupRSync.md index 89c91a0..c959649 100644 --- a/doc/SetupRSync.md +++ b/doc/SetupRSync.md @@ -47,4 +47,4 @@ export RSYNC_USER=pi export RSYNC_SERVER=192.168.1.254 export RSYNC_PATH=/mnt/PIHDD/TeslaCam/ ``` -Now return to the section "Set up the USB storage functionality" in the [main instructions](../README.md). +Stay in the `sudo -i` session return to the section "Set up the USB storage functionality" in the [main instructions](../README.md). From d03b4ae65bc16c5ae7d869d2967d0d57d2641654 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:20:21 -0500 Subject: [PATCH 05/10] Update SetupRClone.md --- doc/SetupRClone.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/doc/SetupRClone.md b/doc/SetupRClone.md index fa81d35..65a66c9 100644 --- a/doc/SetupRClone.md +++ b/doc/SetupRClone.md @@ -13,7 +13,6 @@ These instructions will speed you through the process with good defaults. If you 1. Run these commands. Specify the config name `gdrive` when prompted for the config name. ``` - sudo -i curl -L https://raw.github.com/pageauc/rclone4pi/master/rclone-install.sh | bash rclone config ``` @@ -26,14 +25,10 @@ These instructions will speed you through the process with good defaults. If you rclone mkdir "$RCLONE_DRIVE:$RCLONE_PATH" rclone lsd "$RCLONE_DRIVE": ``` -1. If you didn't encounter any error messages and you see the `TeslaCam` directory listed return to the [Main Instructions](../README.md). +1. If you didn't encounter any error messages and you see the `TeslaCam` directory listed, stay in your `sudo -i session` and return to the [Main Instructions](../README.md). # Detailed instructions ## Step 1: Install rclone4pi -1. Run this command to enter a command shell for the root user. - ``` - sudo -i - ``` 2. Run the following command to install rclone4pi: ``` curl -L https://raw.github.com/pageauc/rclone4pi/master/rclone-install.sh | bash @@ -88,4 +83,4 @@ Run this command to cause the setup processes which you'll resume in the main in ``` export ARCHIVE_SYSTEM=rclone ``` -Now return to the section "Set up the USB storage functionality" in the [main instructions](../README.md). +Now stay in your `sudo -i` session and return to the section "Set up the USB storage functionality" in the [main instructions](../README.md). From a4a5d10a5474e427ae6314f4e35e6df979d42c77 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:21:47 -0500 Subject: [PATCH 06/10] Update SetupRClone.md --- doc/SetupRClone.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/doc/SetupRClone.md b/doc/SetupRClone.md index 65a66c9..be1a275 100644 --- a/doc/SetupRClone.md +++ b/doc/SetupRClone.md @@ -9,8 +9,12 @@ You must perform these steps **after** getting a shell on the Pi and **before** * These commands define environment variables that the main setup scripts need. # Quick guide -These instructions will speed you through the process with good defaults. If you encounter an error, or you want to use a different config name than `gdrive` or a different folder name than `TeslaCam`, follow the detailed instuctions, below. +These instructions will speed you through the process with good defaults. If you encounter an error, or you want to use a different config name than `gdrive` or a different folder name than `TeslaCam`, follow the detailed instuctions, below. +1. Enter the root session if you haven't already + ``` + sudo -i + ``` 1. Run these commands. Specify the config name `gdrive` when prompted for the config name. ``` curl -L https://raw.github.com/pageauc/rclone4pi/master/rclone-install.sh | bash @@ -25,7 +29,7 @@ These instructions will speed you through the process with good defaults. If you rclone mkdir "$RCLONE_DRIVE:$RCLONE_PATH" rclone lsd "$RCLONE_DRIVE": ``` -1. If you didn't encounter any error messages and you see the `TeslaCam` directory listed, stay in your `sudo -i session` and return to the [Main Instructions](../README.md). +1. If you didn't encounter any error messages and you see the `TeslaCam` directory listed, stay in your `sudo -i` session and return to the [Main Instructions](../README.md). # Detailed instructions ## Step 1: Install rclone4pi From c3a0e53ea07d981393a8c7f62a0f1cb5795217e2 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:22:13 -0500 Subject: [PATCH 07/10] Update SetupRClone.md --- doc/SetupRClone.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/SetupRClone.md b/doc/SetupRClone.md index be1a275..22d6a8a 100644 --- a/doc/SetupRClone.md +++ b/doc/SetupRClone.md @@ -11,7 +11,7 @@ You must perform these steps **after** getting a shell on the Pi and **before** # Quick guide These instructions will speed you through the process with good defaults. If you encounter an error, or you want to use a different config name than `gdrive` or a different folder name than `TeslaCam`, follow the detailed instuctions, below. -1. Enter the root session if you haven't already +1. Enter the root session if you haven't already: ``` sudo -i ``` From 9fc310b5da7bd6c2eca2609afc1a013d342f42c7 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:23:02 -0500 Subject: [PATCH 08/10] Update SetupShare.md --- doc/SetupShare.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/SetupShare.md b/doc/SetupShare.md index 07c9259..0b41382 100644 --- a/doc/SetupShare.md +++ b/doc/SetupShare.md @@ -4,6 +4,10 @@ Set up a share to host the archive on a computer on your home network. These ins It is recommended that you create a new user. Grant the user you'll be using read/write access to the share. These instructions will assume that the user you've created is named "sailfish" and that the password for this user is "pa$$w0rd". Now, on the Pi: +1. Enter the root session (if you haven't already): + ``` + sudo -i + ``` 1. Try to ping your archive server from the Pi. In this example the server is named `nautilus`. ``` ping -c 3 nautilus @@ -29,4 +33,4 @@ Now, on the Pi: export sharepassword="pa$$w0rd" ``` -Now return to the section "Set up the USB storage functionality" in the [main instructions](/README.md). +Now stay in your `sudo -i` session and return to the section "Set up the USB storage functionality" in the [main instructions](/README.md). From 9d7d3c32787d9ffcd3bfc26059e615964cab0ce9 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:24:11 -0500 Subject: [PATCH 09/10] Update SetupRSync.md --- doc/SetupRSync.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/doc/SetupRSync.md b/doc/SetupRSync.md index c959649..7e78bc0 100644 --- a/doc/SetupRSync.md +++ b/doc/SetupRSync.md @@ -12,6 +12,11 @@ This guide makes the following assumptions: # Step 1: Authentication Similar to sftp, rsync by default uses ssh to connect to a remote server and transfer files. This guide will use a generated ssh keypair, hence the first assumption above. +1. Enter the root session (if you haven't already): + ``` + sudo -i + ``` + 1. Run these commands to to generate an ssh key for the `root` user: ``` ssh-keygen From c18772017be37d1a04680ddc081a9b6e91a81614 Mon Sep 17 00:00:00 2001 From: Alan Hoyle Date: Tue, 6 Nov 2018 19:27:16 -0500 Subject: [PATCH 10/10] Update SetupRClone.md --- doc/SetupRClone.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/SetupRClone.md b/doc/SetupRClone.md index 22d6a8a..5e48aae 100644 --- a/doc/SetupRClone.md +++ b/doc/SetupRClone.md @@ -33,6 +33,10 @@ These instructions will speed you through the process with good defaults. If you # Detailed instructions ## Step 1: Install rclone4pi +1. Enter a root session on your Pi (if you haven't already): + ``` + sudo -i + ``` 2. Run the following command to install rclone4pi: ``` curl -L https://raw.github.com/pageauc/rclone4pi/master/rclone-install.sh | bash