Search by Tags

Basic Wi-Fi usage

 

Your progress

 

Overview

In this how-to section, you will connect the board to the internet using the integrated Wi-Fi module.

In this section you will:

  • Enable Wi-Fi.
  • Scan Wi-Fi for available networks.
  • Configure and connect to an Wi-Fi access point.

The network manager used in the Toradex pre-built Linux images is ConnMan. This lesson was written based on the Toradex knowledge-base articles Wi-Fi (Linux) and Ethernet/Network (Linux).

Step 1

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 ready
Enabled wifi

Step 2

Scan for Wi-Fi access points available:

connmanctl scan wifi

Wait for the output message:

Scan completed for wifi

Step 3

List all available access points:

root@module:~# connmanctl services
*AO Wired ethernet_00142d2de439_cable
TORADEX wifi_0019885e10b0_544f52414445585f42524153494c_managed_psk

Notice that the Wi-Fi access points are listed in the format:

<SSID> wifi_<HASH>_managed_psk

Step 4

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:

/var/lib/connman/SSID-psk.config
[service_wifi_<HASH>_managed_psk] Type = wifi Name = <SSID> Passphrase = <PASSPHRASE>

Step 5

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.

Step 6

Ping a website to verify that you have internet access:

root@module:~# ping -c 4 google.com
PING google.com (216.58.202.142): 56 data bytes
64 bytes from 216.58.202.142: seq=0 ttl=52 time=16.131 ms
64 bytes from 216.58.202.142: seq=1 ttl=52 time=17.839 ms
64 bytes from 216.58.202.142: seq=2 ttl=52 time=17.629 ms
64 bytes from 216.58.202.142: seq=3 ttl=52 time=16.691 ms
--- google.com ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 16.131/17.072/17.839 ms

FAQ

How can I configure the Wi-Fi network with a static IP