Introduction
This example demonstrates the use of the Wi-Fi module with the SAMD21 Xplained Pro board to connect to AWS .
It uses the following hardware:
- the SAMD21 Xplained Pro.
- the WINC3400 on EXT1.
Main Files
- main.c : Initialize the Wi-Fi module and connect to server using SSL.
Usage
- The connection parameters can be configured in main.h.
- Build the program and download it into the board.
- 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
*
- Start the application.
- The application uses AWS_IOT_ALPN_ENABLED macro to enable ALPN connection on port 443 with an AWS IOT MQTT server
- Disable AWS_IOT_ALPN_ENABLED macro in the properties to disable ALPN(Application Layer Protocol Negotiation)
- Warning
* -- AWS IoT Demo --
* -- SAMXXX_XPLAINED_PRO --
* -- Compiled: Jun xx xxxx xx:xx:xx --
* (APP)(
INFO)Chip ID 3400d2
* (APP)(
INFO)Curr driver ver: x.x.x
* (APP)(
INFO)Curr driver HIF Level: (2) x.x
* (APP)(
INFO)Fw HIF: 8104
* (APP)(
INFO)Firmware HIF (2) : x.x
* (APP)(
INFO)Firmware ver : x.x.x
* (APP)(
INFO)Firmware Build <Month> DD YYYY Time xx:xx:xx
* (APP)(
INFO)Ota HIF: 0000
* (APP)(
INFO)No valid Ota image
* (APP)(ERR)[
hif_isr][674]Socket callback is not registered
* (APP)(ERR)[
hif_isr][705](hif) host app didn't set RX Done <2><4A>
* Received time
* Connecting...Host IP is x.xx.xx.xxx
* Host Name is xxxxxxxxxxxxx-xxx.xxx.xx-xxxx-x.amazonaws.com
*
* ALPN mode enabled
* (APP)(
INFO)Socket 0 session ID = 1
* Successfully connected.
* Negotiated Amazon MQTT.
* Subscribing...Subscription success
* Subscribe callback
* WINC3400_IOT/sub
* {
* "message": "Hello from AWS IoT console"
* }
* For using AWS connection, the AWS RSA certificate must be installed.
* Download the RSA certificate using the firmware upgrade. (Refer to WINC3400 Software User Guide.)
*
Compilation Information
This software was written for the GNU GCC compiler using Atmel Studio 6.2 Other compilers are not guaranteed to work.
Contact Information
For further information, visit Microchip.