AT Commands for Firmware Update from Module#
This page describes the AT commands used to perform firmware updates on the SiWx91x device directly from the module. These commands allow the device to download and update its firmware from an HTTP/TCP server over-the-air (OTA).
Commands#
http-otaf#
Performs an HTTP Over-the-air firmware update (OTAF) on the SiWx91x device by downloading firmware from a specified HTTP server.
Command Format#
at+http-otaf=<flags>,<server_ip_addr>,<port>,<resource_url>[,<host_name>][,<extended_header>][,<user_name>][,<password>]Related SDK API
Pre-conditions#
None
Parameters#
flags#
Numeric value specifying a bitmap of OTA update flags. For possible values, see the sl_si91x_http_otaf API documentation.
server_ip_addr#
A string denoting the IP address of the HTTP server hosting the firmware image (see example below).
port#
Port number. Default: 80 - HTTP, 443 - HTTPS
resource_url#
The relative uniform resource identifier (URI) to the firmware image on the HTTP server (see example below).
host_name#
Optional. The HTTP host name. Can be left empty if not required.
extended_header#
Optional. Any additional HTTP headers to include in the request. Can be left empty if not required.
user_name#
Optional. Username for HTTP authentication. Can be left empty if not required.
password#
Optional. Password for HTTP authentication. Can be left empty if not required.
Response#
OKon successful initiation of the OTA updateERROR <error code>in case of failure. Possible error codes are the same as those returned by the sl_si91x_http_otaf API.
Notes#
The device may reboot automatically after a successful firmware update.
Ensure the firmware image is compatible with the device and properly signed if required.
Examples#
at+http-otaf=0,192.168.1.100,80,/fw/si91x_fw.binfwup-otaf#
Initiate Over-The-Air Firmware (OTAF) update by downloading the image from a specified TCP server.
Command Format#
at+fwup-otaf=<server-ip>,<server-port>,<chunk-number>,<timeout>,<tcp-retry-count>Related SDK API
sl_si91x_ota_firmware_upgradation
Pre-conditions#
Parameters#
server-ip#
The server IP address. Contains an IPv4 or IPv6 address in string format.
server-port#
Contains a numeric value that corresponds to the port number.
chunk-number#
Contains a numeric value that corresponds to the firmware content request chunk number.
timeout#
The TCP receive packet timeout in milliseconds.
tcp-retry-count#
Contains a numeric value that corresponds to the number of TCP retransmissions.
Response#
OKon successfully initiating the OTAF processERROR <error-code>in case of failure. Possible error codes are the same as those returned by the sl_si91x_ota_firmware_upgradation API.
Notes#
A safe firmware upgrade via TCP server takes approximately 65 seconds for a 1.5 MB firmware file.
The status of the OTAF update process is reported via the [FWUP_OTAF_STATUS] (#fwup-otaf-status) event.
Examples#
at+fwup-otaf="192.168.1.100",8080,10,5000,3 # Initiate OTAF update from server at 192.168.1.100:8080
OKEvents#
[FWUP_OTAF_STATUS] (#fwup-otaf-status)
FWUP_OTAF_STATUS#
Firmware update status event that provides the status of a TCP-based OTAF update process.
Event Message Format#
at+FWUP_OTAF_STATUS=<status>,<chunk-number>Related SDK API
sl_net_event_handler_t for the event SL_NET_OTA_FW_UPDATE_EVENT
Parameters#
status#
The status of the OTAF update process. A value of 0 indicates success and 1 indicates failure.
chunk-number#
On success (status = 0), this value is -1. On failure (status = 1), this value corresponds to the firmware request chunk number where the failure occurred.
Notes#
This event is triggered in response to the fwup-otaf command.
Examples#
at+FWUP_OTAF_STATUS=0,-1 # OTAF update successful
at+FWUP_OTAF_STATUS=1,5 # OTAF update failed at chunk number 5