In this how-to section, you will connect the board to the internet using the integrated Wi-Fi module.
In this section you will:
Access the Linux terminal, as explained in the previous lesson. Enable the Wi-Fi interface:
connmanctl enable wifi
You should see a message printed on the terminal such as the one below:
[ 883.144602] IPv6: ADDRCONF(NETDEV_UP): mlan0: link is not readyEnabled wifi
Scan for Wi-Fi access points available:
connmanctl scan wifi
Wait for the output message:
Scan completed for wifi
List all available access points:
root@module:~# connmanctl services*AO Wired ethernet_00142d2de439_cableTORADEX wifi_0019885e10b0_544f52414445585f42524153494c_managed_psk
Notice that the Wi-Fi access points are listed in the format:
Adjust the Wi-Fi configuration by creating the following file. Make sure that the SSID, HASH and PASSPHRASE values are replaced by the aimed network settings:
[service_wifi_<HASH>_managed_psk] Type = wifi Name = <SSID> Passphrase = <PASSPHRASE> AutoConnect = True
Connect to the Wi-Fi network:
connmanctl connect wifi_0019885e10b0_544f52414445585f42524153494c_managed_psk
Note: The next time you reboot the system, the network will connect automatically as long as the access point is within range.
Ping a website to verify that you have internet access:
root@module:~# ping -c 4 google.comPING google.com (22.214.171.124): 56 data bytes64 bytes from 126.96.36.199: seq=0 ttl=52 time=16.131 ms64 bytes from 188.8.131.52: seq=1 ttl=52 time=17.839 ms64 bytes from 184.108.40.206: seq=2 ttl=52 time=17.629 ms64 bytes from 220.127.116.11: seq=3 ttl=52 time=16.691 ms--- google.com ping statistics ---4 packets transmitted, 4 packets received, 0% packet lossround-trip min/avg/max = 16.131/17.072/17.839 ms
By default, the WiFi drivers add 2 different interfaces, mlan0 and uap0, used for standard connection and AP connections respectively. On connman this is translated showing 2 almost identical Wi-Fi hashes. However, there is a minor difference between both hashes of a single letter.
If you connect to one of the hashes and you start seeing the following messages, try connecting to the other hash:
[ 51.668979] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported[ 51.705220] IPv6: ADDRCONF(NETDEV_UP): uap0: link is not ready[ 54.616959] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported[ 54.676249] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported[ 54.711045] IPv6: ADDRCONF(NETDEV_UP): uap0: link is not ready[ 57.558954] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported[ 57.608132] mwifiex_sdio mmc1:0001:1: uap0: changing to 2 not supported[ 57.643672] IPv6: ADDRCONF(NETDEV_UP): uap0: link is not ready