|
| 1 | +.. zephyr:code-sample:: siwx91x_ota |
| 2 | + :name: HTTP OTA Firmware Update on SiWx917 |
| 3 | + :relevant-api: wifi |
| 4 | + |
| 5 | + Demonstrates HTTP/HTTPS OTA firmware update using SiWx917 on Zephyr. |
| 6 | + |
| 7 | +Overview |
| 8 | +******** |
| 9 | + |
| 10 | +Application demonstrates how to perform HTTP/HTTPS OTA firmware updates on the |
| 11 | +SiWx917 platform using Zephyr RTOS. It connects to a Wi-Fi network, establishes |
| 12 | +a secure HTTPS connection using a CA certificate, and downloads firmware |
| 13 | +updates from a remote server. The application showcases secure connectivity and |
| 14 | +OTA update mechanisms for IoT devices. |
| 15 | + |
| 16 | +Requirements |
| 17 | +************ |
| 18 | + |
| 19 | +* SiWx917 development board with Wi-Fi support |
| 20 | +* HTTP server |
| 21 | + |
| 22 | +Configurations |
| 23 | +************** |
| 24 | + |
| 25 | +The following configurations can be modified in ``prj.conf``: |
| 26 | + |
| 27 | +* Wi-Fi Settings |
| 28 | + * ``CONFIG_OTA_WIFI_SSID`` - Network name |
| 29 | + * ``CONFIG_OTA_WIFI_PSK`` - Network password |
| 30 | + * ``CONFIG_OTA_WIFI_SECURITY_TYPE`` - wifi security type (0 - no security, 1 - WPA2-PSK security) |
| 31 | + * ``CONFIG_OTA_IP_PROTOCOL_SELECTION`` - Select IPv4 or IPv6 |
| 32 | + |
| 33 | +* OTA Server Settings |
| 34 | + * ``CONFIG_OTA_SERVER_IP`` or ``CONFIG_OTA_SERVER_HOSTNAME`` - Server address |
| 35 | + * ``CONFIG_OTA_SERVER_PORT`` - Server port |
| 36 | + * ``CONFIG_OTA_RPS_FILE`` - Firmware file on server |
| 37 | + * ``CONFIG_OTA_HTTPS_SUPPORT`` - Enable HTTPS (default: disabled) |
| 38 | + * ``CONFIG_OTA_USE_DNS_RESOLVER`` - Enable DNS resolution (set to 1 to use |
| 39 | + ``CONFIG_OTA_SERVER_HOSTNAME``) |
| 40 | + |
| 41 | +.. _signed image generation: |
| 42 | + https://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SIWX91X_SIGN_KEY |
| 43 | + |
| 44 | +Building and Running |
| 45 | +******************** |
| 46 | + |
| 47 | +1. Configure required settings |
| 48 | +2. Build and Flash |
| 49 | + |
| 50 | + .. code-block:: console |
| 51 | +
|
| 52 | + west build -b siwx917_rb4338a siwx917_ota -p |
| 53 | + west flash |
| 54 | +
|
| 55 | +3. Run HTTP/HTTPS server |
| 56 | + |
| 57 | +Host Server Setup |
| 58 | +***************** |
| 59 | + |
| 60 | +1. Python HTTPS Server |
| 61 | + |
| 62 | + .. code-block:: console |
| 63 | +
|
| 64 | + cd <server_directory> |
| 65 | + python <http/https server script> |
| 66 | +
|
| 67 | +2. Server Requirements |
| 68 | + |
| 69 | + * Python 3.13 |
| 70 | + * server-cert.pem and server-key in server directory |
| 71 | + * Firmware files (.rps) in server directory |
| 72 | + |
| 73 | +Test the Application |
| 74 | +******************** |
| 75 | + |
| 76 | +1. After flashing the SiWx91x, the device will scan for the specified AP and |
| 77 | + attempt to connect if found. |
| 78 | +2. Once connected, the SiWx91x will initiate an HTTP/S connection to the specified |
| 79 | + server and download the firmware binary. |
| 80 | +3. The OTA update process will be logged to the serial console. |
| 81 | + |
| 82 | +Note |
| 83 | +**** |
| 84 | + |
| 85 | +This application is not for production. |
0 commit comments