TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (387 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (97 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 (139956 times)
  2. FAT32 Library (72300 times)
  3. Network Ethernet Library (57466 times)
  4. USB Device Library (47772 times)
  5. Network WiFi Library (43398 times)
  6. FT800 Library (42725 times)
  7. GSM click (30000 times)
  8. mikroSDK (28518 times)
  9. PID Library (27004 times)
  10. microSD click (26409 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

LP WiFi Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.14

mikroSDK Library: 2.0.0.0

Category: WIFI

Downloaded: 329 times

Not followed.

License: MIT license  

LP WiFi Click is a compact add-on board that represents an ultra-low-power Wi-Fi solution. This board features the DA16200, a fully integrated Wi-Fi module with ultra-low power consumption, best RF performance, and a comfortable development environment from Dialog Semiconductor.

No Abuse Reported

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

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

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

  • Information
  • Comments (0)

mikroSDK Library Blog


LP WiFi Click

LP WiFi Click is a compact add-on board that represents an ultra-low-power Wi-Fi solution. This board features the DA16200, a fully integrated Wi-Fi module with ultra-low power consumption, best RF performance, and a comfortable development environment from Dialog Semiconductor.

lpwifi_click.png

Click Product page


Click library

  • Author : Stefan Filipovic
  • Date : May 2021.
  • Type : UART type

Software Support

We provide a library for the LPWiFi 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Library Description

This library contains API for LPWiFi Click driver.

Standard key functions :

  • lpwifi_cfg_setup Config Object Initialization function.

    void lpwifi_cfg_setup ( lpwifi_cfg_t *cfg );
  • lpwifi_init Initialization function.

    err_t lpwifi_init ( lpwifi_t *ctx, lpwifi_cfg_t *cfg );
  • lpwifi_default_cfg Click Default Configuration function.

    void lpwifi_default_cfg ( lpwifi_t *ctx );

Example key functions :

  • lpwifi_send_cmd Send command function.

    void lpwifi_send_cmd ( lpwifi_t *ctx, char *cmd );
  • lpwifi_connect_to_ap Connect to AP function.

    void lpwifi_connect_to_ap ( lpwifi_t *ctx, char *ssid, char *password );
  • lpwifi_factory_reset_device Device factory reset function.

    void lpwifi_factory_reset_device ( lpwifi_t *ctx );

Example Description

This example reads and processes data from LP WiFi 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;  /**< Logger config object. */
    lpwifi_cfg_t lpwifi_cfg;  /**< 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 @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 " );
    Delay_ms ( 100 );

    // Click initialization.

    lpwifi_cfg_setup( &lpwifi_cfg );
    LPWIFI_MAP_MIKROBUS( lpwifi_cfg, MIKROBUS_1 );
    err_t init_flag = lpwifi_init( &lpwifi, &lpwifi_cfg );
    if ( UART_ERROR == init_flag ) 
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }

    lpwifi_default_cfg( &lpwifi );
    Delay_ms ( 500 );

    // Initiate the communication
    lpwifi_send_cmd( &lpwifi, LPWIFI_CMD_AT );
    Delay_ms ( 1000 );

    // Dummy read
    lpwifi_process( );
    lpwifi_clear_app_buf( );

    log_printf( &logger, "\r\n --- Factory reset --- \r\n" );
    lpwifi_factory_reset_device ( &lpwifi );
    Delay_ms ( 500 );
    // Enable Echo
    lpwifi_send_cmd( &lpwifi, LPWIFI_CMD_ATE );
    app_error_flag = lpwifi_rsp_check( );
    lpwifi_error_check( app_error_flag );
    Delay_ms ( 500 );
    log_printf( &logger, " ----------------------------------------------- \r\n" );

    log_printf( &logger, "\r\n --- Connecting to the access point --- \r\n" );
    // Connect to AP
    lpwifi_connect_to_ap( &lpwifi, AP_SSID, AP_PASSWORD );
    app_error_flag = lpwifi_rsp_check( );
    lpwifi_error_check( app_error_flag );
    lpwifi_check_connection();
    while ( CONNECTED_TO_AP != app_connection_status )
    {
        lpwifi_check_connection();
        if ( NOT_CONNECTED_TO_AP == app_connection_status )
        {
            Delay_ms ( 500 );
            app_connection_status = WAIT_FOR_CONNECTION;

            // Connect to AP
            lpwifi_connect_to_ap( &lpwifi, AP_SSID, AP_PASSWORD );
            app_error_flag = lpwifi_rsp_check( );
            lpwifi_error_check( app_error_flag );
        }
    }
    log_printf( &logger, " ----------------------------------------------- \r\n" );
    log_printf( &logger, "\r\n --- Creating a TCP server --- \r\n" );
    // Create TCP Server
    lpwifi_create_tcp_server( &lpwifi, LOCAL_PORT );
    app_error_flag = lpwifi_rsp_check( );
    lpwifi_error_check( app_error_flag );
    Delay_ms ( 500 );

    log_printf( &logger, " ----------------------------------------------- \r\n" );
    log_printf( &logger, "\r\n --- Creating a UDP socket --- \r\n" );
    // Create UDP socket
    lpwifi_create_udp_socket( &lpwifi, LOCAL_PORT );
    app_error_flag = lpwifi_rsp_check( );
    lpwifi_error_check( app_error_flag );
    Delay_ms ( 500 );

    log_printf( &logger, " ----------------------------------------------- \r\n" );
    log_printf( &logger, " TCP server and UDP socket are available at: \r\n" );
    log_printf( &logger, "    SSID: \"%s\"\r\n    IP: %s\r\n    Port: %u", ( char * ) AP_SSID, 
                                                                           ( char * ) assigned_ip_address, 
                                                                         ( uint16_t ) LOCAL_PORT );
    log_printf( &logger, "\r\n ----------------------------------------------- \r\n" );
    log_printf( &logger, " You can connect to it via a TCP/UDP client." );
    log_printf( &logger, "\r\n ----------------------------------------------- \r\n" );
}

Application Task

Logs all the data received from TCP/UDP clients on the USB UART.


void application_task ( void )
{
    lpwifi_process( );
    lpwifi_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 server and UDP socket 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 from NECTO Studio Package Manager(recommended way), downloaded from our LibStock™ or found on Mikroe github account.

Other Mikroe Libraries used in the example:

  • MikroSDK.Board
  • MikroSDK.Log
  • Click.LPWiFi

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. UART terminal is available in all MikroElektronika compilers.


ALSO FROM THIS AUTHOR

Hall Current 17 Click

0

Hall Current 17 Click is a compact add-on board that contains a precise solution for AC/DC current sensing. This board features the ACS37010, a high-accuracy current sensor from Allegro MicroSystems. The ACS37010 has a high operating bandwidth of 450kHz and a fast response time of 1.3μs response time. It features a highly isolated compact surface-mount package, low internal primary conductor resistance, low sensitivity error, low offset voltage over temperature, and more.

[Learn More]

UV 4 Click

0

UV 4 Click is a powerful Ultra Violet (UV) sensing device and Ambient Light Sensor (ALS) Click board�, featuring a sensor with a very wide dynamic range of detectable light intensity, across two ADC range settings.

[Learn More]

SPI Isolator 3 Click

0

SPI Isolator 3 Click is a compact add-on board that contains a digital isolator optimized for a serial peripheral interface. This board features the MAX14483, a 6-channel 3.75kVRMS digital galvanic isolator with a very low propagation delay on the SDI, SDO, and SCLK channels from Maxim Integrated. Besides a second enable control input, which allows MAX14483 to isolate multiple SPI devices, and an auxiliary channel available for passing timing or control signals from the master side to the slave side, the MAX14483 also possesses power monitors provided for both power domains to signal if the opposite side of the isolator is ready for operation.

[Learn More]