Skip to content

Latest commit

 

History

History
114 lines (63 loc) · 3.18 KB

COMMON.md

File metadata and controls

114 lines (63 loc) · 3.18 KB

Common Instructions

Naming Convention

All device attributes should be saved to the Devices Google sheet.

  • Set WiFi Network SSID to sports-replay-wifi-X, where X is the next available Sports Replay WiFi router number in client's building
  • Set Jetson Nano host name to sports-replay-ai-X where X is next available Jetson Nano machine ID.
  • Set Raspbery Pi host name to sports-replay-pi-X where X is next available Pi machine ID.
  • Create unique complex password using password generator. Note that only "Include Lowercase Characters" and "Exclude Similar Characters" should be selected. Also make sure to put the dot at the end of the password, as Raspberry requires at least one special character.

Setting up The Tunneling

Login as "root" User

sudo su

Create The Public Key

ssh-keygen -o

Make sure to press ENTER 3 times.
Do not provide any passphrase, otherwise you won't be getting passwordless login.

Remote Computer - Copying The Public Key

ssh-copy-id -i ~/.ssh/id_rsa.pub root@IP_ADDRESS_OF_YOUR_SERVER

You will need to provide root password for VPS.

Install "autossh"

sudo apt install autossh

Creating The Tunneling Service

Raspberry Pi

sudo nano /etc/systemd/system/autossh-tunnel.service

Jetson

sudo vi /etc/systemd/system/autossh-tunnel.service

Paste the following content in it (replace XXXX with the next available VPS port dedicated to tunneling).

[Unit]
Description=AutoSSH tunnel service on port 22
After=network.target

[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -nN -R XXXX:localhost:22 root@IP_ADDRESS_OF_YOUR_SERVER

[Install]
WantedBy=multi-user.target

Starting The Tunneling Service

sudo systemctl start autossh-tunnel.service

Enabling The Tunneling Service to Run on Startup

sudo systemctl enable autossh-tunnel.service

Reboot

sudo reboot

Testing on VPS If The Port Is Opened

Open a separate terminal and use the following commands.

ssh root@IP_ADDRESS_OF_YOUR_SERVER

netstat -tulpn | grep LISTEN

Connecting to The Remote Computer from Any Computer

For Jetson (replace XXXX with previously assigned VPS port.)

ssh sportsreplay@IP_ADDRESS_OF_YOUR_SERVER -p XXXX

For Raspberry Pi (replace XXXX with previously assigned VPS port.)

ssh pi@IP_ADDRESS_OF_YOUR_SERVER -p XXXX

Preventing SSH to Timeout

sudo vi /etc/ssh/sshd_config

Change the following values:

- ClientAliveInterval 120
- ClientAliveCountMax 720

Make sure you reboot the device now. Otherwise it will still use the same setting.

Disabling Linux GUI mode

sudo systemctl set-default multi-user.target

Make sure you reboot the device now. Otherwise GUI will still be on.

If you need to enable it again, run:

sudo systemctl set-default graphical.target

If you want to start gui, while it is currently disabled, run:

sudo systemctl start gdm3.service

Installing Memory Monitoring Utility

'sudo pip3 install jetson-stats'