Created
June 7, 2026 21:31
-
-
Save rcland12/e17651c2949649a13bb9278788ff2331 to your computer and use it in GitHub Desktop.
Connect to WiFi on Nvidia Jetson Nano
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # wifi-connect.sh - Connect to Wi-Fi using nmcli | |
| # Usage: ./wifi-connect.sh <SSID> <PASSWORD> | |
| set -e | |
| if [ "$#" -ne 2 ]; then | |
| echo "Usage: $0 <SSID> <PASSWORD>" | |
| exit 1 | |
| fi | |
| SSID="$1" | |
| PASSWORD="$2" | |
| # Make sure Wi-Fi radio is on | |
| nmcli radio wifi on | |
| # Rescan so the network shows up if it's new | |
| nmcli device wifi rescan >/dev/null 2>&1 || true | |
| sleep 2 | |
| # Connect | |
| if sudo nmcli device wifi connect "$SSID" password "$PASSWORD"; then | |
| echo "Connected to '$SSID'." | |
| nmcli -t -f NAME,DEVICE connection show --active | |
| else | |
| echo "Failed to connect to '$SSID'." >&2 | |
| exit 1 | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment