Test WIFI under Yocto - TechNexion/u-boot-edm GitHub Wiki
Check if the wifi module is loaded.
For QCA WLAN:
~# lsmod
Module Size Used by
wlan 4673536 0
Run “connmanctl” in interactive mode.
~# connmanctl
Scan and list the wifi hotspots, then register the agent to handle user requests.
connmanctl> scan wifi
Scan completed for wifi
connmanctl> services
hotspot wifi_4439c4970d84_544543484e4558494f4e_managed_psk
connmanctl> agent on
Agent registered
Connect to the hotspot and enter the passphrase.
connmanctl> connect wifi_4439c4970d84_544543484e4558494f4e_managed_psk
Agent RequestInput wifi_4439c4970d84_544543484e4558494f4e_managed_psk
Passphrase = [ Type=psk, Requirement=mandatory, Alternates=[ WPS ] ]
WPS = [ Type=wpspin, Requirement=alternate ]
Passphrase?
Connected wifi_4439c4970d84_544543484e4558494f4e_managed_psk
Quit the interactive mode of “connmanctl”.
connmanctl> quit
Test if wifi actually works.
~# ping www.google.com
PING www.google.com (203.66.124.251): 56 data bytes
64 bytes from 203.66.124.251: seq=0 ttl=59 time=4.905 ms
64 bytes from 203.66.124.251: seq=1 ttl=59 time=12.278 ms
64 bytes from 203.66.124.251: seq=2 ttl=59 time=4.307 ms
For the next boot, connman will automatically connect to the hotspot you used before.
Connect ethernet cable and get IP from DHCP server.
~# udhcpc -i eth0
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending select for 10.20.30.157
udhcpc: lease of 10.20.30.157 obtained, lease time 1200
/etc/udhcpc.d/50default: Adding DNS 10.20.30.240
/etc/udhcpc.d/50default: Adding DNS 1.1.1.1
/etc/udhcpc.d/50default: Adding DNS 168.95.192.1
Create hotspot with WPA + WPA2 passphrase.
~# connmanctl tether wifi on <ssid> <passphrase>
e.g.
~# connmanctl tether wifi on SAP 12345678
Use your cell phone to connect to hotspot SAP to get wifi connectivity.
~# rm /var/lib/connman/*/settings
~# connmanctl disable wifi
~# connmanctl enable wifi
- Duplicated AP name shows when scanning wifi hotspots:
e.g.
connmanctl> services
TECHNEXION(5G) wifi_001f7b311132_544543484e4558494f4e28354729_managed_psk
TECHNEXION(5G) wifi_021f7bb51132_544543484e4558494f4e28354729_managed_psk
The string:
wifi_001f7b311132_544543484e4558494f4e28354729_managed_psk
The prefix 001f7b is the MAC address specifically for TechNexion WIFI chip.
wifi_021f7bb51132_544543484e4558494f4e28354729_managed_psk
The prefix 021f7b is the virtual MAC address generated for p2p interface.
(Note: This virtual MAC address follows the administered addresses rule to be generated.)
If you don't want p2p to show in hotspot scan:
iw dev p2p0 del