How to set up wifi during JetPack installation on a headless TX2?

I want to set up a TX2 with Jetpack, and have it automatically join my local wifi network. I don’t have Ethernet available. Is there some file I can place in the sample rootfs, such that when I flash the TX2 and reboot it, it automatically connects to my wifi?

I don’t want to have to connect a keyboard / mouse / screen just to complete this one step of the Jetpack setup.

Flash itself uses only the micro-B USB cable. It is the install of extra packages which requires the wired ethernet. JetPack has a way of getting the Jetson to report its IP address after the flash and it doesn’t work with WiFi. Technically this won’t matter until flash completes and the steps for adding those extra packages starts.

FYI, mostly the Jetson is like any other Ubuntu system, so for parts other than boot and flash you’ll find docs on things like WiFi setup (and NetworkManager) are applicable. The actual flash modifies some of the “/boot” content, but if you know what files to edit in “/etc” or elsewhere, then those files will be alive and living as an exact match between your rootfs on the PC host and the Jetson. I do not know what would be required to use WiFi through file edits, but if someone knows, then you could do this in the rootfs before flashing.

Perhaps someone knows what needs to be edited in terms of files in order to set up WiFi as the primary and only network configuration…after flashing then you’d probably see the WiFi connect to the router. Then again, if you use a serial console, then you could just edit the files directly after an ordinary flash. For serial console see:
http://www.jetsonhacks.com/2017/03/24/serial-console-nvidia-jetson-tx2/

I don’t know if WiFi would work or not when manually running JetPack without the flash step (you can uncheck flash and keep extra package installs). I say this because you could manually tell JetPack the IP address you have the Jetson working on over WiFi, but I don’t know what issues you might run into…all of the automatic setup would be missing.

I tried updating the wpa_supplicant.conf file in rootfs with my SSID and password, prior to flashing to the Jetson. Flashing went fine, but the TX2 still doesn’t connect to Wifi.

I’ve actually done this loads of times, and can confirm it works fine. Basically, I run the Jetpack installation multiple times, with different options checked each time.

  1. With only installing Host, up to, but not including “Flash OS Image to Target”
  2. Update wpa_supplicatn.conf in the rootfs on the host (something like “sudo vi 64_TX2/Linux_for_Tegra_tx2/rootfs/etc/wpa_supplicant.conf” ) with my wifi info
  3. Run install again, this time with only “Flash OS Image to Target”.
  4. (At this point, the Jetson should reboot and connect to wifi. But it doesn’t connect properly, so I have to plug it into a screen / mouse / keyboard and connect to wifi manually).
  5. Re-run Jetpack install a third time, and feed it the IP address (or hostname) of the TX2. Only checked off everything AFTER (but not including) “Flash OS Image to Target”. As long as the host and Jetson are on the same network (Ethernet or Wifi), it works just fine.

The only thing that isn’t working for me is the automatic setup of Wifi above, which would mean I don’t have to hook up a mouse / keyboard / screen, which would be awesome (for purposes of automating / scripting the whole thing).

I actually figured this out at some point, but you need to have serial console enabled (either on UART0, or just plug in the USB cable if you’re using the devkit). Posting here for posterity. Basically:

  1. Flash L4T to the board.
  2. Power off the jetson and plug into UART0 using and FTDI cable or other. Then run screen, picocom, or your terminal program of choice (115200, 8N1).
  3. Boot up the TX2.

After logging in:

sudo iwlist scan

(this may report that all interffaces don’t support scanning. That’s fine).

Then:

sudo nmcli dev wifi connect <YOUR_SSID_HERE> password <YOUR_KEY_HERE>

Then, attempt to ping some address on your local network, or run sudo-apt-get update or something, just to confirm that you have internet access.

Once this is done, you can power down, unplug the serial cable, power back up, and the jetson should be visible on the network (default hostname is tegra-ubuntu).

Note: This basically worked for me first time, so I don’t really know how to troubleshoot if something goes wrong.