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 [2023/02/15 22:54] (current) nick |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | # Wi-Fi STA/AP Mode | + | ====== |
+ | |||
+ | ===== Introduction ===== | ||
+ | |||
+ | This document mainly introduces the STA+AP mode of Wi-Fi. You'll learn how to open a hotspot while connected to the Internet. | ||
+ | |||
+ | ===== System Configuration ===== | ||
+ | |||
+ | ==== Upgrade System ==== | ||
+ | |||
+ | Please make sure you use the latest image, if not please follow [[/ | ||
+ | |||
+ | ==== Configuration Instructions ==== | ||
+ | |||
+ | Configure '' | ||
+ | |||
+ | === Add Wlan1 Interface === | ||
+ | |||
+ | ```shell | ||
+ | khadas@Khadas: | ||
+ | ``` | ||
+ | |||
+ | Use '' | ||
+ | |||
+ | ```shell | ||
+ | khadas@Khadas: | ||
+ | wlan0: flags=4099< | ||
+ | ether 18: | ||
+ | RX packets 0 bytes 0 (0.0 B) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 2 bytes 180 (180.0 B) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | |||
+ | wlan1: flags=4099< | ||
+ | ether 1a: | ||
+ | RX packets 0 bytes 0 (0.0 B) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 0 bytes 0 (0.0 B) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | ``` | ||
+ | |||
+ | === Setup Wlan1 as a Hotspot === | ||
+ | |||
+ | Setup '' | ||
+ | |||
+ | |||
+ | == 2.4 GHz Frequency == | ||
+ | |||
+ | We shall name our hotspot '' | ||
+ | ```shell | ||
+ | sudo nmcli con add type wifi ifname wlan1 con-name Hostspot autoconnect yes ssid khadas_ap | ||
+ | sudo nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared | ||
+ | sudo nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk | ||
+ | sudo nmcli con modify Hostspot wifi-sec.psk " | ||
+ | sudo nmcli con modify Hostspot ipv4.addresses 192.168.2.20/ | ||
+ | sudo nmcli con modify Hostspot ipv4.gateway 192.168.2.1 | ||
+ | sudo nmcli con up Hostspot | ||
+ | ``` | ||
+ | == 5 GHz Frequency == | ||
+ | |||
+ | To setup a 5GHz network, you’ll need to use the channel argument. \\ | ||
+ | We shall name our hotspot '' | ||
+ | ```shell | ||
+ | sudo nmcli con add type wifi ifname wlan1 con-name Hostspot autoconnect yes ssid khadas_ap_5G | ||
+ | sudo nmcli c modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band a 802-11-wireless.channel 149 802-11-wireless.powersave 2 ipv4.method shared | ||
+ | sudo nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk | ||
+ | sudo nmcli con modify Hostspot wifi-sec.psk " | ||
+ | sudo nmcli con modify Hostspot ipv4.addresses 192.168.2.20/ | ||
+ | sudo nmcli con modify Hostspot ipv4.gateway 192.168.2.1 | ||
+ | sudo nmcli con up Hostspot | ||
+ | ``` | ||
+ | |||
+ | Use '' | ||
+ | ```shell | ||
+ | khadas@Khadas: | ||
+ | wlan0: flags=4099< | ||
+ | ether 18: | ||
+ | RX packets 0 bytes 0 (0.0 B) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 2 bytes 180 (180.0 B) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | |||
+ | wlan1: flags=4163< | ||
+ | inet 192.168.2.20 | ||
+ | inet6 fe80:: | ||
+ | ether 1a: | ||
+ | RX packets 0 bytes 0 (0.0 B) | ||
+ | RX errors 0 dropped 0 overruns 0 frame 0 | ||
+ | TX packets 18 bytes 1312 (1.3 KB) | ||
+ | TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 | ||
+ | ``` | ||
+ | |||
+ | ===== Go Online! ===== | ||
+ | |||
+ | |||
+ | Verify that wlan0 has a working internet connection: | ||
+ | <WRAP info > | ||
+ | You need to connect Wi-Fi first. | ||
+ | </ | ||
+ | ```shell | ||
+ | khadas@Khadas: | ||
+ | PING td-balancer-dc11-60-161.wixdns.net (185.230.60.161) from 192.168.124.80 wlan0: 56(84) bytes of data. | ||
+ | 64 bytes from 185.230.60.161 (185.230.60.161): | ||
+ | 64 bytes from 185.230.60.161 (185.230.60.161): | ||
+ | 64 bytes from 185.230.60.161 (185.230.60.161): | ||
+ | ... | ||
+ | ``` | ||
+ | |||
+ | Verify that '' | ||
+ | * Name: 2.4G/'' | ||
+ | * Password:'' |