Microchip® Advanced Software Framework

WINC1500 MQTT Chat Example for SAMD21 XPlained Pro Documentation

Introduction

This example demonstrates the use of the WINC1500 with the SAMD21 Xplained Pro board to implement an MQTT based chat. It uses the following hardware:

  • the SAMD21 Xplained Pro.
  • the WINC1500 on EXT1.

Main Files

  • main.c : Initialize the WINC1500, connect to MQTT broker and chat with the other devices.
  • mqtt.h : Implementation of MQTT 3.1

Usage

  1. Configure below code in the main.h for AP information to be connected.
    #define MAIN_WLAN_SSID "DEMO_AP"
    #define MAIN_WLAN_AUTH M2M_WIFI_SEC_WPA_PSK
    #define MAIN_WLAN_PSK "12345678"
  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
    Line-Ending style : LF or CR+LF
  4. Start the application.
  5. In the terminal window, First of all enter the user name through the terminal window.
  6. And after the text of the following is displayed, please enjoy the chat.
  7. Initialization operations takes a few minutes according to the network environment.
    Preparation of the chat has been completed.

Known Issue

  1. The user name cannot contain space (' ').
  2. Cannot send more than 128 bytes.
  3. User name must be unique. If someone uses the same user name, Which one will be disconnected.
  4. USART interface has not error detection procedure. So sometimes serial input is broken.

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 Atmel.