Table of Contents

Overview

This example demonstrates how to connect to a server, download a file using the HTTP Client library, and save it to the serial flash. This scheme can be used by developers to update any file over the network.

Application Details

This application will:

Users can change the server and the requested file by changing the MACRO PREFIX_BUFFER, POST_BUFFER, and HOST_NAME.
Size of the saved file can be changed by changing the MACRO SIZE_40K, but users must delete the existing file FILE_NAME.

This application requires an Access Point with internet.

Usage

  1. Open main.c and set SSID_NAME, SEC_TYPE and PASSKEY.
  2. Setup a serial communication application. Open a serial terminal on a PC with the following settings:
    • Port: Enumerated COM port
    • Baud rate: 115200
    • Data: 8 bit
    • Parity: None
    • Stop: 1 bit
    • Flow control: None
  3. Build and run the application.
    • Debug to load the application to the device, or flash the binary using UniFlash.
  4. Upon connection, the application tries to connect to the “www.google.com”, requests a file from the server, and saves it to the serial flash as FILE_NAME. A successful message will appear on the terminal.

Limitations/Known Issues