This repository contains scripts to configure an NVIDIA Jetson (or any compatible Ubuntu system) as an internal WiFi router/Hotspot. This enables the Jetson to host an internal network where other devices can connect, retrieve an IP address, and communicate with each other or the Jetson itself.
This is especially useful for robotics or IoT applications where you want an isolated, self-hosted network directly from the Jetson.
- Automated setup: Automatically identifies the available WiFi interface.
- NetworkManager integration: Uses
nmclito reliably configure the hotspot. - Systemd Service: Includes scripts to run the router automatically on startup.
- Shared Network: Utilizes IPv4 shared mode, providing DHCP and DNS for connected clients automatically (via
dnsmasq). - Web Admin Dashboard: Built-in Flask app on port 80 to view connected devices, change WiFi channels, manage static IPs, set custom DNS records, and configure port forwarding natively.
setup_router.py: The core python script that usesnmclito set up the NetworkManagerRDCJetsonconnection.teardown_router.py: A script to gracefully turn off and delete the hotspot connection in NetworkManager.rdc-router.service: The systemd service configuration file.install_service.sh: A shell script to deploy, enable, and start the systemd service automatically.stop_service.sh: A shell script to stop and disable the service, along with removing the hotspot.
You can manually run the script to initialize the router on demand:
chmod +x setup_router.py
./setup_router.pyBy default, the script will create a network with:
- SSID:
RDCJetson - Password:
jetson123
You can override these using arguments:
./setup_router.py --ssid "MyCustomNet" --password "supersecret" --name "MyCustomConnection"To ensure the router comes up automatically every time the Jetson powers on, install it as a system service.
chmod +x install_service.sh
./install_service.sh(This command uses sudo internally and may prompt for your password).
You can check the status of the service at any time with:
systemctl status rdc-router.serviceIf you need to stop the hotspot so the Jetson can connect to a normal WiFi network (like eduroam or a home network):
If you ran it manually, you can just run:
chmod +x teardown_router.py
./teardown_router.pyIf you installed the service, use the stop script so it doesn't automatically turn back on when you reboot:
chmod +x stop_service.sh
./stop_service.sh- The
setup_router.pyscript queriesnmclito find the physical WiFi interface (e.g.,wlan0). - It deletes any existing NetworkManager connection with the designated name to prevent conflicts.
- It creates an Access Point (AP) connection natively in NetworkManager.
- When devices connect to the Jetson, they are automatically assigned an IP address (e.g., in the
10.42.0.xrange). - The Jetson itself will claim the
.1address (e.g.,10.42.0.1). - Any device on this created network can communicate with the Jetson via
10.42.0.1, and the Jetson can communicate with the devices using their assigned dynamic IP addresses.
The setup_router.py script automatically launches a Flask-based web interface on port 80. By navigating to http://10.42.0.1 (or the Jetson's assigned IP) in your browser while connected to the hotspot, you can:
- View Status: See the current SSID, password, operating frequency, and connected devices.
- Change Channels: Dynamically switch the WiFi channel (e.g., 2.4GHz to 5GHz) to avoid interference.
- Static IPs: Assign static IP reservations to devices based on their MAC address (configured via
/etc/NetworkManager/dnsmasq-shared.d/jetson_static_ips.conf). - Custom DNS: Set local domain names (e.g.,
uav.arc.co) to resolve to specific IP addresses on the network usingdnsmasqconfigurations. - Port Forwarding: Automatically configure native Linux
iptablesrules to silently redirect traffic arriving on specific ports (e.g., forwarding port 80 to your backend app on port 8000) without needing extra proxy software.