Jetson Nano as Access point for direct connection to Notebook/Smartphone/etc.

Goal:

  • Use the Jetson Nano to create a WiFi AP, so we can connect to it without e.g. a WiFi router.
  • Create WiFi AP automatically after reboot

Tested with an EDIMAX EW-7811UN Wireless USB Adapter

1. Install GUI tool „Linux WiFi HotSpot“

sudo apt install -y libgtk-3-dev build-essential gcc g++ pkg-config make hostapd

git clone https://github.com/lakinduakash/linux-wifi-hotspotgit clone https://github.com/lakinduakash/linux-wifi-hotspot
cd linux-wifi-hotspot

make


sudo make installgit clone https://github.com/lakinduakash/linux-wifi-hotspot

2. Open a terminal window in desktop environment

3. Disable X-server access control

xhost +

4. Start tool „Linux WiFi HotSpot“

sudo wihotspot

5. Choose SSID, WiFi-Key, WiFi interface (wlan0), Internet interface (eth0)

6. Press „Create Hotspot“

Alternative: To create Access point from terminal instead, run:

sudo create_ap wlan0 eth0 'YourDesiredSsidHere' 'YourWiFiKeyHere' --freq-band 2.4 --no-virt -w 2

7. Create AP automatically after booting

  • Create a new python script:
import subprocess
import os
import time

while True:
    time.sleep(1)
    result = subprocess.run(['lsusb'], stdout=subprocess.PIPE)
    print(result.stdout)
    
    if ("Realtek RTL8188CUS" in str(result.stdout)):
        time.sleep(3)
        os.system("sudo create_ap wlan0 eth0 'YourDesiredSsidHere' 'YourWiFiKeyHere' --freq-band 2.4 --no-virt -w 2")
        
        break
  • Add python script to crontab to run after booting
sudo crontab -e

At the end of file, add:

@reboot python3 /path/to/python/script.py

Done.

You can now connect to your Jetson via WiFi using a Notebook, Smartphone etc. without the need for an existing network, like your home WiFi.

You can use this connection for SSH, FTP, VNC etc.

8. Use normal Client mode again:

comment line added to crontab with an # to disable automatic setup of the AP

edit /etc/NetworkManager/NetworkManager.conf

Changes:
[ifupdown]
managed=true

[keyfile]
#unmanaged-devices=interface-name:wlan0

Right-click on Network Manager tray icon -> Edit Connections -> Wireless -> Add Manually add the parameters for connecting to your WLAN (SSID, Security Type and Key)

reboot.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert