wizfi360 2.2.0
Loading...
Searching...
No Matches
wizfi360


WIZFI360 Click

WIZFI360 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.


Click Library

  • Author : Nenad Filipovic
  • Date : Mar 2024.
  • Type : UART type

Software Support

Example Description

This example demonstrates the use of the WIZFI360 Click board by processing the incoming data and displaying them on the USB UART.

Example Libraries

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.WIZFI360

Example Key Functions

  • wizfi360_cfg_setup Config Object Initialization function.
    void wizfi360_cfg_setup(wizfi360_cfg_t *cfg)
    WIZFI360 configuration object setup function.
    WIZFI360 Click configuration object.
    Definition wizfi360.h:296
  • wizfi360_init Initialization function.
    err_t wizfi360_init(wizfi360_t *ctx, wizfi360_cfg_t *cfg)
    WIZFI360 initialization function.
    WIZFI360 Click context object.
    Definition wizfi360.h:272
  • wizfi360_write_command This function writes a desired command by using the UART serial interface.
    err_t wizfi360_write_command ( wizfi360_t *ctx, uint8_t *command )
    err_t wizfi360_write_command(wizfi360_t *ctx, uint8_t *command)
    WIZFI360 command writing function.
  • wizfi360_write_cmd_param This function writes a desired command, prefix and parameter by using UART serial interface.
    err_t wizfi360_write_cmd_param ( wizfi360_t *ctx, uint8_t *command, uint8_t *prefix, uint8_t *param );
    err_t wizfi360_write_cmd_param(wizfi360_t *ctx, uint8_t *command, uint8_t *prefix, uint8_t *param)
    WIZFI360 command - prefix - parameter writing function.
  • wizfi360_send_message This function sends messages to the host in normal transmission mode using the UART serial interface.
    err_t wizfi360_send_message ( wizfi360_t *ctx, uint8_t *message );
    err_t wizfi360_send_message(wizfi360_t *ctx, uint8_t *message)
    WIZFI360 send message function.

Application Init

Initializes the driver, connects to the desired WiFi network, and then connects to the TCP/UDP server and configures SNTP parameter.

void application_init ( void )
{
log_cfg_t log_cfg;
wizfi360_cfg_t wizfi360_cfg;
LOG_MAP_USB_UART( log_cfg );
log_init( &logger, &log_cfg );
log_info( &logger, " Application Init " );
// Click initialization.
wizfi360_cfg_setup( &wizfi360_cfg );
WIZFI360_MAP_MIKROBUS( wizfi360_cfg, MIKROBUS_1 );
if ( UART_ERROR == wizfi360_init( &wizfi360, &wizfi360_cfg ) )
{
log_error( &logger, " Communication init." );
for ( ; ; );
}
Delay_ms ( 100 );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
memset( cmd_buf, 0, 100 );
strcpy( cmd_buf, WIZFI360_PREFIX_SYMB_QUOTE );
strcat( cmd_buf, DEMO_SSID );
strcat( cmd_buf, WIZFI360_PREFIX_SYMB_QUOTE );
strcat( cmd_buf, WIZFI360_PREFIX_SYMB_SEPARATOR );
strcat( cmd_buf, WIZFI360_PREFIX_SYMB_QUOTE );
strcat( cmd_buf, DEMO_PASSWORD );
strcat( cmd_buf, WIZFI360_PREFIX_SYMB_QUOTE );
cmd_buf );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
memset( cmd_buf, 0, 100 );
strcpy( cmd_buf, WIZFI360_PREFIX_SYMB_QUOTE );
strcat( cmd_buf, DEMO_EXAMPLE_TCP );
strcat( cmd_buf, WIZFI360_PREFIX_SYMB_QUOTE );
strcat( cmd_buf, WIZFI360_PREFIX_SYMB_SEPARATOR );
strcat( cmd_buf, WIZFI360_PREFIX_SYMB_QUOTE );
strcat( cmd_buf, DEMO_REMOTE_ID );
strcat( cmd_buf, WIZFI360_PREFIX_SYMB_QUOTE );
strcat( cmd_buf, WIZFI360_PREFIX_SYMB_SEPARATOR );
strcat( cmd_buf, DEMO_REMOTE_PORT );
cmd_buf );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 500 );
log_info( &logger, " Application Task " );
}
#define WIZFI360_ENABLE_TIMEZONE_1
WIZFI360 SNTP configuration parameter.
Definition wizfi360.h:198
#define WIZFI360_CMD_AT
WIZFI360 system control commands.
Definition wizfi360.h:73
#define WIZFI360_CMD_CIPSTART
Definition wizfi360.h:130
#define WIZFI360_PREFIX_SYMB_QUOTE
Definition wizfi360.h:205
#define WIZFI360_CMD_RESTORE
Definition wizfi360.h:78
#define WIZFI360_CMD_GMR
Definition wizfi360.h:75
#define WIZFI360_CMD_CWMODE_CUR
WIZFI360 WiFi commands.
Definition wizfi360.h:93
#define WIZFI360_CMD_CIPMUX
Definition wizfi360.h:142
#define WIZFI360_CIPMUX_SINGLE_CONN
WIZFI360 multiple connections selection.
Definition wizfi360.h:180
#define WIZFI360_CMD_CWJAP_CUR
Definition wizfi360.h:95
#define WIZFI360_CWMODE_STATION
WIZFI360 current WiFi mode selection.
Definition wizfi360.h:172
#define WIZFI360_PREFIX_SYMB_SET_VAL
Definition wizfi360.h:208
#define WIZFI360_RSP_OK
WIZFI360 response arguments.
Definition wizfi360.h:217
#define WIZFI360_CMD_CIPSTA_CUR
Definition wizfi360.h:112
#define WIZFI360_PREFIX_SYMB_SEPARATOR
Definition wizfi360.h:206
#define WIZFI360_CMD_CWDHCP_CUR
Definition wizfi360.h:103
#define WIZFI360_CMD_CIPSNTPCFG
Definition wizfi360.h:151
#define WIZFI360_CWDHCP_STATION_DHCP
Definition wizfi360.h:190
#define WIZFI360_MAP_MIKROBUS(cfg, mikrobus)
MikroBUS pin mapping.
Definition wizfi360.h:255
err_t wizfi360_inquire_command(wizfi360_t *ctx, uint8_t *command)
WIZFI360 inquire command function.
void application_init(void)
Definition main.c:103
#define DEMO_REMOTE_PORT
Definition main.c:60
#define DEMO_EXAMPLE_TCP
Definition main.c:55
#define DEMO_REMOTE_ID
Definition main.c:59
#define DEMO_PASSWORD
Definition main.c:52
#define DEMO_SSID
Definition main.c:51

Application Task

The demo app displays current time data, sends data messages to the TCP/UDP server, reads and processes all incoming data and displays them on the USB UART.

void application_task ( void )
{
wizfi360_check_response( WIZFI360_RSP_OK );
Delay_ms ( 1000 );
wizfi360_check_response( WIZFI360_RSP_READY_FOR_SEND );
wizfi360_check_response( WIZFI360_RECEIVE );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
Delay_ms ( 1000 );
}
#define WIZFI360_CMD_CIPSEND
Definition wizfi360.h:134
#define WIZFI360_RSP_READY_FOR_SEND
Definition wizfi360.h:219
#define WIZFI360_RECEIVE
Definition wizfi360.h:221
#define WIZFI360_CMD_CIPSNTPTIME
Definition wizfi360.h:152
#define DEMO_SEND_DATA
Definition main.c:45
#define DEMO_SEND_DATA_LENGTH
Definition main.c:48
void application_task(void)
Definition main.c:204

Note

In order for the examples to work without using Planet Debug, the user needs to set the SSID and password of the target AP.

Application Output

This Click board can be interfaced and monitored in two ways:

  • Application Output - Use the "Application Output" window in Debug mode for real-time data monitoring. Set it up properly by following this tutorial.
  • UART Terminal - Monitor data via the UART Terminal using a USB to UART converter. For detailed instructions, check out this tutorial.

Additional Notes and Information

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.