2.9.12. Wireless Networking¶
2.9.12.1. Overview¶
The Processor SDK for Linux includes networking support right out of the box. The AM62x 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.
The network interfaces can be seen in Linux by using the below commands executed on a SK:
# 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 WiFi Station (STA) and Access Point (AP) modes, respectively. The wlan0 STA port connects to an AP to get an IP address. In this example, the SK is not connected to an AP, so wlan0 does not have an IP address. The wlan1 AP port serves as an AP for connections to the SK from another device (e.g., phone, tablet, or computer). The Processor SDK includes a pre-configured DHCP server that wlan1 uses to assign IP addresses. As such, wlan1 is given a static IP address of 192.168.43.1. wlan1 serves IP addresses from a configured pool of addresses in the same 192.168.43.xxx subnet to connected devices.
2.9.12.2. Run the Demos over Wifi¶
The Processor SDK includes a demo that is web based and use IP connections. The Matrix Demo can be executed using a WiFi connection, either in Station or AP mode. This demo is a simple way to test out a WiFi connection once the WiFi connection has been set up.
2.9.12.3. Use Other IP Tools¶
Once IP addresses are assigned and valid connections are made, many of the usual IP tools that are used to evaluate a wired connection can also be used to evaluate a WiFi connection.
The ifconfig
command can be used to check for a valid IP address:
# 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.
# 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 from the development host to the target board if the host and target are both in the same network:
user@host:~$ ssh root@192.168.200.164
root@am62xx-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
with a tool like iperf
. In this case, the iperf “server” receiving
the packets is the development host, and the iperf “client” generating
the packets is the target EVM.
Command on the development host:
user@host:~$ 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 tells the server to listen to a
specific interface, in this case the wlan0 interface.
Command on the target board:
# 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