SSH Installation

From FrogPilot Wiki
Jump to navigation Jump to search

SSH Setup

There are two options to follow:

  1. Openpilot Toolkit
  2. A more manual approach

Option 1: Openpilot Toolkit

This is an amazing tool to use if you have Windows or Android. According to the website:

Windows app:

  • Drive video preview and raw export of all cameras (video preview is first segment only for now)
  • SSH wizard to generate and install SSH keys
  • Remote control for common functions
  • Fork installer
  • Fingerprint V2 viewer
  • SSH file explorer (view/edit/delete and upload files)
  • SSH terminal with terminal emulation

Android app:

  • SSH wizard to generate and install SSH keys
  • Fork installer

Option 2: Manual Approach

There is a great write-up on the Comma GitHub wiki that goes into great detail. Below is a shortened version of the GitHub wiki steps:

Before You Start

  1. You need a GitHub account. Make one if you don't already have one.
  2. Enable SSH on your comma device: 'Settings -> Network -> Advanced -> Enable SSH'.

Pre-installed OpenSSH Client on Windows 10+ and macOS

Both Windows 10 and newer, and macOS come with a pre-installed SSH client, so no additional software download or installation is required.

Step 1: Open Terminal or PowerShell

  • Windows: Open PowerShell by pressing the Start Menu and typing "PowerShell". Command Prompt is not a substitute.
  • macOS: Open Terminal by opening Spotlight in the top-right corner and typing "Terminal".

Step 2: Create and Upload SSH Key to GitHub

If you haven't already created an SSH key and uploaded it to GitHub, follow these steps:

1. Generate an SSH key:

ssh-keygen -t ed25519 -f $HOME/.ssh/id_ed25519

When prompted to "Enter passphrase (empty for no passphrase):", just press Enter for no passphrase.

2. Copy the public key to your clipboard:

  • Windows:
Get-Content $HOME\.ssh\id_ed25519.pub | Set-Clipboard
  • macOS:
cat $HOME/.ssh/id_ed25519.pub | pbcopy

3. Add the SSH key to GitHub:

Visit GitHub SSH settings, paste the contents of your clipboard into "Key", give it a name of your choice in "Title", and press Add SSH Key.

Step 3: Verify SSH Key with GitHub

Run the following command to check if GitHub can identify you with the private key on your local system:

ssh -T [email protected]

You should get a message saying: "Hi \<your GitHub username\>! You've successfully authenticated, but GitHub does not provide shell access."

Step 4: Get the IP Address of Your Device

Make sure your C3 and your connecting device are connected to the same WiFi or network: 'Settings [⚙️ icon] > Network > Advanced'.

Step 5: Add SSH Key to Your Device

  1. Go to `Settings [⚙️ icon] > Network [ > Advanced, if C3] > SSH Keys` and press Add.
  2. Enter your GitHub username and press "⏎". You should see the SSH Keys option change to include your GitHub username with the Add button changed to Remove.
    • If a GitHub username is already there, press Remove to make Add reappear.
    • If you change or add new SSH keys on GitHub, repeat this step to refresh the authorized SSH keys data on the device.

Step 6: Enable SSH

Make sure `Settings [⚙️ icon] > Network [ > Advanced, if C3] > Enable SSH` is enabled. It should be green.

Step 7: Connect via SSH

Run the following command, replacing `555.555.555.555` with the IP address you discovered earlier:

ssh [email protected]

You should see a blue-ish prompt with "/data/openpilot", confirming you are connected.

If you get an "authenticity of host cannot be determined" message, answer `yes`.

Installing a Fork via SSH

Below is a command you can paste into your terminal that'll download and install the FrogPilot release branch. You can replace the branch name with any branch for any fork, as long as you also change the fork URL.

cd /data; rm -rf ./openpilot; git clone -b FrogPilot https://github.com/FrogAi/FrogPilot.git openpilot; sudo reboot

So if you wanted to install default OpenPilot again it would be:

cd /data; rm -rf ./openpilot; git clone -b release3 https://github.com/commaai/openpilot.git openpilot; sudo reboot

Sometimes, depending on the fork, you'll need to put "--recurse-submodules" before the URL like this:

cd /data; rm -rf ./openpilot; git clone -b FrogPilot --recurse-submodules https://github.com/FrogAi/FrogPilot.git openpilot; sudo reboot