Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
WILC1000/WILC3000 Weather WiFi Concurrent Mode and Bluetooth Demo for SAM4S XPlained Pro Documentation

Introduction

This example demonstrates the use of the WILC with the SAM Xplained Pro board using WiFi concurrent mode STA/AP. STA mode is used to connect to a home router with internet connection to retrieve weather information. AP mode is used to allow any WiFi capable devices to connect to the WILC and then access an embedded webserver to read weather information as well as host MCU status (up to 7 connected stations at the same time).

To access the HTTP server connect with your laptop to WiFi network "WILC", then open a browser at http://192.168.5.1

It uses the following hardware:

  • the SAM Xplained Pro.
  • the WILC on EXT1 (WINC can be used as well in bypass mode).
  • WILC SD board can also be used connected to the SD Card Connector, with IRQ line connected to Ex1[9]

Main Files

  • main.c : Initialize the FreeRTOS scheduler.
  • sta.c : Enable STA and AP mode for WILC. Retrieve weather information via STA mode.
  • ap.c : Enable HTTP server via AP mode.

Usage

  1. Configure below defines in sta.h to specify AP to connect to.
    * #define STA_WLAN_SSID "DEMO_AP"
    * #define STA_WLAN_PSK "12345678"
    * #define STA_WEP_KEY_INDEX M2M_WIFI_WEP_KEY_INDEX_1
    * #define STA_WEP_KEY "1234567890"
    * #define STA_WEP_AUTH_TYPE WEP_ANY
    *
    1. Configure below defines in sta.h to specify WILC AP mode to start with.
      * #define AP_WLAN_SSID "WILC1000_AP"
      * #define AP_WLAN_PSK "12345678"
      * #define AP_WEP_KEY_INDEX M2M_WIFI_WEP_KEY_INDEX_1
      * #define AP_WEP_KEY "1234567890"
      * #define AP_WEP_AUTH_TYPE WEP_ANY
      *
  2. Build the program and download it into the board.
  3. On the computer, open and configure a terminal application as the follows.
    * Baud Rate : 115200
    * Data : 8bit
    * Parity bit : none
    * Stop bit : 1bit
    * Flow control : none
    *
  4. Start the application.
  5. In the terminal window, the following text should appear:
    * -- Weather concurrent an BT demo --
    * -- SAMXXX_XPLAINED_PRO --
    * -- Compiled: Oct 19 2015 14:39:47 --
    *
    * wifi_cb: STA M2M_WIFI_REQ_DHCP_CONF
    * wifi_cb: STA IPv4 addr: xxx.xxx.xxx.xxx
    * wifi_cb: STA IPv6 addr: xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx
    * wifi_cb: AP M2M_WIFI_CONNECTED xx-xx-xx-xx-xx-xx
    *

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.