Some time ago, I had a fun idea for a quadcopter drone that would serve as a test bed for me to play around with various artificial intelligence concepts. At a minimum, I wanted this drone to be able to safely and autonomously navigate around the house, learn and remember specific faces without being trained on images of those faces, and converse with people.
I originally considered using Tensorflow Lite on a Raspberry Pi, but I was concerned that choice would impact the accuracy of my drone’s facial recognition and speech processing. After researching other single-board computer options, I decided to use NVIDIA’s Jetson Nano. The Nano has a much more powerful GPU than the Pi. More importantly, the Nano’s GPU is CUDA-compatible, which makes it much easier to enable hardware acceleration on popular machine learning frameworks like Tensorflow and PyTorch. It’s worth noting that NIVIDA offers a number of other developer kits in its Jetson product line with much better specs. Since this thing is ideally going to be flying itself around in an experimental drone and accidents happen, I decided to start with the entry-level option.
In this tutorial, we’ll walk through the process for initializing a Jetson Nano and configuring it for remote wireless access. NVIDIA’s documentation for this is fairly comprehensive, but this tutorial covers some additional pitfalls you may encounter. While this guide was written specifically for the 2GB model, most of it should be applicable to the 4GB model as well.
Prepare the MicroSD Card
The Jetson Nano uses a microSD card for both initialization and storage. NVIDIA provides a custom Linux disk image that is preloaded with software that makes it easy to begin running GPU-accelerated deep learning workloads. Other alternatives exist if you’d prefer a specific distro, but we’ll cover setup using the official image.
Once you’ve downloaded the appropriate disk image, you can use software such as Balena Etcher to flash the image to your microSD card.
Initial Setup
Once your SD card is ready, begin to follow the instructions from NVIDIA’s setup guide.
You may encounter some issues with the installation wizard. Specifically, the setup UI may disappear after the step where you choose to enable a swap file. If this happens, restart the device and choose not to enable a swap file.
After the setup completes and you’ve logged in, you can enable the swap file if it wasn’t already created:
- Check for the swap file by running
ls -lah /swapfile
(if no entries are returned, swap is not enabled) - If the swap file is not enabled, enable it using these instructions:
sudo fallocate -l 4G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo "/swapfile swap swap defaults 0 0" | sudo tee /etc/fstab
Configure SSH Access Over Wi-Fi
At this point, your Jetson Nano should be ready to use, but it’s unlikely that your intended use case involves keeping it tethered to a mouse, keyboard, and display. You’ll probably find it much more convenient to access your Nano via Wi-Fi using a static IP address.
NVIDIA’s Linux image has some network configuration customizations which override the usual /etc/network/interfaces
config, so it’s best to configure the static IP using the UI:
- Right click the network icon and click “Edit Connections…” at the bottom of the context menu
- Double click your Wi-Fi network
- Click the “IPv4 Settings” tab
- Select “Manual” from the “Method” dropdown
- Add your static IP and gateway information and click “Save”
- Restart the device
Once your IP address is configured, the next step is to configure remote access via SSH. The openssh-server package should already be installed, but if not, it can be installed with sudo apt-get install openssh-server
.
At this point, you should be able to SSH into your Nano using the username/password combo you set during installation. If you would instead like to authenticate using your SSH key pair, you’ll need to add your public key to the authorized keys list:
mkdir -p ~/.ssh
echo "YOUR-PUBLIC-KEY" >> ~/.ssh/authorized_keys
Remote GUI Access
If you prefer to interact with your Nano using a GUI, I’d recommend configuring remote desktop access using xrdp.
If you’d like to run individual GUI applications, enable X11 forwarding using PuTTY or ssh -X
. In addition to the client side configuration, you’ll need to add X11Forwarding yes
to your Nano’s /etc/ssh/sshd_config
file.