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#

net-init

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#

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 interface at 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
OK

wifi-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#

sl_wifi_stop_statistic_report

Pre-conditions#

wifi-stats-start

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#

  • OK on success

  • ERROR <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 interface at a time.

Examples#

at+wifi-stats-stop=1        # Stop collecting statistics on Wi-Fi client interface
OK

Events#

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#

sl_wifi_stats_callback_t

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_arg parameter in the sl_wifi_set_stats_callback function is set to the interface parameter that is passed in sl_wifi_start_statistic_report. The optional_arg passed back in the callback contains the same interface value and it is used to populate the interface response parameter in the WIFI_STATS event.

  • Statistics may be collected for only one interface at 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