Introduction
This example demonstrates how to connect to an HTTP server and download a file using HTTP client.
It uses the following hardware:
- the SAM Xplained Pro.
- the WINC1500 on EXT1.
- the IO1 Xplained Pro on EXT2.
Main Files
- main.c : Initialize the SD card and WINC1500 Wi-Fi module, then download a file using HTTP client.
Usage
- Configure below code in the main.h for AP information to be connected.
- Configure HTTP URL macro in the main.h file.
* #define
MAIN_HTTP_FILE_URL "http://www.microchip.com/Images/45093A-SmartConnectWINC1500_E_US_101014_web.pdf"
*
- Build the program and download it into the board.
- On the computer, open and configure a terminal application as following.
* Baud Rate : 115200
* Data : 8bit
* Parity bit : none
* Stop bit : 1bit
* Flow control : none
*
- Start the application.
- In the terminal window, the following text should appear:
* -- HTTP file downloader example --
* -- SAMXXX_XPLAINED_PRO --
* -- Compiled: xxx xx xxxx xx:xx:xx --
*
* This example requires the AP to have internet access.
*
*
main: connecting to WiFi AP DEMO_AP...
*
wifi_cb: IP address is 192.168.1.107
*
resolve_cb: www.atmel.com IP address is 72.246.56.186
*
*
store_file_packet: creating file [0:45093A-SmartConnectWINC1500_E_US_101014_web.pdf]
* ...
*
main: please unplug the SD/MMC card.
*
Compilation Information
This software was written for the GNU GCC compiler using Atmel Studio 6.2 Other compilers may or may not work.
Contact Information
For further information, visit Microchip.