8.10.3 Antenna Selection
The antenna used can be selected using the iw tool to either select Fixed Manual
mode (antenna1 or antenna2) or automatic switching according to the antenna performance
as follows:
- Set the Antenna 1, using the
following
command:
iw phy phy0 set antenna 1 1
- Set the Antenna 2, using the
following
command:
iw phy phy0 set antenna 2 2
- Enable Automatic switching, using
the following
command:
iw phy phy0 set antenna 3 3
Note:- WILC exposes two phy devices; therefore, both devices can be used to set the antenna selection, but the same antenna selection is applied to both the devices. Also, before setting the antenna selection, the antenna switch control GPIOs must be configured.
- Appropriate phy device value can be verified from the following
command:
iw dev
In Manual modes, the GPIOs is set according to the following tables.
Antenna Selected | GPIO1 Value |
---|---|
Antenna 1 | 1 |
Antenna 2 | 0 |
Antenna Selected | GPIO1 Value | GPIO2 Value |
---|---|---|
Antenna 1 | 1 | 0 |
Antenna 2 | 0 | 1 |