By default, the LinkIt Smart 7688 development board runs in AP mode and provides Wi-Fi connection for Wi-Fi enabled devices. But if you want to run the board as a Wi-Fi device to connect to a wireless router to join an existing Wi-Fi network, you need to switch the LinkIt Smart 7688 development board from AP mode to Station mode.
There are two methods to achieve this purpose:
- Use a Web UI.
- Apply UCI commands provided in OpenWrt, as follows:
- Type UCI commands to assign SSID, key, and encryption information required for the Station mode.
- Restart the Wi-Fi driver to activate the configuration.
- Check for internet connection.
Step 1 — Apply UCI commands to assign SSID, key, and encryption information for the Station mode
Assume the wireless router to be connected is with the following properties:
- SSID: SampleAP
- Password: 12345678
- Encryption: WPA2 Personal
In the system console of LinkIt Smart 7688, type the following commands if you're with the firmware version v0.9.4 or above:
# uci set wireless.sta.ssid=SampleAP # uci set wireless.sta.key=12345678 # uci set wireless.sta.encryption=psk2 # uci commit
If you're using the firmware v0.9.3 or below, please use this set of commands:
# uci set wireless.sta.ssid=SampleAP # uci set wireless.sta.key=12345678 # uci set wireless.sta.encryption=psk2 # uci set wireless.sta.disabled=0 # uci commit
Step 2 — Restart the Wi-Fi driver to activate the configuration
Type the command in the system console:
# wifi_mode sta
For firmware v0.9.3 or below, please use this command:
If you use SSH to connect to the system console of the LinkIt Smart 7688 development board, you'll lose the connection once the wifi command is set. This command will restart the Wi-Fi driver and then connect your PC to the same wireless router as the board did. Then you can connect to the LinkIt Smart 7688 development board with mylinkit.local by SSH again.
You can also refer to the LED behavior to check the states of the connection in Station mode.
Step 3 — Check for internet connection
Now check if you’ve established internet connection by typing the following command in the system console:
# ping –c 5 www.mediatek.com
If you see messages like below, then congratulations. You’ve connected to the wireless router with internet access.
root@mylinkit:/# ping -c 5 www.mediatek.com PING www.mediatek.com (220.127.116.11): 56 data bytes 64 bytes from 18.104.22.168: seq=0 ttl=244 time=388.372 ms 64 bytes from 22.214.171.124: seq=1 ttl=244 time=368.003 ms 64 bytes from 126.96.36.199: seq=2 ttl=244 time=397.851 ms 64 bytes from 188.8.131.52: seq=3 ttl=244 time=417.423 ms 64 bytes from 184.108.40.206: seq=4 ttl=244 time=357.303 ms --- www.mediatek.com ping statistics --- 5 packets transmitted, 5 packets received, 0% packet loss round-trip min/avg/max = 357.303/385.790/417.423 ms