Without further ado, NetBSD 9.2 can’t use the onboard OrangePi Zero wifi adapter. This doesn’t mean much of a deal, given that Linux in practice can’t as well, at least without a quite poor out-of-tree driver.

Thus, everything below although done on an OrangePi Zero, it’s valid to say that it is valid to any device running NetBSD 9.2 with a recognized wifi adapter.

It will be used the DLink N300 Nano / DWA-131 adapter, one of the cheapest that is possible to get. This adapter is plug and play on NetBSD 9.2, not requiring manual loading of modules. It will show on “ifconfig” only as urtwn0:

armv7# ifconfig
emac0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        capabilities=3f00<IP4CSUM_Rx,IP4CSUM_Tx,TCP4CSUM_Rx,TCP4CSUM_Tx>
        capabilities=3f00<UDP4CSUM_Rx,UDP4CSUM_Tx>
        enabled=0
        ec_capabilities=1<VLAN_MTU>
        ec_enabled=0
        address: 02:42:17:55:f1:f1
        media: Ethernet autoselect (none)
        status: no carrier
urtwn0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ssid #NET-CLARO-WIFI
        powersave off
        bssid 36:49:5b:87:6b:bd chan 11
        address: e0:1c:fc:a2:6e:4f
        media: IEEE802.11 autoselect (OFDM54 mode 11g)
        status: active
        inet6 fe80::bbbd:df50:4cfe:5e3b%urtwn0/64 flags 0x0 scopeid 0x2
        inet 100.64.16.193/16 broadcast 100.64.255.255 flags 0x0
lo0: flags=0x8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33176
        inet6 ::1/128 flags 0x20<NODAD>
        inet6 fe80::1%lo0/64 flags 0x0 scopeid 0x3
        inet 127.0.0.1/8 flags 0x0

The default NetBSD image already has all the infrastructure required to associate this adapter with a access point using wpa_supplicant.

Open the file /etc/rc.conf and add at its tail: wpa_supplicant=YES wpa_supplicant_flags="-i urtwn0 -c /etc/wpa_supplicant.conf"

To avoid reboot the system, manually start it as well: service wpa_supplicant start

Now it will be possible to execute the wpa_supplicant shell with the command wpa_cli. Run wpa_cli and follow with these commands:

02:08:44.096: OK

  02:08:47.871: CTRL-EVENT-SCAN-RESULTS 
  02:08:47.871: CTRL-EVENT-NETWORK-NOT-FOUND 
scan_results
02:09:03.736: bssid / frequency / signal level / flags / ssid
xx:xx:xx:xx:xx:xx       2412    210     [WPA2-PSK-CCMP][ESS]    DinaRoque
xx:xx:xx:xx:xx:xx       2462    170     [WPA2-PSK-CCMP][ESS]    Mandy
xx:xx:xx:xx:xx:xx       2437    20      [WPA2-PSK-CCMP][ESS]    Aj2045-2.4GHz
xx:xx:xx:xx:xx:xx       2437    20      [WPA2-PSK-CCMP][ESS]    wrizzo
xx:xx:xx:xx:xx:xx       2437    20      [WPA2-PSK-CCMP][ESS]    tuxnet
xx:xx:xx:xx:xx:xx       2452    20      [WPA2-PSK-CCMP][ESS]    Dina
xx:xx:xx:xx:xx:xx       2462    20      [WPA-PSK-CCMP+TKIP][ESS]        2.4G Viviane
xx:xx:xx:xx:xx:xx       2462    20      [WPA2-PSK-CCMP][ESS]    Coracao de Mae
xx:xx:xx:xx:xx:xx       2462    20      [WPA2-PSK-CCMP][ESS]    MIRALVA 2G
xx:xx:xx:xx:xx:xx       2462    20      [WPA2-PSK-CCMP][ESS]    UpSters 2g
xx:xx:xx:xx:xx:xx       2462    20      [WPA2-PSK-CCMP][ESS]    Crisinha2G
xx:xx:xx:xx:xx:xx       2462    20      [WPA2-PSK-CCMP][ESS]    Samuel
xx:xx:xx:xx:xx:xx       2462    20      [WPA2-PSK-CCMP][ESS]    Samuel_GUEST
xx:xx:xx:xx:xx:xx       2462    20      [WPA2-PSK-CCMP][ESS]    Duda Rico
xx:xx:xx:xx:xx:xx       2412    20      [WPA2-PSK-CCMP][ESS]    Familiazita
..... 
add_network
0
set_network 0 ssid "YOUR_NETWORK"
set_network 0 psk "YOUR_PASSWORD"
set_network 0 disabled 0
save_config
quit

Done, the network should be available. Check with ifconfig if the adapter has a ssid and an IP:

urtwn0: flags=0x8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ssid SUAREDE nwkey 65536:"",0xfc4cb3d188ae826c37b471e304eeedff,"",""
        powersave off
        bssid 68:02:b8:e1:5b:ca chan 6
        address: e0:1c:fc:a2:6e:4f
        media: IEEE802.11 autoselect (OFDM54 mode 11g)
        status: active
        inet6 fe80::7fe2:e3d6:ba16:ae99%urtwn0/64 flags 0x0 scopeid 0x2
        inet6 2804:14d6:77b6:82ec:0a3e:4b7a:848:30f3/64 flags 0x2<TENTATIVE>

You now will be (hopefully) able to ping your preferred site.