WiFi in the Default Linux Configuration
Your i.MX 8M Mini kit arrives with the Linux image ready for WiFi operation. You will have to configure your specific unit to connect to a local WiFi access point.
Setting Up WiFi Antenna
The i.MX 8M Mini kit arrives with the WiFi antenna. Make sure it is securely connected to the antenna connector on the System-On-Module and is placed into a position that allows for maximum connectivity with your WiFi Access Point.
Using WiFi in Linux
When Linux boots, the WiFi interface is enabled and configured in the default image installed to the kit. Step through the following procedure to configure WiFi for your local environment and then use it to access the Internet:
- On the i.MX 8M Mini, issue the following command from the Linux shell:
root@imx8mm-lpddr4:~# systemctl stop wpa_supplicant
root@imx8mm-lpddr4:~# wpa_supplicant -i wlan0 -c \
/etc/wpa_supplicant.conf -B
Successfully initialized wpa_supplicant
- Validate that the i.MX 8M Mini is able to detect WiFi Access Points in the vicinity:
root@imx8mm-lpddr4:~# wpa_cli -i wlan0 scan
OK
root@imx8mm-lpddr4:~# wpa_cli -i wlan0 scan_results
bssid / frequency / signal level / flags / ssid
ec:43:f6:02:75:54 2437 -75 [WPA2-PSK-CCMP][ESS] Maxim
c0:25:e9:05:55:1e 2412 -83 [WPA2-PSK-CCMP][WPS][ESS] Hone-120
ec:43:f6:e1:4a:d8 2422 -24 [WPA2-PSK-CCMP][WPS][ESS] Tik
16:2d:27:5e:54:d4 2432 -72 [WPA2-PSK-CCMP][WPS][ESS][P2P] DIRECT-YQ-BRAVIA
ea:28:5d:7b:5a:f8 2432 -78 [WPA2-PSK-CCMP][WPS][ESS] ELDAR
ec:43:f6:e1:4a:da 5180 -82 [WPA2-PSK-CCMP][WPS][ESS] Tik5
14:dd:a9:f0:bf:08 2437 -87 [WPA2-PSK-CCMP][WPS][ESS] Gnomiki
c8:3a:35:18:7b:21 2452 -87 [WPA-PSK-CCMP][WPA2-PSK-CCMP][WPS][ESS]Dom
08:60:6e:e1:66:0c 2437 -87 [WPA2-PSK-CCMP][WPS][ESS] Ioanna
3c:15:c2:f4:05:66 2462 -88 [WPA2-PSK-CCMP][ESS] Air Network
bc:ee:7b:e4:24:58 2457 -85 [WPA2-PSK-CCMP][ESS]
b0:6e:bf:d8:a7:78 2467 -87 [WPA2-PSK-CCMP][WPS][ESS] Nastya1
- Connect to the Internet over WiFi:
root@imx8mm-lpddr4:~# wpa_cli -i wlan0 add_network
root@imx8mm-lpddr4:~# wpa_cli -i wlan0 set_network 1 \
ssid '"name-of-access-point"'
OK
root@imx8mm-lpddr4:~# wpa_cli -i wlan0 set_network 1 \
psk '"password-to-access-point"'
OK
root@imx8mm-lpddr4:~# wpa_cli -i wlan0 enable_network 1
OK
[ 284.555912] wlan0: authenticate with ec:43:f6:e1:4a:d8
[ 284.627134] wlan0: send auth to ec:43:f6:e1:4a:d8 (try 1/3)
[ 284.634605] wlan0: authenticated
[ 284.639897] wlan0: associate with ec:43:f6:e1:4a:d8 (try 1/3)
[ 284.649323] wlan0: RX AssocResp from ec:43:f6:e1:4a:d8
(capab=0x411 status=0 aid=1)
[ 284.660116] wlan0: associated
root@imx8mm-lpddr4:~# udhcpc -i wlan0
Sending discover...
Sending select for 192.168.1.35...
Lease of 192.168.1.35 obtained, lease time 25200
/etc/udhcpc.d/50default: Adding DNS 8.8.8.8
/etc/udhcpc.d/50default: Adding DNS 192.168.1.1
- Validate the connection by pinging a public host:
root@imx8mm-lpddr4:~# ping -c 3 google.com
PING google.com (74.125.205.101) 56(84) bytes of data.
64 bytes from le-in-f101.1e100.net (74.125.205.101): icmp_seq=1 ttl=47
time=18.5 ms
64 bytes from le-in-f101.1e100.net (74.125.205.101): icmp_seq=2 ttl=47
time=20.7 ms
64 bytes from le-in-f101.1e100.net (74.125.205.101): icmp_seq=3 ttl=47
time=20.9 ms
--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 18.593/20.102/20.930/1.075 ms
Determining WiFi Signal Strength
Use the following Linux commands to scan for available WiFi access points and determine signal strength:
root@imx8mm-lpddr4:~# ifconfig wlan0 up
root@imx8mm-lpddr4:~# iw wlan0 scan
...
BSS 60:ce:86:9f:3a:01(on wlan0)
last seen: 122.843s [boottime]
TSF: 1084189075325 usec (12d, 13:09:49)
freq: 5200
beacon interval: 29 TUs
capability: ESS Privacy SpectrumMgmt ShortSlotTime (0x0511)
signal: -71.00 dBm
last seen: 0 ms ago
SSID: MGTS_GPON5_70C6
Supported rates: 6.0* 9.0 12.0 18.0 24.0 36.0 48.0 54.0