2. Jetson Nano Linux Setup - arieldo/MorBot GitHub Wiki

This page details the software setup required to run JetBot.

Table of Contents

  1. Mount operating system image
  2. Booting the jetson
  3. Connect JetBot to WiFi and Login
  4. Connect to JetBot from VS Code
  5. Configure the environment

Step 1 - Mount operating system image

Method 1: Use pre-built JetBot SD card image

You can utilize the pre-built JetBot SD card image that is included with the kit.

It's already flashed and should be ready to use.

If you encounter any problems, please resort to method 2.

Method 2: Use the Pre-configured Image

Flash JetBot image onto SD card :

  1. Download the expandable JetBot SD card image jetbot-043_nano-4gb-jp45.zip

    The above image is based on JetPack 4.5.

  2. Insert an SD card into your desktop machine

  3. Using Etcher, select the jetbot-043_nano-4gb-jp45.zip image and flash it onto the SD card

  4. Remove the SD card from your desktop machine

Step 2 - Boot Jetson Nano

  1. Insert the SD card into your Jetson Nano (the micro SD card slot is located under the module)

  2. Connect the monitor, keyboard, and mouse to the Nano

  3. Power on the Jetson Nano by connecting the power cable to the robot and switch to ON

By default, managing resource usage in Ubuntu is limited to the command-line interface (CLI).

To enhance our understanding of the Ubuntu environment, we will enable the classic Windows-like interface.

If necessary, we can revert to the original settings later.

  • Log in using the user jetbot and password jetbot
  1. Enable Graphical Desktop
  • Log in using the user jetbot and password jetbot
    sudo systemctl set-default graphical.target
  1. Reboot the Jetson Nano
    sudo reboot

Step 3 - Connect JetBot to WiFi

  1. Log in using the user jetbot and password jetbot

  2. Connect to a WiFi network using the Ubuntu desktop GUI

Your Jetson Nano should now automatically connect to the WiFi at boot and display it's IP address on the piOLED display.

3.1 - prepare for first connection:

  1. Shutdown JetBot using the Ubuntu GUI
  2. Unplug your HDMI monitor, USB keyboard, mouse and power supply from Jetson Nano
  3. Power the JetBot from the battery pack
  4. Wait a bit for JetBot to boot
  5. Check the IP address of your robot on the piOLED display screen.
  • If the IP address appeared on the screen , Congratulations you are ready to connect to the robot remotely !!!

Step 4 - Connect to JetBot remotely from VS Code

After your robot is connected to WiFi, you can easily connect to the robot from VS code remotely witout monitor, USB keyboard or mouse .

Connecting a robot via SSH (Secure Shell) using Visual Studio Code (VS Code) is a seamless and enjoyable experience. This process enables you to interact with and control robots remotely, adding a new layer of excitement to robotics programming.

  • Follow the wiki to install Visual Studio Code (VS Code) and SSH (Secure Shell)

Setp 5 - Configure the environment on the robot:

Important! Setp 5 will use some Linux Command Line Interface (CLI) commands . So make sure you have basic knowledge of linux , IF not Check out linux Tutorial wiki to get started!

Short Linux recap

  • sudo - a command in Unix-based systems that allows a permitted user to execute a command as the superuser (root) or another user, as specified by the security policy. It stands for "superuser do" and is used to temporarily elevate privileges for specific tasks, providing better security and access control.

  • apt-get - a command-line tool that lets you install, update, and remove software on your system. It's a fast way to install software. You can install software from the standard Ubuntu software repositories using the apt-get command.

  • apt-get update - a command that downloads and installs the latest packages from the software repository, and updates the package list to latest versions.

  • apt-get install - a command that installs a new package from the software repository.

  • chmod - a command in Unix-based systems that allows a user to change the permissions of a file or a directory.

  • cd - change to a different directory.

  • ls - a command to list computer files

  • setup.py - a file that tells Python distutils how to install your module into the Python package library. It is a Python script that uses the distutils module to interact with the Python package library.

git staff

Git is a widely used version control system that helps people track changes in files, especially when working on code. It is particularly useful when multiple people collaborate on projects, as it allows them to work on the same files without overwriting each other's changes.

A Git repository, or "repo" for short, is a digital storage space where the project files and their entire history of changes are stored. A repo can be hosted on a remote server (e.g., GitHub, GitLab, or Bitbucket), allowing multiple people to access and collaborate on the project. Each collaborator can also have a local copy of the repo on their computer to work offline.

In simple terms, Git is a tool that helps people manage and collaborate on projects by keeping track of changes in files. A Git repo is a place where the project files and their history are stored, allowing multiple people to work together efficiently.

some common git commands:
  • git clone - a Git command line utility that is used to target an existing repository and create a clone, or copy of the target repository.

  • git pull - a Git command used to update the local version of a repository from a remote. It is a combination of git fetch and git merge, which means that it fetches the remote updates and then merges them into your local branch.

  • git push - a Git command used to upload local repository content to a remote repository. Pushing is how you transfer commits from your local repository to a remote repo.

If you haven't already, connect to your robot.

Pull MorBot git repository and install requirements:

  1. Launch a new terminal
    sudo apt-get update
    sudo apt-get install git

    git clone https://github.com/arieldo/MorBot.git
    cd ~/MorBot
    git pull
  1. Install MorBot system Dependencies:.

This script performs several operations to set up a specific development environment on Ubuntu 18.04 with Python 3.6.

System Package Installation: The script installs several system packages, including "ssh", "curl", "libffi-dev", "python3-dev", "nano", and "v4l-utils". It installs each package one at a time.

The script also installs several Python packages, including "pip", "cffi", "ipywidgets", and "torchvision". It installs each package using pip for Python 3.6, and after each installation, it checks and prints the installed package version.

  • Make the script executable by running
    cd ~/MorBot
    chmod +x system_startup.sh
  • Install by running
    ./system_startup.sh
  1. Additional Configure to Expanding the Jetbot Image

This method is for expanding the file system on an SD card or U disk when the actual storage space exceeds the allocated space. This can occur if the image file, based on a 32GB SD card configuration, is programmed into a larger storage device. To expand the file system to use all available space, open a terminal and enter the provided expansion command.

    cd /usr/lib/nvidia/resizefs/
    sudo chmod 777 nvresizefs.sh
    sudo ./nvresizefs.sh
  1. Install JetBot Robot Dependencies:
    cd ~/MorBot/jetbot
    sudo python3 setup.py install 
  1. Install some more Dependencies:
   python3.6 -m pip install pip
   python3.6 -m pip install cffi
   python3.6 -m pip install ipywidgets 
   python3.6 -m pip install torchvision
   sudo reboot

Next:

  • To get familiar with the robot Basic Motion and code try the prebuild NVIDIA jetbot notebooks-demos

  • Or start developing your dream project with ROS , Follow To Install ROS

⚠️ **GitHub.com Fallback** ⚠️