Search by Tags

Basic Wi-Fi Usage with Torizon

 

Your progress

 

Overview

In this lesson, you will connect the board to the Internet using the integrated Wi-Fi module.

In this section you will:

  • Scan for available Wi-Fi networks.
  • Connect to and authenticate with a Wi-Fi access point.

The network manager used in Torizon is called NetworkManager. The command-line client is nmcli. This lesson was written based on the Torizon knowledge-base article Networking with TorizonCore.

Check if your Toradex SoM has a Wi-Fi module. See it highlighted in the example below and try to identify the same device on your SoM:


  • Wi-Fi Module Highlighted

    Wi-Fi Module Highlighted

If it doesn't, you can proceed to the next lesson.

Step 1

Access the Linux terminal as explained in the previous lesson Linux Terminal and Basic Usage - Linux.

Step 2

Scan for available Wi-Fi access points by running the command below:

# nmcli device wifi list

Wait for the output message:

IN-USE  SSID                   MODE   CHAN  RATE        SIGNAL  BARS  SECURITY  
        NET_2GBA39CF           Infra  1     195 Mbit/s  100     ****  WPA1 WPA2 
        TORADEX_BRASIL         Infra  5     270 Mbit/s  100     ****  WPA1 WPA2 
        TORADEX_BRASIL_5GHZ    Infra  36    405 Mbit/s  79      ***   WPA1 WPA2 
        DIRECT-knM288x Series  Infra  11    54 Mbit/s   77      ***   WPA2      
        LusiasWiFi             Infra  1     195 Mbit/s  75      ***   WPA1 WPA2 
        #NET-CLARO-WIFI        Infra  1     195 Mbit/s  75      ***   --        

Step 3

Connect to a Wi-Fi network by locating the SSID of the network to which you want to connect and running the following command:

# nmcli -a device wifi connect <WIFI_NAME>

Note: In the command above, you will replace <WIFI_NAME> with the name you found in the SSID column.

Step 4

Authenticate with the Wi-Fi network:

Upon running the command in Step 3, you will be prompted for a password. Below, you will see the command to connect to SSID TORADEX_BRASIL, followed by the password request:

# nmcli -a device wifi connect TORADEX_BRASIL
Password: *********

After typing the password and pressing enter/return, the connection status message should appear:

Device 'wlp1s0' successfully activated with 'e17b1631-06c3-4720-a27d-6220775f8c6b'.

Note: The next time you reboot the system, the network will connect automatically as long as the access point is within range.

Step 5

Verify and view the details of the Wi-Fi connection you made with the following command:

# nmcli

You should see a section that starts with wlp1s0, similar to the one below:

wlp1s0: connected to TORADEX_BRASIL
        "Marvell Wi-Fi"
        wifi (mwifiex_pcie), xx:xx:xx:xx:xx:xx, hw, mtu 1500
        inet4 10.0.0.42/24

The IP Address of your Wi-Fi adapter is on the line starting with "inet4".

Step 6

Ping a website using the Wi-Fi interface to verify that you have Internet access:

# ping -I <interface> -c 4 google.com

Expected output:

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

Killing a connection command can make future commands fail. A reboot usually fixes this.

FAQ

How can I configure the network with a static IP