This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
products:sbc:common:applications:wifi-sta-ap-mode [2022/06/30 02:31] nick ↷ Page name changed from products:sbc:common:applications:wifi_sta_ap_mode to products:sbc:common:applications:wifi-sta-ap-mode |
products:sbc:common:applications:wifi-sta-ap-mode [2025/02/19 02:32] (current) jacobe |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | # Wi-Fi STA/AP Mode | + | ====== VIMs Wi-Fi STA/AP Mode Configuration ====== |
+ | |||
+ | ===== Download ===== | ||
+ | ``` | ||
+ | wget https:// | ||
+ | sudo chmod 777 khadas_ap.sh | ||
+ | sudo mv khadas_ap.sh / | ||
+ | ``` | ||
+ | We will add it in next version and users could also rebuild the image. | ||
+ | ===== Overview ===== | ||
+ | This guide explains how to configure dual Wi-Fi mode using the provided script (v1.0), enabling simultaneous operation in: | ||
+ | |||
+ | STA+AP Mode: '' | ||
+ | |||
+ | ETH+AP Mode: '' | ||
+ | |||
+ | ===== Prerequisites ===== | ||
+ | |||
+ | Root privileges required | ||
+ | |||
+ | Ensure wireless interfaces are properly identified: | ||
+ | |||
+ | STA interface: '' | ||
+ | |||
+ | AP interface: '' | ||
+ | |||
+ | Ethernet interface: '' | ||
+ | |||
+ | ===== Configuration Script Usage ===== | ||
+ | Run the script with root privileges: | ||
+ | |||
+ | ``` | ||
+ | sudo khadas_ap.sh | ||
+ | ``` | ||
+ | |||
+ | |||
+ | ==== Main Menu Options ==== | ||
+ | ``` | ||
+ | ======================================== | ||
+ | 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]: | ||
+ | ``` | ||
+ | 1.STA+AP Mode - Recommended for most devices: creates NAT forwarding between '' | ||
+ | |||
+ | 2.ETH+AP Mode - For devices with Ethernet port: creates NAT forwarding between '' | ||
+ | |||
+ | 3.Stop All Services - Terminates AP/DHCP/NAT services | ||
+ | |||
+ | 4.Exit - Quit the script | ||
+ | |||
+ | ==== Configuration Steps ==== | ||
+ | |||
+ | Select operation mode from menu | ||
+ | |||
+ | For AP modes (1 or 2): | ||
+ | |||
+ | * Enter SSID for hotspot | ||
+ | * Set password (WPA2-PSK required) | ||
+ | * Script automatically handles: | ||
+ | * Hostapd configuration | ||
+ | * Dnsmasq DHCP setup | ||
+ | * IP forwarding | ||
+ | * iptables NAT rules | ||
+ | |||
+ | ===== Verification ===== | ||
+ | Check interface status after configuration: | ||
+ | |||
+ | ``` | ||
+ | ifconfig wlan0 && ifconfig wlan1 | ||
+ | ``` | ||
+ | Verify internet connectivity (STA+AP mode): | ||
+ | |||
+ | ``` | ||
+ | ping -I wlan0 google.com | ||
+ | ``` | ||
+ | Test hotspot access: | ||
+ | |||
+ | SSID: [Your configured SSID] | ||
+ | |||
+ | Password: [Your set password] | ||
+ | |||
+ | Client IP range: 192.168.43.2-254 | ||
+ | |||
+ | ===== Important Notes ===== | ||
+ | <WRAP important> | ||
+ | Edge2 Device Limitations: | ||
+ | |||
+ | No Ethernet interface ('' | ||
+ | |||
+ | ETH+AP Mode (Option 2) will not function | ||
+ | |||
+ | Use STA+AP Mode (Option 1) exclusively | ||
+ | |||
+ | </ | ||
+ | ===== Technical Details ===== | ||
+ | |||
+ | IP Configuration: | ||
+ | |||
+ | * AP Static IP: 192.168.43.1/ | ||
+ | * DHCP Range: 192.168.43.2-254 | ||
+ | * DNS: Google DNS (8.8.8.8) via port 5353 | ||
+ | |||
+ | Security: | ||
+ | |||
+ | * WPA2-PSK encryption | ||
+ | * CCMP/AES cipher mandatory | ||
+ | |||
+ | Default channel: 6 | ||
+ | |||
+ | Dependencies: | ||
+ | |||
+ | * dnsmasq (DHCP server) | ||
+ | * hostapd (AP configuration) | ||
+ | * iptables (NAT forwarding) | ||
+ | |||
+ | ===== Troubleshooting ===== | ||
+ | |||
+ | AP Not Appearing: | ||
+ | |||
+ | Confirm '' | ||
+ | |||
+ | Check for conflicting services: | ||
+ | |||
+ | ``` | ||
+ | ps aux | grep -E ' | ||
+ | ``` | ||
+ | No Internet Access: | ||
+ | |||
+ | Verify STA connection: | ||
+ | |||
+ | ``` | ||
+ | iwconfig wlan0 | ||
+ | ``` | ||
+ | Check NAT rules: | ||
+ | |||
+ | ``` | ||
+ | iptables -t nat -L -n -v | ||
+ | ``` | ||
+ | DHCP Failures: | ||
+ | |||
+ | Confirm dnsmasq running: | ||
+ | |||
+ | ``` | ||
+ | systemctl status dnsmasq | ||
+ | ``` |