Debugging AT Commands#
Overview#
This section describes debugging AT commands for collecting Wi-Fi operational statistics on SiWx91x devices.
Commands#
wifi-stats-start#
Start collecting statistical data for a specific Wi-Fi interface on the SiWx91x device.
Command Format#
at+wifi-stats-start=<wifi-interface>,<channel>,<band>,<bandwidth>Related SDK API
sl_wifi_start_statistic_report
Pre-conditions#
Parameters#
wifi-interface#
The Wi-Fi interface for collecting statistics. Contains a numeric value that corresponds to one of the values of the enum sl_wifi_interface_t.
Note: The enum values of sl_wifi_interface_t are not in strict numerical order. Refer to sl_wifi_constants.h for the actual numeric values in this enum.
channel#
The Wi-Fi channel number for collecting statistics. Contains a numeric value that corresponds to the channel number.
band#
The Wi-Fi radio band for the channel. Contains a numeric value that corresponds to one of the values of the enum sl_wifi_band_t.
bandwidth#
The bandwidth of the channel. Contains a numeric value that corresponds to one of the values of the enum sl_wifi_bandwidth_t.
Response#
OKon successERROR <error-code>in case of failure. Possible error codes are the same as those returned by the sl_wifi_start_statistic_report API.
Notes#
This command starts collecting statistical data for the specified Wi-Fi interface and channel. The statistics will be reported via the [WIFI_STATS] (#wifi-stats) event.
Statistics may be collected for only one
interfaceat a time.
Examples#
at+wifi-stats-start=1,6,0,0 # Start collecting statistics on Wi-Fi client interface, channel 6, 2.4 GHz band, 20 MHz bandwidth
OKwifi-stats-stop#
Stop collecting statistical data for a specific Wi-Fi interface on the SiWx91x device.
Command Format#
at+wifi-stats-stop=<interface>Related SDK API
Pre-conditions#
Parameters#
interface#
Use this Wi-Fi interface to stop collecting statistics. Contains a numeric value that corresponds to one of the values of the enum sl_wifi_interface_t.
Note: The enum values of sl_wifi_interface_t are not in strict numerical order. Refer to sl_wifi_constants.h for the actual numeric values in this enum.
Response#
OKon successERROR <error-code>in case of failure. Possible error codes are the same as those returned by the sl_wifi_stop_statistic_report API.
Notes#
This command stops collecting statistical data for the specified Wi-Fi interface.
You may collect statistics for only one
interfaceat a time.
Examples#
at+wifi-stats-stop=1 # Stop collecting statistics on Wi-Fi client interface
OKEvents#
WIFI_STATS#
Wi-Fi statistics event that provides transmit and receive statistics for the SiWx91x device.
Event Message Format#
at+WIFI_STATS=<interface>,<tx-pkts>,<reserved-1>,<tx-retries>,<crc-pass>,<crc-fail>,<cca-stuck>,<cca-not-stuck>,<pkt-aborts>,<false-rx-starts>,<cca-idle>,<reserved-2>,<rx-retries>,<reserved-3>,<cal-rssi>,<reserved-4>,<tx-dropped>,<max-cons-pkts-dropped>,<reserved-5>,<bss-brodcast-pkts>,<bss-multicast-pkts>,<bss-filt-match-mult-pkts>Related SDK API
Parameters#
interface#
The Wi-Fi interface for reporting statistics. Contains a numeric value that corresponds to one of the values of the enum sl_wifi_interface_t.
Note: The enum values of sl_wifi_interface_t are not in strict numerical order. Refer to sl_wifi_constants.h for the actual numeric values in this enum.
tx-pkts#
Number of transmitted packets.
reserved-1#
Reserved field. Will be returned as 0.
tx-retries#
Number of transmit retries.
crc-pass#
Number of packets with valid CRC.
crc-fail#
Number of packets with CRC failures.
cca-stuck#
Number of times Clear Channel Assessment (CCA) was stuck.
cca-not-stuck#
Number of times CCA was not stuck.
pkt-aborts#
Number of packet aborts.
false-rx-starts#
Number of false receive starts.
cca-idle#
CCA idle time.
reserved-2#
Reserved field. Will be returned as 0.
rx-retries#
Number of receive retries.
reserved-3#
Reserved field. Will be returned as 0.
cal-rssi#
Calibrated RSSI value.
reserved-4#
Reserved field. Will be returned as 0.
tx-dropped#
Number of transmitted packets dropped after maximum retries.
max-cons-pkts-dropped#
Maximum consecutive packets dropped.
reserved-5#
Reserved field. Will be returned as 0.
bss-brodcast-pkts#
BSSID matched broadcast packets count.
bss-multicast-pkts#
BSSID matched multicast packets count.
bss-filt-match-mult-pkts#
BSSID and multicast filter matched packets count.
Notes#
The
optional_argparameter in the sl_wifi_set_stats_callback function is set to theinterfaceparameter that is passed in sl_wifi_start_statistic_report. Theoptional_argpassed back in the callback contains the sameinterfacevalue and it is used to populate theinterfaceresponse parameter in theWIFI_STATSevent.Statistics may be collected for only one
interfaceat a time.
Examples#
at+WIFI_STATS=1,1500,0,25,1480,20,5,95,2,1,200,0,3,0,-45,0,5,3,0,100,50,25