Skip to content

Simple Wi Fi client on ARC development boards

Yuriy Kolerov edited this page Aug 1, 2023 · 6 revisions

Software configuration on build host

Linux kernel configuration

For Wi-Fi to work it is essentially required to enable drivers for a Wi-Fi device available on the board or attached via USB. But before that it is required to enable 802.11:

  • CONFIG_CFG80211 - Wireless configuration API
  • CONFIG_MAC80211 - Hardware independent IEEE 802.11 networking stack

Once 2 options above enabled proceed to selection of Wi-Fi chip driver. For AXS10x boards we usually use USB Wi-Fi dongles (widely available one is TP-Link TL-WN722N) based on Atheros AR9271L chip. For that select:

  • CONFIG_ATH9K_HTC - Support for Atheros HTC based cards

On HSDK board we have RedPine RS-9113 module connected via SDIO bus, select it with:

  • CONFIG_RSI_SDIO

Note it's perfectly possible to have USB Wi-Fi dongle attached to HSDK as well so then just follow instructions for AXS10x board.

User-space configuration

Here we'll describe how to setup Buildroot but the same things could be done in any other build-system or even done manually.

In Buildroot we need to select:

  • Firmware for Wi-Fi chips
  • For AXS10x select BR2_PACKAGE_LINUX_FIRMWARE_ATHEROS_9271
  • For HSDK select BR2_PACKAGE_LINUX_FIRMWARE_REDPINE_RS9113
  • BR2_PACKAGE_WPA_SUPPLICANT - WPA supplicant for secure wireless networks. It will help to connect to secure Wi-Fi network.

Software configuration on target

Modify /etc/wpa_supplicant.conf file such that "ssid" value matches a name of your access-point and "psk" value matches your AP's pass-phrase like that:

ctrl_interface=/var/run/wpa_supplicant
ap_scan=1

network={
  ssid="MyAccessPointName"
  psk="xxxx"
}

Execute the following commands on AXS board:

ifconfig wlan0 up
wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf
udhcpc -i wlan0

At this point you should be connected to the wireless network and have IP-address assigned.

udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending select for 10.42.1.137
udhcpc: lease of 10.42.1.137 obtained, lease time 3600
deleting routers
adding dns 10.42.1.1

# ifconfig 
lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:23:A7:65:9B:94  
          inet addr:10.42.1.137  Bcast:10.42.1.255  Mask:255.255.255.0
          inet6 addr: fe80::223:a7ff:fe65:9b94/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1028 (1.0 KiB)  TX bytes:1738 (1.6 KiB)
Clone this wiki locally