Connect to Wi-Fi on Duo S

Make sure you have the antenna plugged in on the board.

Start wpa_supplicant with:

# echo "update_config=1" >> /etc/wpa_supplicant.conf
# wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf

At this point run:
# wpa_cli -i wlan0

Use the scan and scan_results commands to see the available networks:

> scan
> scan_results
bssid / frequency / signal level / flags / ssid
11:22:33:44:55:66       5745    -78     [WPA2-PSK-CCMP][ESS]    MYSSID-5G
11:22:33:44:55:67       2427    -85     [WPA2-PSK-CCMP][ESS]    MYSSID

To associate with MYSSID-5G, add the network, set the credentials and enable it:

> add_network
> set_network 1 ssid "MYSSID-5G"  
> set_network 1 psk "password"
> enable_network 1

If the SSID does not have password authentication, you must explicitly configure the network as keyless by replacing the command set_network 1 psk "password" with set_network 1 key_mgmt NONE.

Finally save this network in the configuration file and quit wpa_cli:

> save_config
> quit
[root@milkv-duo]~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet scope host lo
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 66:69:54:69:1c:2c brd ff:ff:ff:ff:ff:ff
    inet brd scope global noprefixroute eth0
       valid_lft forever preferred_lft forever
3: usb0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 7e:eb:9c:48:33:3c brd ff:ff:ff:ff:ff:ff
    inet brd scope global usb0
       valid_lft forever preferred_lft forever
4: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether 88:00:33:77:f1:0f brd ff:ff:ff:ff:ff:ff
    inet brd scope global dynamic noprefixroute wlan0
       valid_lft 84829sec preferred_lft 74029sec
[root@milkv-duo]~# ping
PING ( 56 data bytes
64 bytes from seq=0 ttl=49 time=46.170 ms
64 bytes from seq=1 ttl=49 time=53.166 ms
64 bytes from seq=2 ttl=49 time=54.292 ms

Auto connect on startup

cat >> /mnt/system/ <<END
# Auto connect to WIFI on startup
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf