ssid="MYIR_TECH"
scan_ssid=1
proto=WPA RSN
pairwise=CCMP TKIP NONE
key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE
group=TKIP CCMP
psk="myir2016"
priority=10
}
2.Connect WIFI AP.
#
wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B
3.Get the IP address and DNS.
#udhcpc -b -i wlan0
udhcpc: started, v1.25.1
udhcpc: sending discover
udhcpc: sending select for 192.168.30.115
udhcpc: lease of 192.168.30.115 obtained, lease time 3600
deleting routers
adding dns 223.5.5.5
adding dns 201.104.111.114
4.Ping Test.
# ping www.baidu.com
PING www.baidu.com (61.135.169.125): 56 data bytes
64 bytes from 61.135.169.125: seq=0 ttl=56 time=29.253 ms
64 bytes from 61.135.169.125: seq=1 ttl=56 time=32.218 ms
64 bytes from 61.135.169.125: seq=2 ttl=56 time=24.717 ms
64 bytes from 61.135.169.125: seq=4 ttl=56 time=141.210 ms
64 bytes from 61.135.169.125: seq=5 ttl=56 time=64.064 ms
64 bytes from 61.135.169.125: seq=11 ttl=56 time=133.112 ms
WIFI SoftAP Mode
1.Modify the value of ssid and wpa_passphrase in the
/etc/hostapd.conf
configuration file. ssid is the name of the ap hotspot generated by the wifi module,
and wpa_passphrase is the password of the ap hotspot.
# cat /etc/hostapd.conf
interface=wlan0
86