{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Connecting to the drone with VSCode\n",
"\n",
"1. Install VSCode onto your computer (not the drone), [here](https://code.visualstudio.com/Download)\n",
"\n",
"2. Open a terminal window on your computer and run:\n",
"```\n",
"cd ~/.ssh\n",
"ls\n",
"```\n",
"- If you do not see `id_rsa` and `id_rsa.pub`, enter this command:\n",
"```\n",
"ssh-keygen -t rsa -b 4096 -C \"your_email@example.com\"\n",
"```\n",
"*Do not enter a filepath, username, or password, just press `return` when asked for those fields*\n",
"\n",
"+ Enter `cat id_rsa.pub` and copy the whole ssh key that is printed to your terminal\n",
"\n",
"3. Open a terminal window that is SSH'd into your drone:\n",
"\n",
" ```\n",
" cd ~/.ssh\n",
" ls\n",
" vim authorized_keys\n",
" ```\n",
" + Navigate the bottom of the file, press `i` to enter `insert` mode, and paste your id_rsa.pub key. Then save and quit (press `esc`, then `:wq`)\n",
"
\n",
"\n",
"4. In your computer's terminal (in the ~/.ssh folder) type:\n",
"```\n",
"vim config\n",
"```\n",
"Add the following block (4 spaces, not tabs):\n",
"```\n",
"Host \n",
" User uav\n",
" HostName .beaver.works\n",
" ForwardX11 yes\n",
" IdentityFile ~/.ssh/id_rsa\n",
"```\n",
"\n",
"5. Try SSH'ing into the drone in a new terminal. You should be able to use simply `ssh `. You also should not have to enter the drone password anymore\n",
"\n",
"6. If this works, go to VSCode:\n",
" + Click the square icon in the sidebar under the debug icon\n",
" + Search for SSH and install the \"Remote-SSH\" plugin made by Microsoft\n",
" + Select the monitor icon that appears in the sidebar, then click the window icon that appears when you hovor over your teamname option under `Connections`"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.15+"
}
},
"nbformat": 4,
"nbformat_minor": 2
}