Khadas Docs

Amazing Khadas, always amazes you!

User Tools

Site Tools


products:sbc:edge-2l:applications:wifi-sta-ap-mode

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
products:sbc:edge-2l:applications:wifi-sta-ap-mode [2026/02/04 22:27]
gray update by using AI
products:sbc:edge-2l:applications:wifi-sta-ap-mode [2026/05/11 02:47] (current)
nick
Line 1: Line 1:
-====== Edge-2L Wi-Fi STA/AP Mode Configuration ======+====== Edge-2L Wi-Fi STA/AP mode configuration ======
  
-===== Download Script===== +{{page>products:sbc:edge2:applications:wifi-sta-ap-mode&noheader}}
-Download and install the configuration script: +
-``` +
-wget https://raw.githubusercontent.com/khadas/fenix/refs/heads/master/archives/filesystem/common/usr/local/bin/khadas_ap.sh +
-sudo chmod 777 khadas_ap.sh +
-sudo mv khadas_ap.sh /usr/local/bin +
-``` +
- +
-**Note:** This script will be included in future system images. For now, you can manually download it or rebuild your image to include it. +
- +
-===== Overview ===== +
-This guide explains how to configure dual Wi-Fi modes using the ''khadas_ap.sh'' script (v1.0). It enables the Edge-2L to operate in one of the following modes simultaneously: +
- +
-  * STA+AP Mode''wlan0'' acts as a Station (STA) to connect to an existing Wi-Fi network, while ''wlan1'' creates an Access Point (AP) hotspot. +
-  * ETH+AP Mode:(**Not available on Edge-2L**) ''eth0'' provides an Ethernet uplink while ''wlan1'' creates an AP hotspot. +
- +
-===== Prerequisites ===== +
- +
-  * **Root privileges** are required. +
-  * Ensure wireless interfaces are properly identified: +
-      * STA interface: ''wlan0'' +
-      * AP interface: ''wlan1'' +
-  * **Important:** The Edge-2L does not have an Ethernet interface (eth0), making the ETH+AP mode non-functional on this device. +
- +
-===== Configuration Script Usage ===== +
-Run the script with root privileges: +
- +
-``` +
-sudo khadas_ap.sh +
-``` +
- +
- +
-==== Main Menu Options ==== +
-You will see the following menu: +
-``` +
-======================================== +
- WiFi Configuration Tool v1.0 +
-======================================== +
-1. STA+AP Mode +
-2. ETH+AP Mode +
-3. Stop All Services +
-4. Exit +
-======================================== +
-Please select an option [1-4]: +
-``` +
-  - **STA+AP Mode (Recommended):** Creates NAT forwarding between ''wlan0'' (connected to an existing Wi-Fi) and ''wlan1'' (AP hotspot). Hotspot IP: ''192.168.43.1'', DHCP range: ''192.168.43.2-254''+
-  - **ETH+AP Mode:** Creates NAT forwarding between ''eth0'' and ''wlan1''. Note: This mode will not work on Edge-2L as it lacks an ''eth0'' interface. +
-  - **Stop All Services:** Stops the AP, DHCP, and NAT forwarding services. +
-  - **Exit:** Quit the script +
- +
-==== Configuration Steps ==== +
- +
-  - Select your desired operation mode from the menu (use Option 1 for Edge-2L). +
-  - For AP modes, you will be prompted to: +
-    * Enter SSID for hotspot +
-    * Set password (WPA2-PSK required) +
-  - The script automatically configures: +
-    * Hostapd (for the AP) +
-    * Dnsmasq (for DHCP) +
-    * IP forwarding and iptables NAT rules +
- +
- +
-===== Verification ===== +
-After configuration, verify the interface status: +
- +
-``` +
-ifconfig wlan0 && ifconfig wlan1 +
-``` +
-In STA+AP mode, test internet connectivity from the device: +
- +
-``` +
-ping -I wlan0 google.com +
-``` +
-To connect to the hotspot from another device: +
- +
-  * SSID: The name you configured. +
-  * Password: The password you set. +
-  * Client IP range: 192.168.43.2 - 192.168.43.254 +
- +
-===== Important Notes ===== +
-<WRAP important> +
-**Edge-2L Device Limitations:**  +
-The Edge-2L does **not** have an Ethernet interface (''eth0''). Therefore, ETH+AP Mode (Option 2) will not function.Use STA+AP Mode (Option 1) exclusively. +
-</WRAP>  +
- +
-===== Technical Details ===== +
- +
-  * IP Configuration: +
-    * AP Static IP: ''192.168.43.1/24'' +
-    * DHCP Range: ''192.168.43.2-254'' +
-    * DNS: Google DNS (''8.8.8.8'') via port 5353 +
-  * Security:WPA2-PSK with mandatory CCMP/AES cipher.tory +
-  * Default channel: 6 +
-  * Required Services: ''dnsmasq'', ''hostapd'', ''iptables''+
- +
-===== Troubleshooting ===== +
- +
-  * AP Not Appearing: +
-    * Confirm the ''wlan1'' interface exists. +
-    * Check for conflicting services: ''ps aux | grep -E 'hostapd|dnsmasq' '' +
-  * No Internet Access for Clients: +
-    * Verify the STA connection: ''iwconfig wlan0'' +
-    * Check NAT rules: ''iptables -t nat -L -n -v'' +
-  * DHCP Failures: +
-    * Check if dnsmasq is running:'' systemctl status dnsmasq''+
Last modified: 2026/02/04 22:27 by gray