Network Interface AT Commands#
This section describes AT commands for configuring and controlling network interfaces on the SiWx91x device.
Commands#
oper-mode#
Configure the operation mode of the SiWx91x device.
Command Format#
at+oper-mode=<oper-mode>Related SDK API
sl_wifi_device_configuration_t->boot_config->oper_mode
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-initwas not sent earlier
Parameters#
oper-mode#
The operation mode of the device. Contains a numeric value that corresponds to one of the values of the enum sl_wifi_operation_mode_t.
Note: The enum values of sl_wifi_operation_mode_t are not in strict numerical order. Refer to sl_wifi_types.h for the actual numeric values in this enum.
Response#
OKon successERROR 1in case of failure
Notes#
Enterprise Client Mode and Transceiver Mode are not currently supported.
Concurrent Mode is not currently supported, due to the AP related commands not being supported.
The
oper-modeset by this command will have no effect if the command is sent out of sequence (see Pre-conditions above).This command is optional. If it is not sent, the oper-mode defaults to 0 (client mode), and the Wi-Fi device configuration parameters are set to their default values as described in the table below.
If this command is sent, it must either be the first command in the session or the first command sent after
net-deinit. An error code will be returned if this command is sent out of sequence.The Wi-Fi device configuration parameters are defaulted based on
oper-mode(see table below).Other Configuration-related AT commands sent after this (for example,
at+region-code) will override the specified parameters.
oper-mode | Default Configuration that is set from sl_wifi_device.h |
|---|---|
0 | sl_wifi_default_client_configuration |
6 | sl_wifi_default_ap_configuration |
8 | sl_wifi_default_transmit_test_configuration |
Examples#
at+oper-mode=0 # Set the device operation mode to client mode
OKcoex-mode#
Set the coexistence mode for the SiWx91x device.
Command Format#
at+coex-mode=<coex-mode>Related SDK API
sl_wifi_system_boot_configuration_t::coex_mode
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-initwas not sent earlier
Parameters#
coex-mode#
Coexistence mode. Contains a numeric value that corresponds to one of the values of the enum sl_wifi_system_coex_mode_t.
Note:
SL_WIFI_SYSTEM_BLE_MODEis not currently supported. To enable BLE on the SiWx91x device,coex-modemust be set to 7 (SL_WIFI_SYSTEM_WLAN_BLE_MODE) to enable both Wi-Fi and BLE.
Response#
OKon successERROR 1in case of failure
Notes#
The
coex-modeset by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).When the
coex-modeis set to enable BLE (by setting it to 7), theSL_SI91X_ENABLE_BLE_PROTOCOLbit insl_wifi_system_boot_configuration_t::bt_feature_bit_map will be set to 1 and the remaining BLE related feature settings will be set to default values in thesl_wifi_system_boot_configuration_t::ble_feature_bit_map andsl_wifi_system_boot_configuration_t::ble_ext_feature_bit_map.You can override some of these default values by using the following commands:
Examples#
at+coex-mode=0 # Set coexistence mode to WLAN Only mode
OKmac-addr#
Set the MAC address of the SiWx91x device.
Command Format#
at+mac-addr=<mac-address>Related SDK API
sl_wifi_device_configuration_t::mac_address
Pre-conditions#
net-deinit if net-init was sent earlier
None if net-init was not sent earlier
Parameters#
mac-address#
The MAC address to be set for the SiWx91x device, represented as a series of characters from a 6 byte MAC Address string with a colon (:) separating each byte (see example below).
Response#
OKon successERROR 1in case of failure
Notes#
The
mac-addressset by this command will have no effect if this command is sent out of sequence (see Pre-conditions above).
Examples#
at+mac-addr=6c:5c:b1:c7:12:69 # Set the MAC address of SiSiWx91x deviceregion-code#
Set the WLAN region of the SiWx91x device.
Command Format#
at+region-code=<region-code>Related SDK API
sl_wifi_device_configuration_t::region_code
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-initwas not sent earlieroper-mode=0(Client)If you do not explicitly send the commands, 'oper-mode' will use default values.
Parameters#
region-code#
Numeric value from enum sl_wifi_region_code_t
Note: Some values are not currently supported, as indicated in the linked documentation.
Response#
OKon successERROR 1in case of failure
Notes#
The
region-codeset by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
at+region-code=1 # Set region to USenable-ssl#
Enable or disable SSL in the network stack.
Command Format#
at+enable-ssl=<enable-ssl>Related SDK API
SL_SI91X_TCP_IP_FEAT_SSL bit in sl_wifi_device_configuration_t::boot_config->tcp_ip_feature_bit_map
Parameters#
enable-ssl#
Set to 0 to disable or 1 to enable SSL.
Pre-conditions#
net-deinit if net-init was sent earlier
None if net-init was not sent earlier
oper-mode=0(Client)If you do not explicitly send the commands,
oper-modewill use default values.
Response#
OKon successERROR 1in case of failure
Notes#
The enable-ssl flag set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
at+enable-ssl=1 # Enable SSL
at+enable-ssl=0 # Disable SShttp-client-mode#
Enable or disable the HTTP client in the SiWx91x network processor.
Command Format#
at+http-client-mode=<mode>Related SDK API
Set SL_SI91X_TCP_IP_FEAT_HTTP_CLIENT (bit 7) to 1 or 0 based on the mode parameter, in sl_wifi_device_configuration_t->boot_config->tcp_ip_feature_bit_map
Pre-conditions#
net-deinit if net-init was sent earlier
None if net-init was not sent earlier
Parameters#
mode#
Set to 1 or 0 to enable or disable the embedded HTTP client. In future releases, additional values starting at 2 may be added to support alternative HTTP clients, such as those provided by AWS or Azure.
Response#
OKon success.ERROR 1in case of failure
Notes#
The mode flag set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
at+http-client-mode=1 # Enable embedded HTTP
OK
at+http-client-mode=0 # Disable embedded HTTP
OKenable-nwp-mqtt#
Enable or disable the embedded MQTT client using TCP sockets from the SiWx91x network processor.
Command Format#
at+enable-nwp-mqtt=<enable>Related SDK API
Set bit 31 to 1 in
sl_wifi_device_configuration_t->boot_config->tcp_ip_feature_bit_mapSet bit 17 to the
enableparameter (1 or 0), insl_wifi_device_configuration_t->boot_config->ext_tcp_ip_feature_bit_map
Pre-conditions#
net-deinit if net-init was sent earlier
None if net-init was not sent earlier
Parameters#
enable#
Set to 1 or 0 to enable or disable the embedded MQTT client.
Response#
OKon successERROR 1in case of failure
Notes#
The enable flag set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
at+enable-nwp-mqtt=1 # Enable embedded MQTT
OK91x-ble-enable-gatt#
Enable or disable Generic Attribute Profile (GATT) services for BLE on the SiWx91x device.
Command Format#
at+91x-ble-enable-gatt=<enable-gatt>Related SDK API
SL_SI91X_BLE_GATT_INIT bit in sl_wifi_system_boot_configuration_t::ble_ext_feature_bit_map
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-initwas not sent earlier
Parameters#
enable-gatt#
Set to 0 to disable or 1 to enable GATT services.
Response#
OKon successERROR 1in case of failure
Notes#
The enable-gatt flag set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
at+91x-ble-enable-gatt=1 # Enable GATT services
OK91x-ble-max-per#
Set the maximum number of BLE peripherals for the SiWx91x device.
Command Format#
at+91x-ble-max-per=<max-peripherals>Related SDK API
SL_SI91X_BLE_MAX_NBR_PERIPHERALS value in sl_wifi_system_boot_configuration_t::ble_feature_bit_map
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-initwas not sent earlier
Parameters#
max-peripherals#
Maximum number of BLE peripherals that can be connected simultaneously.
Response#
OKon successERROR 1in case of failure
Notes#
The max-peripherals value set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
at+91x-ble-max-per=4 # Set maximum number of BLE peripherals to 4
OK91x-ble-max-cent#
Set the maximum number of BLE centrals for the SiWx91x device.
Command Format#
at+91x-ble-max-cent=<max-centrals>
OKRelated SDK API
SL_SI91X_BLE_MAX_NBR_CENTRALS value in sl_wifi_system_boot_configuration_t::ble_feature_bit_map
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-initwas not sent earlier
Parameters#
max-centrals#
Maximum number of BLE centrals that can be connected simultaneously.
Response#
OKon successERROR 1in case of failure
Notes#
The max-centrals value set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
at+91x-ble-max-cent=2 # Set maximum number of BLE centrals to 2
OK91x-ble-max-gatt-srv#
Set the maximum number of GATT services for the SiWx91x device.
Command Format#
at+91x-ble-max-gatt-srv=<max-gatt-services>Related SDK API
SL_SI91X_BLE_MAX_NBR_ATT_SERV value in sl_wifi_system_boot_configuration_t::ble_feature_bit_map
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-initwas not sent earlier
Parameters#
max-gatt-services#
Maximum number of GATT services that can be supported simultaneously.
Response#
OKon successERROR 1in case of failure
Notes#
The max-gatt-services value set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
at+91x-ble-max-gatt-srv=8 # Set maximum number of GATT services to 8
OK91x-ble-max-attr#
Set the maximum number of BLE attributes for the SiWx91x device.
Command Format#
at+91x-ble-max-attr=<max-attributes>Related SDK API
SL_SI91X_BLE_MAX_NBR_ATT_REC value in sl_wifi_system_boot_configuration_t::ble_feature_bit_map
Pre-conditions#
net-deinit if net-init was sent earlier
None if
net-initwas not sent earlier
Parameters#
max-attributes#
Maximum number of BLE attributes that can be supported simultaneously.
Response#
OKon successERROR 1in case of failure
Notes#
The max-attributes value set by this command will have no effect if this command is sent out of sequence or under the wrong conditions (see Pre-conditions above).
Examples#
at+91x-ble-max-attr=16 # Set maximum number of BLE attributes to 16
OKnet-init#
Initialize a network interface.
Command Format#
at+net-init=<interface>Related SDK API
Pre-conditions#
None
Parameters#
interface#
Numeric value from enum sl_net_interface_t. Note some values are not currently supported, as indicated in the linked documentation.
Note: The enum values of sl_net_interface_t are not in the default numerical order of an enum. See sl_net_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 sl_net_init API.
Notes#
To use non-default values for specific network configuration parameters, send the following optional AT commands before sending sl_net_init:
oper-mode
mac-addr
region-code
enable-ssl
Notes: - The nwp_pool and efuse_data_type configuration parameters will be supported in a future cycle. - The band_mode configuration parameter is not currently supported because 2.4 GHz is the only band available on SiWx91x.
TCP/IP bypass mode is not supported for AT commands in SoC mode on the SiWx91x.
Example#
at+net-init=8 # Initialize the default Wi-Fi client interface
OKnet-up#
Bring up a network interface by establishing a connection over the specified interface using the specified networking profile.
Command Format#
at+net-up=<interface>,<profile-id>Related SDK API
Pre-conditions#
Parameters#
interface#
The network interface for which a network connection is to be established. Contains a numeric value that corresponds to one of the values of the enum sl_net_interface_t. Note some values are not currently supported, as indicated in the linked documentation.
Note: The enum values of sl_net_interface_t are not in the default numerical order of an enum. See sl_net_constants.h for the actual numeric values in this enum.
profile-id#
The networking profile that contains saved details, such as the SSID of the Access Point, to use when establishing a connection. Contains a numeric value that corresponds to one of the values of the enum sl_net_profile_id_t.
Response#
OKon successERROR <error code>in case of failure. Possible error codes are the same as those returned by sl_net_up API.
Notes#
The
profile-idshould have been previously saved using one of the Network Profile AT commands.
Example#
at+net-up=8,0 # Bring up the Wi-Fi interface using profile ID 0
OKnet-down#
Bring down a network interface by terminating the network connection over the specified interface.
Command Format#
at+net-down=<interface>Related SDK API
Pre-conditions#
Parameters#
interface#
The network interface for which a network connection is to be terminated. Contains a numeric value that corresponds to one of the values of the enum sl_net_interface_t. Note some values are not currently supported, as indicated in the linked documentation.
Note: The enum values of sl_net_interface_t are not in the default numerical order of an enum. See sl_net_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 sl_net_down API.
Examples#
at+net-down=8 # Bring down the Wi-Fi interfacenet-deinit#
De-initialize a network interface.
Command Format#
at+net-deinit=<interface>Related SDK API
Pre-conditions#
Parameters#
interface#
The type of network interface to be de-initialized. Contains a numeric value that corresponds to one of the values of the enum sl_net_interface_t. Note some values are not currently supported, as indicated in the linked documentation.
Note: The enum values of sl_net_interface_t are not in the default numerical order of an enum. See sl_net_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 sl_net_deinit API.
Examples#
at+net-deinit=8 # De-initialize the Wi-Fi interfacenet-info#
Get network interface information for the SiWx91x device.
Command Format#
at+net-info=<interface>Related SDK API
Pre-conditions#
Parameters#
interface#
Numeric value from enum sl_net_interface_t. Note some values are not currently supported, as indicated in the linked documentation.
Note: The enum values of sl_net_interface_t are not in the default numerical order of an enum. See sl_net_constants.h for the actual numeric values in this enum.
Response#
OK <ipv4-address> <ipv6-address> <wlan-state> <channel-number> <ssid> <sec-type> <psk-pmk> <bssid> <wireless-mode> <mac-address>on success, where:<ipv4-address>is a string denoting the IPv4 address of the interface<ipv6-address>is a string denoting the IPv6 address of the interface<wlan-state>is a number denoting the current WLAN state when in Station mode, or the number of connected stations in AP mode, with one of the following possible values:0: disconnected
1: connected
<channel-number>is the Wi-Fi channel number (1-14)<ssid>is a string denoting the SSID of the connected AP (Station mode) or the module (AP mode)<sec-type>is a number denoting the security type (Station mode only), having one of the possible values of the enum sl_wifi_security_t<psk-pmk>is a string denoting the Pre-Shared Key (PSK) in AP mode or Pairwise Master Key (PMK) in Station mode (64 bytes)<bssid>is the BSSID of the connected AP (Station mode only), represented as a series of characters from a 6 byte BSSID string with a colon (:) separating each byte<wireless-mode>is a number denoting the wireless mode, with one of the following possible values:1: 802.11b
3: 802.11g
4: 802.11n
6: 802.11ax
<mac-address>is the MAC address of the module, represented as a series of characters from a 6 byte MAC address string with a colon (:) separating each byte
ERROR 1in case of failure
Notes#
AP mode is not currently supported using AT commands, so the above command currently only returns values for Station mode
Examples#
at+net-info=8 # Get Wi-Fi client interface information
OK 192.168.1.100 2001:db8::1 1 6 MyNetwork 3 1234567890abcdef 00:11:22:33:44:55 4 00:aa:bb:cc:dd:ee