Search by Tags

Basic Wi-Fi usage

 

Your progress

 

Attention: the Quickstart Guide for BSP 2.8, based on the Ångström distribution, is not being updated anymore. Depending on your SoM, you have different options:

Vybrid and Tegra: the information is provided as-is and still accurate, since newer Toradex BSPs are not ported to those SoMs. Just keep in mind that the Guides are not being maintained anymore, even if we find bugs or outdated instructions.

Apalis TK1 (all variants), Colibri iMX6ULL (all variants), Colibri iMX7S 256MB and Colibri iMX7D 512MB: these computer on modules are still regularly maintained in our BSPs and, to get started, you must check the software page Toradex BSP Layers and Reference Images for Yocto Project. Since Torizon is not supported, at the moment a Quickstart Guide is not available.

All other i.MX-based SoMs: you have two options to get started with embedded Linux: the first is to follow the Quickstart Guide for Torizon, which provides the greatest out-of-the-box experience, or if you choose to use Yocto, check the software page Toradex BSP Layers and Reference Images for Yocto Project.

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> AutoConnect = True

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

Common errors

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

FAQ

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