TOP Contributors

  1. MIKROE (2751 codes)
  2. Alcides Ramos (372 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (139059 times)
  2. FAT32 Library (71592 times)
  3. Network Ethernet Library (56989 times)
  4. USB Device Library (47330 times)
  5. Network WiFi Library (43006 times)
  6. FT800 Library (42297 times)
  7. GSM click (29777 times)
  8. mikroSDK (27874 times)
  9. PID Library (26858 times)
  10. microSD click (26129 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
mikroSDK Library

WiFi 11 Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.11

mikroSDK Library: 2.0.0.0

Category: WIFI

Downloaded: 277 times

Not followed.

License: MIT license  

WiFi 11 Click is a compact add-on board that contains a WiFi and Bluetooth module that has dual bands for WiFi communication. This board features the BW16, a low-power dual bands Wireless LAN (WLAN) and Bluetooth Low Energy SoC module from Ai-Thinker.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "WiFi 11 Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "WiFi 11 Click" changes.

Do you want to report abuse regarding "WiFi 11 Click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


WiFi 11 Click

WiFi 11 Click is a compact add-on board that contains a WiFi and Bluetooth module that has dual bands for WiFi communication. This board features the BW16, a low-power dual bands Wireless LAN (WLAN) and Bluetooth Low Energy SoC module from Ai-Thinker.

wifi11_click.png

Click Product page


Click library

  • Author : MikroE Team
  • Date : Sep 2020.
  • Type : UART type

Software Support

We provide a library for the Wifi11 Click as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.

Package can be downloaded/installed directly form compilers IDE(recommended way), or downloaded from our LibStock, or found on mikroE github account.

Library Description

This library contains API for Wifi11 Click driver.

Standard key functions :

  • Config Object Initialization function.

    void wifi11_cfg_setup ( wifi11_cfg_t *cfg );

  • Initialization function.

    WIFI11_RETVAL wifi11_init ( wifi11_t ctx, wifi11_cfg_t cfg );

  • Device reset function.

    void wifi11_reset_device ( wifi11_t *ctx );

Example key functions :

  • Send command function.

    void wifi11_send_cmd ( wifi11_t ctx, char cmd );

  • Create TCP/UDP server function.

    void wifi11_create_tcp_udp_server ( wifi11_t *ctx, uint8_t mode, uint16_t port );

  • Connect to AP function.

    void wifi11_connect_to_ap ( wifi11_t ctx, char ssid, char *password );

Examples Description

This example reads and processes data from WiFi 11 clicks.

The demo application is composed of two sections :

Application Init

Initializes the driver and powers up the module, then connects to the desired AP and creates TCP and UDP servers on the desired local port.


void application_init ( void )
{
    log_cfg_t log_cfg;
    wifi11_cfg_t cfg;

    /** 
     * 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 @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );

    //  Click initialization.

    wifi11_cfg_setup( &cfg );
    WIFI11_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    wifi11_init( &wifi11, &cfg );
    Delay_ms ( 100 );

    wifi11_reset_device( &wifi11 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    // dummy read
    wifi11_process( );
    wifi11_clear_app_buf( );

    log_printf( &logger, "\r\n ---- Common commands ---- \r\n" );
    Delay_ms ( 500 );

    // Test AT command ready
    wifi11_send_cmd( &wifi11, WIFI11_CMD_AT );
    app_error_flag = wifi11_rsp_check( );
    wifi11_error_check( app_error_flag );
    Delay_ms ( 500 );

    // Query version info
    wifi11_send_cmd( &wifi11, WIFI11_CMD_ATSV );
    app_error_flag = wifi11_rsp_check( );
    wifi11_error_check( app_error_flag );
    Delay_ms ( 500 );

    log_printf( &logger, "\r\n ---- WiFi commands ---- \r\n" );
    Delay_ms ( 500 );

    // Set WiFi mode - Station
    wifi11_send_cmd_with_parameter( &wifi11, WIFI11_CMD_ATPW, "1" );
    app_error_flag = wifi11_rsp_check( );
    wifi11_error_check( app_error_flag );
    Delay_ms ( 500 );

    // Connect to AP
    wifi11_connect_to_ap( &wifi11, AP_SSID, AP_PASSWORD );
    app_error_flag = wifi11_rsp_check( );
    wifi11_error_check( app_error_flag );
    Delay_ms ( 500 );

    // Wifi information
    wifi11_send_cmd( &wifi11, WIFI11_CMD_ATW );
    app_error_flag = wifi11_rsp_check( );
    wifi11_error_check( app_error_flag );
    Delay_ms ( 500 );

    log_printf( &logger, "\r\n ---- TCP/IP commands ---- \r\n" );
    Delay_ms ( 500 );

    // Create TCP Server
    wifi11_create_tcp_udp_server( &wifi11, WIFI11_TCP_MODE, LOCAL_PORT );
    app_error_flag = wifi11_rsp_check( );
    wifi11_error_check( app_error_flag );
    Delay_ms ( 500 );

    // Create UDP Server
    wifi11_create_tcp_udp_server( &wifi11, WIFI11_UDP_MODE, LOCAL_PORT );
    app_error_flag = wifi11_rsp_check( );
    wifi11_error_check( app_error_flag );
    Delay_ms ( 500 );

    // Enable auto receive data mode
    wifi11_send_cmd_with_parameter( &wifi11, WIFI11_CMD_ATPK, "1" );
    app_error_flag = wifi11_rsp_check( );
    wifi11_error_check( app_error_flag );
    Delay_ms ( 500 );

    // Check network connection status
    wifi11_send_cmd( &wifi11, WIFI11_CMD_ATPI );
    app_error_flag = wifi11_rsp_check( );
    wifi11_error_check( app_error_flag );
    Delay_ms ( 500 );

    log_printf( &logger, "\r\n ---- Please connect to the TCP/UDP server listed above via" );
    log_printf( &logger, " a TCP/UDP client ---- \r\n" ); 
}

Application Task

Logs all the received data and module's responses on the USB UART.


void application_task ( void )
{
    wifi11_process( );
    wifi11_log_app_buf( );
} 

Note

In order for the example to work, user needs to set the AP SSID, password, and Local port on which the TCP and UDP servers will be created. Enter valid data for the following macros: AP_SSID, AP_PASSWORD and LOCAL_PORT.

The full application code, and ready to use projects can be installed directly form compilers IDE(recommneded) or found on LibStock page or mikroE GitHub accaunt.

Other mikroE Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.Wifi11

Additional notes and informations

Depending on the development board you are using, you may need USB UART Click, USB UART 2 Click or RS232 Click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all Mikroelektronika compilers, or any other terminal application of your choice, can be used to read the message.


ALSO FROM THIS AUTHOR

UWB click

5

UWB Click is an Ultra-Wideband transceiver Click board that can be used in 2-way ranging or TDOA location systems to locate assets to a precision of 10 cm and supports data rates of up to 6.8 Mbps. This board features the DWM1000 module based on Decawave's DW1000 Ultra-Wideband (UWB) transceiver from Decawave Limited.

[Learn More]

DAC 13 Click

0

DAC 13 Click is a compact add-on board providing a highly accurate digital-to-analog conversion. This board features the AD3541R, a low drift, single channel, 16-bit accuracy, voltage output digital-to-analog converter (DAC) from Analog Devices. The AD3542R operates with a fixed 2.5V reference, communicates with the host MCU through the SPI interface, and can be configurable in multiple voltage span ranges. Also, it provides the possibility to select the power supply of the internal trans-impedance amplifier as well as its gain, which scales the output voltage.

[Learn More]

Barcode 2 click

5

Barcode 2 Click is an adapter add-on board that contains a computerized image recognition system that is compliant with a wide range of different 1D and 2D barcode protocols.

[Learn More]