2.9.7. Wireless Networking

2.9.7.1. Overview

The Processor SDK for Linux includes networking support right out of the box. The AM64x Starter Kit (SK) includes wireless networking (WiFi) support as well. Please see the Setup WiFi section for how to connect with the Starter Kit in both Access Point (AP) and Station (STA) modes. Once an IP connection has been established via the setup above, evaluating WiFi is very similar to evaluating a wired network.

../_images/Academy_Using_WiFi.png

The network interfaces can be seen in Linux using the below commands executed on a SK:

root@am64xx-evm:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.2.19  netmask 255.255.255.0  broadcast 192.168.2.255
        inet6 fe80::f684:4cff:fef9:7c17  prefixlen 64  scopeid 0x20<link>
        ether f4:84:4c:f9:7c:17  txqueuelen 1000  (Ethernet)
        RX packets 8  bytes 1046 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 67  bytes 10018 (9.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether 70:ff:76:1d:f1:a3  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536  metric 1
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 82  bytes 6220 (6.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 82  bytes 6220 (6.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500  metric 1
        ether 38:0b:3c:f1:bc:79  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.43.1  netmask 255.255.255.0  broadcast 192.168.43.255
        inet6 fe80::3a0b:3cff:fef1:bc7a  prefixlen 64  scopeid 0x20<link>
        ether 38:0b:3c:f1:bc:7a  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 43  bytes 5962 (5.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

From the output above, the wlan0 and wlan1 interfaces in Linux correspond to the the WiFi Station (STA) and Access Point (AP) modes, respectively. Since wlan0, in Station (STA), connects to an AP to get an IP address, the example shows the SK is not connected (it does not have an IP address). The wlan1 port, which serves as an AP for connections to the SK from another device (ex. phone, tablet, computer). The Processor SDK includes a pre-configured DHCP server for this port to assign IP addresses. As such, it is given a static IP of 192.168.43.1 and will serve IP addresses from a configured pool of addresses in the same 192.168.43.xxx subnet to connected devices.

2.9.7.2. Run the Demos over Wifi

The Processor SDK includes two demos that are web based and use IP connections. Either the Benchmark Demo or the Matrix Demo can be executed using a WiFi connection, either in Station or AP mode. Using these demos is a simple way to test out a WiFi connection once it has been set up.

2.9.7.3. Use Other IP Tools

Once IP addresses are assigned and valid connections made, a number of the usual IP tools can be used to evaluate and use a WiFi connection much like a wired connection.

The ifconfig command like below can be used to check for a valid IP address:

root@am64xx-evm:~# ifconfig wlan0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500  metric 1
        inet 192.168.200.164  netmask 255.255.255.0  broadcast 192.168.200.255
        inet6 fe80::3a0b:3cff:fef1:bc79  prefixlen 64  scopeid 0x20<link>
        ether 38:0b:3c:f1:bc:79  txqueuelen 1000  (Ethernet)
        RX packets 2658  bytes 679188 (663.2 KiB)
        RX errors 0  dropped 15  overruns 0  frame 0
        TX packets 66  bytes 9622 (9.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

In this case, the wlan0 port in STA mode has successfully connected to an AP and received the 192.168.200.164 IP address. If the development host or some other device is on the same network, a ping command can be used to verify basic connectivity.

root@am64xx-evm:~# ping 192.168.200.118
PING 192.168.200.118 (192.168.200.118): 56 data bytes
64 bytes from 192.168.200.118: seq=0 ttl=64 time=12.163 ms
64 bytes from 192.168.200.118: seq=1 ttl=64 time=6.626 ms
64 bytes from 192.168.200.118: seq=2 ttl=64 time=8.360 ms
64 bytes from 192.168.200.118: seq=3 ttl=64 time=7.612 ms
64 bytes from 192.168.200.118: seq=4 ttl=64 time=6.683 ms
64 bytes from 192.168.200.118: seq=5 ttl=64 time=15.989 ms
64 bytes from 192.168.200.118: seq=6 ttl=64 time=113.454 ms
^C
--- 192.168.200.118 ping statistics ---
7 packets transmitted, 7 packets received, 0% packet loss
round-trip min/avg/max = 6.626/24.412/113.454 ms

An SSH connection can be established to the board from the Development Host if they are both in the same network as recommended:

user@user-OptiPlex-7010:$ ssh root@192.168.200.164
root@am64xx-evm:~#

Many users prefer this type of set up once the board is stable and it is no longer necessary to debug the boot loader (U-Boot) on a regular basis.

Finally, the bandwidth between the connected devices can be tested over WiFi as well using something like iperf. In this case, the iperf “server” receiving the packets is run on the development host and the iperf “client” is generating the packets from the target.

Command on the development host:

user@user:$ iperf -s -B 192.168.200.118
------------------------------------------------------------
Server listening on TCP port 5001
Binding to local address 192.168.200.118
TCP window size:  128 KByte (default)
------------------------------------------------------------
[  4] local 192.168.200.118 port 5001 connected with 192.168.200.164 port 38334
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0-12.7 sec  2.88 MBytes  1.90 Mbits/sec

Note

The full output above will not display until the test completes. The -B 192.168.200.118 option above will tell the server to listen to a specific interface, in this case the wlan0 interface.

Command on the target board:

root@am64xx-evm:~#  iperf -c 192.168.200.118
------------------------------------------------------------
Client connecting to 192.168.200.118, TCP port 5001
TCP window size: 85.0 KByte (default)
------------------------------------------------------------
[  3] local 192.168.200.164 port 38334 connected with 192.168.200.118 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-10.4 sec  2.88 MBytes  2.33 Mbits/sec