4.4.2 Wi-Fi connection

The default initialization code installs the WILCS02 driver when the kernel detects the WILCS02-SD board. start-sta systemd service is run in the systemd init system when the system boot up. The /etc/systemd/system/start-sta.service execute /root/Start_STA.sh and run the wpa-supplicant to configure the network Wi-Fi device to connect to the default AP. Users can set the AP credentials to the board’s default settings for tests.

Default AP SSID and password are as follows:
 Default SSID: DEMO_AP
 Password: password

The following figure illustrates the kernel detect the wilcs02 SDIO card and install the WILCS02 driver.

Figure 4-2. Kenel Showing Detect WILCS02 and Install Driver

Following is the script /root/Start_STA.sh which start the Wi-Fi interface, use wpa_supplicant to connect the device to the target AP and obtain the IP address.

#!/bin/bash
sh /root/check_linkstat.sh & 
ifconfig wlan0 up
wpa_supplicant -Dnl80211 -iwlan0 -c/etc/wpa_supplicant.conf &
udhcpc -i wlan0 &
You can change the default SSID and password by modifying /etc/wpa_supplicant.conf in the root file system.

LED D5 on the board shows the Wi-Fi connection status. It blinks blue color when the device is attempting to connect to the tart AP. It keeps turning on in blue color when the device success to connect to the target AP.

You can check the network connectivity by using command iwconfig and ifconfig.

Figure 4-3. Console Log of Command iwconfig and ifconfig