iotexpresslink3 2.1.0.0
main.c File Reference

IoT ExpressLink 3 Click Example. More...

#include "board.h"
#include "log.h"
#include "iotexpresslink3.h"

Macros

#define WIFI_SSID   "MikroE Public"
 
#define WIFI_PASS   "mikroe.guest"
 
#define APP_BUFFER_SIZE   500
 
#define PROCESS_BUFFER_SIZE   200
 

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

IoT ExpressLink 3 Click Example.

Description

This example demonstrates the use of IoT ExpressLink 3 click board by bridging the USB UART to mikroBUS UART which allows the click board to establish a connection with the IoT ExpressLink over the Quick Connect demo application without an AWS account.

The demo application is composed of two sections :

Application Init

Initializes the driver, resets the click board to factory default settings, reads and displays the vendor model and thing name on the USB UART, sets the WiFi credentials, and attempts to connect to the AWS Cloud. If the initial attempt fails and the error message "Failed to access network" or "Failed to login AWS (MQTT) broker" appears, check the WiFi credentials and try running the example again.

Application Task

All data received from the USB UART will be forwarded to mikroBUS UART, and vice versa. At this point you should disconnect from the UART terminal and run the Quick Connect demo application.

Additional Function

  • static void iotexpresslink3_clear_app_buf ( void )
  • static err_t iotexpresslink3_process ( iotexpresslink3_t *ctx )
  • static err_t iotexpresslink3_read_response ( iotexpresslink3_t *ctx )
Note
To run the demo, follow the below steps:
  1. If you opened a terminal application in the previous step, be sure to disconnect that application from the serial port.
  2. Download the Quick Connect executable: Mac: https://quickconnectexpresslinkutility.s3.us-west-2.amazonaws.com/QuickConnect_v1.9_macos.x64.tar.gz Windows: https://quickconnectexpresslinkutility.s3.us-west-2.amazonaws.com/QuickConnect_v1.9_windows.x64.zip Linux: https://quickconnectexpresslinkutility.s3.us-west-2.amazonaws.com/QuickConnect_v1.9_linux.x64.tar.gz
  3. Unzip the package, and follow the steps from the README file.

The demo will connect to IoT ExpressLink and give you an URL that you can use to visualize data flowing from the device to the cloud using AT+SEND commands. The demo will run for up to two minutes, and afterwards, you will be able to type AT+SEND commands yourself and see the data coming in on the visualizer.

Author
Stefan Filipovic

Macro Definition Documentation

◆ APP_BUFFER_SIZE

#define APP_BUFFER_SIZE   500

◆ PROCESS_BUFFER_SIZE

#define PROCESS_BUFFER_SIZE   200

◆ WIFI_PASS

#define WIFI_PASS   "mikroe.guest"

◆ WIFI_SSID

#define WIFI_SSID   "MikroE Public"

Function Documentation

◆ application_init()

void application_init ( void )

< Logger config object.

< Click config object.

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )