Skip to content
Alex Pereira edited this page Mar 7, 2023 · 22 revisions

Setting up the Jetson Nano

Before setting up the Jetson, it is important to note that the Jetson Nano runs on a modified version of Ubuntu. As such, normal Ubuntu installation instructions cannot be used to set this system up.

Setup Materials

To set up the Jetson you will need:

  • A Windows or Linux Computer
  • A 64GB micro SD card
  • A micro SD card to USB adapter
  • A Micro-USB Power Supply capable of delivering 5 at least 5W of power, but 5 Volts @ 2 Amps is preferred
  • A Keyboard and Mouse
  • A Monitor

Setup Procedure

Before the Boot:

  1. Download balenaEtcher and follow the setup instructions
  2. Download the Xubuntu Jetson Nano Image
  3. Download 7-Zip
  4. Extract the .tbz2 file using 7-Zip to reveal the contained .tar file
  5. Extract the .tar file using 7-Zip to reveal the continued .img file
  6. Flash the .img file to the micro SD card using balenaEtcher
  7. Insert the micro SD card (with system image written to it) into the slot on the underside of the Jetson Nano's heat sink
  8. Connect the display, mouse, and keyboard to the Jetson
  9. Connect the Micro-USB power supply or DC power supply, which will power on the Jetson and boot it automatically
  10. A green LED next to the Micro-USB connector will light as soon as the Jetson powers on

System Setup

  1. Review and accept the Jetson EULA
  2. Select system language, keyboard layout, and time zone
  3. Create username, password, and computer name
  4. Use the maximum size allowed when setting the APP partition size

Upgrade to 22.04

  1. Open terminal emulator from the icon in the top left
  2. Run the following commands in order:

wget -O libffi6.deb http://ports.ubuntu.com/pool/main/libf/libffi/libffi6_3.2.1-8_arm64.deb && sudo apt install ./libffi6.deb

wget -O firefox.deb "https://launchpad.net/~ubuntu-mozilla-security/+archive/ubuntu/ppa/+build/25629165/+files/firefox_110.0.1+build2-0ubuntu0.18.04.1_arm64.deb"

sudo apt update && sudo apt upgrade -y && sudo apt autoremove -y

sudo reboot

sudo apt remove firefox -y

sudo update-manager -c -d

sudo reboot

    Notes:
    • While downloading Firefox it is possible that the download will fail because a new version was released. If this happens, visit this site, navigate to the bottom, copy the link of the most recent .deb file for arm64 Ubuntu 20.04, and replace the link being used.
    • During the update process several prompt will appear on the screen and most of them can be mindlessly clicked through.
    • However, when prompted about the system configuration opt to replace the old one and when prompted about Firefox acknowledge that the snap install failed

Reinstall Firefox

To make the execution of these commands easier, it is recommended that a web browser (specifically Firefox) be installed. To do this run the following commands in order:

  1. Purge the broken snap install of Firefox
sudo dpkg --remove --force-remove-reinstreq firefox firefox-locale-en snap && sudo dpkg --purge firefox

  1. Install an outdated version of firefox to make copying these commands easier
sudo apt install ./firefox.deb -y

  1. Add the Firefox repository to the sources list
sudo add-apt-repository ppa:mozillateam/ppa

  1. Set make the .deb priority higher than the snap priority
echo '
Package: *
Pin: release o=LP-PPA-mozillateam
Pin-Priority: 1001
' | sudo tee /etc/apt/preferences.d/mozilla-firefox

  1. Ensure that future updates install from the .deb file
echo 'Unattended-Upgrade::Allowed-Origins:: "LP-PPA-mozillateam:${distro_codename}";' | sudo tee /etc/apt/apt.conf.d/51unattended-upgrades-firefox

  1. Remove the outdated version and install the new one
sudo apt remove firefox -y && sudo apt install firefox -y

Install the Required Packages

  1. Open terminal emulator from the icon in the top left
  2. Run the following commands in order:
sudo apt install python3 python3-dev python3-pip python3-pil python3-smbus git git-lfs cmake ninja-build zip unzip gnome-shell-extension-manager gedit openssh-server -y

git config --global user.name "2199 Jetson {Number}" && git config --global user.email "robolionsgit@gmail.com"

pip install -U pip setuptools wheel

pip install -U transforms3d opencv-contrib-python pupil-apriltags

pip install -U --find-links https://tortall.net/~robotpy/wheels/2023/raspbian/ wpilib robotpy-hal robotpy-halsim-gui robotpy-installer robotpy-wpilib-utilities robotpy-wpimath robotpy-wpinet robotpy-wpiutil robotpy robotpy-cscore pyntcore pynetworktables

pip install -U frc-apriltags

    Notes:
    • When prompted to chose a display manager, select lightdm
    • For convenience, the robotpy install can be done with pip, but it will take a VERY long time to complete (up to four hours)

Install VSCode:

To install VSCode for for arm64, run the following commands:

wget -O vscode.deb "https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-arm64"

sudo apt install ./vscode.deb -y

    VSCode should now be available in the apps drawer and the Python extension can be easily installed from the extension menu. While inside VScode, it is strongly recomended to enable the autosave feature, letting it run afterDelay, and the git fetch feature, to true, from the settings menu (bottom left).

Clone the Git Repositories:

Run the following commands to clone the repositories and the wiki locally:

cd && cd Documents/

git clone https://github.com/PIE-Cubed/2023-Jetson-Code && git clone https://github.com/PIE-Cubed/2023-Jetson-Code 2023-Jetson-Code-Test

cd 2023-Jetson-Code-Test/ && git switch testing

Finished!

Congratulations! Your Jetson Nano should now be set up with a Xubuntu 22.04, Python 3.10.6, and all the required packages to run our custom April Tags detection.

Clean Up

If you wish to free up disk space, the following commands will remove the unneeded archives:

cd && sudo rm -rf *.zip *.deb