Quantcast
Channel: JetsonHacks
Viewing all articles
Browse latest Browse all 339

Jetson Nano – Headless Setup

$
0
0

Many people would like to set up their Jetson Nano without the need of attaching the Jetson to a monitor and keyboard (headless setup). With the advent of JetPack 4.2.1, this is now possible! Looky here:

Background

In earlier versions of JetPack, there was a requirement that the Jetson be connected to a monitor and keyboard (this is called ‘headed’ mode) to initially configure the Jetson the first time it boots. With the release of JetPack 4.2.1 it is possible to attach the Jetson through its default debugging port to a host computer’s tty device and enter this information through a serial application running on the host. In this case, the Jetson does not need a monitor or keyboard (this is called ‘headless’ mode).

The first time a Jetson Nano boots, a script allows the user to set their username and password, language, time zone, and so on. If the Jetson is attached to a monitor and keyboard, the user inputs the configuration from the Jetson keyboard.

In earlier versions of JetPack, this was the only way to configure the Jetson. With the advent of JetPack 4.2.1, it is now possible to do this configuration directly from a host computer without the need for the monitor and keyboard on the Jetson.

Many robotics and IoT applications do not need a desktop environment, and therefore have a different setup requirement from a desktop configuration. After all, why dig up an extra monitor and keyboard just to do a one time configuration for the Jetson? Also, because there is no desktop requirement, there is no need to have the extra support software for that environment on board. Running a minimal environment helps save space, and can lead to more efficient operation.

Note: You will see reference in most of the documentation to a host device and a target device. The Jetson is the target device, the host device is a PC desktop/laptop. On the Jetson Nano, if you simply create a SD Card Image from a NVIDIA supplied disk image, you can create the SD card and configure the Jetson from a machine running Windows, Linux or Macintosh. If you create your SD card through the SDK Manager, you will need an Ubuntu machine.

Tell me how

There is a script subsystem tool that runs on the Jetson the first time it boots, named oem-config (The link opens up the complete documentation on the NVIDIA website). If the Jetson has a display and keyboard, oem-config runs as the familiar GUI application on the Jetson and walks the user through the configuration process.

However, if there is no monitor and keyboard on the Jetson (headless mode), oem-config can configure the system through the default debugging port. On the Jetson Nano, the easiest way to access the debugging port is through the micro-USB connector. You will connect the micro-USB connector to the Jetson, and the other end of the USB cable will go to the host PC. Typically this is a USB Type A connector.

Note: Make sure that the cable is data capable. Some USB cables (such as those that come with phones) only transmit power.

You will need to supply power the Jetson through the barrel jack (don’t forget the jumper on J48!).

Setup

You will need a serial terminal application. In the video we use the app screen on the Ubuntu machine, an puTTY on the Windows machine example. screen also works on the Macintosh from the Terminal. You can install screen on Ubuntu:

$ sudo apt-get install screen

There are multiple network interfaces on the Jetson Nano, including ones which you may add yourself such as those for wifi access. Since this process is very well documented in the actual NVIDIA documentation and shown in the walk through video above, we won’t cover it in too much detail here. However, you will need to have your network connection up and running before oem-config starts setup, i.e. have your Ethernet cable plugged in and attached to the network, or wireless card installed and WiFi network accessible, etc.

You will also need to know the device/name of the Jetson when you plug it into the USB port of your host. On Linux and Macintosh, the Jetson will show up in the /dev directory. On Linux, the Jetson presents itself as a ttyACM* device (for example /dev/ttyACM0) and on a Mac a tty.usbmodem* device (something similar to /dev/tty.usbmodem148303). On Windows the Jetson is a COM* device.

On Linux and Mac you can simply ls the /dev directory, on Windows probably the easiest way is to use the Device Manager. You will need to show ‘hidden devices’ in the View menu, as ports are normally not shown.

It’s easiest to take inventory before you power the Jetson up, and then see what shows up after you power up the Jetson. Remember that it takes the Jetson ~ 45 seconds to boot, so you should be a little patient.

The Jetson interface is 115200 baud, so when using your serial terminal app you typically would enter something like:

$ screen /dev/ttyACM0 115200

where the address matches your configuration. Under Windows using puTTY, you enter the COM port number, and set the speed (see video).

You may need to hit the Esc key a couple of times when the serial app starts. Remember that it does take a while for the Jetson to boot, waiting a little while before starting setup is your friend. One of the setup issues that I have encountered is that if you try to exit/restart the configuration process, it may not be recoverable. In that case, you may need to flash the SD card and start again.

Most of the questions are simple, the only variation comes when you get to the Network Configuration screen. It is relatively straightforward. Once the Jetson is configured, it reboots. At this point you can ssh into the Jetson.

There is a small chicken and egg problem. You may not know the IP address of the Jetson. You can use the same USB cable and serial app to log in to the Jetson at this point and look up the address using something like ifconfig.

Once you know the IP address of the Jetson, you can then SSH into it. The command is:

$ ssh <account name>@<ipaddress>

An example:

$ ssh jetsonhacks@10.0.1.21

You should now be connected to the Jetson.

List o’ Stuff

Here’s a list of the bits and pieces used in the video:

These are all affiliate links. JetsonHacks gets a small commission on these items (but they don’t cost you anything more). These are all items that I have bought and used myself.

Conclusion

This is a little less nuts and bolts than most of the articles here on JetsonHacks. That’s mostly due to the fact that there are many paths your network configuration can take, as well as different machines that you can use as your host.

For most questions, you will be referred back to the official NVIDIA Jetson Nano Forum, so that a larger group of developers and NVIDIA engineers can lend their experience.

The post Jetson Nano – Headless Setup appeared first on JetsonHacks.


Viewing all articles
Browse latest Browse all 339

Trending Articles