Hi team,
How can my application configure the Ulatra W's WIFI module as AP for a period of time, and then switch to STA?
Can these operations be done by the application or scripts.
Configure WIFI module as AP for 60 seconds, and then switch to STA
This idea is feasible.
1.You can create a separate configuration file, such as/etc/wpa_supplementant.ap.conf,with the following content:
Here mode=2 means creating an AP, frequency=2412 means the frequency is 2.4G.
2.Reference link https://wiki.luckfox.com/zh/Luckfox-Pic ... E%A5-wifi.,modify the WiFi configuration file in/etc/wpa_supplicant.conf.
3.Write shell file:
1.You can create a separate configuration file, such as/etc/wpa_supplementant.ap.conf,with the following content:
Code: Select all
ctrl_interface=DIR=/var/run/wpa_supplicant
ap_scan=1
network={
ssid="YourAPSSID"
mode=2
frequency=2412
key_mgmt=NONE
}
2.Reference link https://wiki.luckfox.com/zh/Luckfox-Pic ... E%A5-wifi.,modify the WiFi configuration file in/etc/wpa_supplicant.conf.
3.Write shell file:
Code: Select all
killall -9 wpa_supplicant
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant_ap.conf
sleep 60
killall -9 wpa_supplicant
killall -9 wpa_supplicant
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
udhcpc -i wlan0