TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (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 (137078 times)
  2. FAT32 Library (70222 times)
  3. Network Ethernet Library (56094 times)
  4. USB Device Library (46409 times)
  5. Network WiFi Library (42029 times)
  6. FT800 Library (41373 times)
  7. GSM click (29109 times)
  8. mikroSDK (26554 times)
  9. PID Library (26487 times)
  10. microSD click (25483 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 9 click

Rating:

0

Author: MIKROE

Last Updated: 2024-04-03

Package Version: 2.1.0.13

mikroSDK Library: 2.0.0.0

Category: WIFI

Downloaded: 220 times

Not followed.

License: MIT license  

WiFi 9 Click is fully embedded stand-alone Wi-Fi module, equipped with the PAN9420 a 2.4 GHz ISM band Wi-Fi-embedded module which includes a wireless radio and an MCU for easy integration of Wi-Fi connectivity into various electronic devices.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "WiFi 9 click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "WiFi 9 click" changes.

Do you want to report abuse regarding "WiFi 9 click".

  • mikroSDK Library 1.0.0.0
  • Comments (0)

mikroSDK Library Blog


WiFi 9 click

WiFi 9 Click is fully embedded stand-alone Wi-Fi module, equipped with the PAN9420 a 2.4 GHz ISM band Wi-Fi-embedded module which includes a wireless radio and an MCU for easy integration of Wi-Fi connectivity into various electronic devices.

wifi9_click.png

click Product page


Click library

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

Software Support

We provide a library for the Wifi9 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 Wifi9 Click driver.

Standard key functions :

  • wifi9_cfg_setup Config Object Initialization function.

    void wifi9_cfg_setup ( wifi9_cfg_t *cfg ); 
  • wifi9_init Initialization function.

    err_t wifi9_init ( wifi9_t *ctx, wifi9_cfg_t *cfg );

Example key functions :

  • wifi9_select_uart Switch to a command or binary uart

    void wifi9_select_uart ( wifi9_t *ctx, uint8_t uart_select );
  • wifi9_reset_device Module reset.

    void wifi9_reset_device ( wifi9_t *ctx );
  • wifi9_send_command Send Command function.

    void wifi9_send_command ( wifi9_t *ctx, uint8_t *command );

Examples Description

This application showcases capability of the WiFi 9 Click board. It initializes device, connects to local WiFi. Creates TCP server, waits for connection, and logs every message it receives from clients and returns back those messages as an echo response.

The demo application is composed of two sections :

Application Init

Initializes driver and wifi communication, then connects to the desired WiFi network and creates TCP server on the IP address assigned to the click board.


void application_init ( void )
{
    log_cfg_t log_cfg;
    wifi9_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.
    wifi9_cfg_setup( &cfg );
    WIFI9_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    wifi9_init( &wifi9, &cfg );

    wifi9_reset_device( &wifi9 );
    wifi9_select_uart( &wifi9, WIFI9_SELECT_CMD_UART );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    wifi9_process( );
    wifi9_clear_app_buf( );

    log_printf( &logger, "---------------------\r\n" );
    log_printf( &logger, "---- System Info ----\r\n" );
    log_printf( &logger, "---------------------\r\n" );

    wifi9_send_command( &wifi9, WIFI9_CMD_GET_SYSTEM_FIRMWARE );
    wifi9_rsp_check( WIFI9_CMD_GET_SYSTEM_FIRMWARE );
    wifi9_log_app_buf( );

    wifi9_send_command( &wifi9, WIFI9_CMD_GET_SYSTEM_MAC_ADDR );
    wifi9_rsp_check( WIFI9_CMD_GET_SYSTEM_MAC_ADDR );
    wifi9_log_app_buf( );

    wifi9_send_command( &wifi9, WIFI9_CMD_GET_SYSTEM_SERIAL_NUM );
    wifi9_rsp_check( WIFI9_CMD_GET_SYSTEM_SERIAL_NUM );
    wifi9_log_app_buf( );

    wifi9_send_command( &wifi9, WIFI9_CMD_GET_SYSTEM_RADIO_VER );
    wifi9_rsp_check( WIFI9_CMD_GET_SYSTEM_RADIO_VER );
    wifi9_log_app_buf( );

    wifi9_send_command( &wifi9, WIFI9_CMD_GET_SYSTEM_BOOTL_VER );
    wifi9_rsp_check( WIFI9_CMD_GET_SYSTEM_BOOTL_VER );
    wifi9_log_app_buf( );

    wifi9_send_command( &wifi9, WIFI9_CMD_GET_SYSTEM_HW_REV );
    wifi9_rsp_check( WIFI9_CMD_GET_SYSTEM_HW_REV );
    wifi9_log_app_buf( );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "--------------------------\r\n" );
    log_printf( &logger, "---- Start NETCAT app ----\r\n" );
    log_printf( &logger, "--------------------------\r\n" );

    log_printf( &logger, "\r\nSet Station to ON status: " );
    wifi9_send_command( &wifi9, WIFI9_CMD_SET_WLAN_STATE_STA_ON );
    wifi9_rsp_check( WIFI9_CMD_SET_WLAN_STATE );
    wifi9_log_app_buf( );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "\r\nSet Station SSID and PASSWORD: " );
    strcpy( app_buf, WIFI9_CMD_SET_WLAN_CFG_STA );
    strcat( app_buf, " \"" );
    strcat( app_buf, EXAMPLE_SSID );
    strcat( app_buf, "\" \"" );
    strcat( app_buf, EXAMPLE_PASSWORD );
    strcat( app_buf, "\" 4" );
    wifi9_send_command( &wifi9, app_buf );
    wifi9_rsp_check( WIFI9_CMD_SET_WLAN_CFG );
    wifi9_log_app_buf( );
    Delay_ms ( 500 );

    log_printf( &logger, "\r\nTurn ON - Netcat module: " );
    wifi9_send_command( &wifi9, WIFI9_CMD_SET_NETCAT_STATE_ON );
    wifi9_rsp_check( WIFI9_CMD_SET_NETCAT_STATE );
    wifi9_log_app_buf( );
    Delay_ms ( 500 );

    log_printf( &logger, "\r\nExclude Netcat authentication: " );
    wifi9_send_command( &wifi9, WIFI9_CMD_SET_NETCAT_AUTH_OFF );
    wifi9_rsp_check( WIFI9_CMD_SET_NETCAT_AUTH );
    wifi9_log_app_buf( );
    Delay_ms ( 500 );

    log_printf( &logger, "\r\nSet the Netcat module server port: " );
    strcpy( app_buf, WIFI9_CMD_SET_NETCAT_CFG_SERVER );
    strcat( app_buf, " " );
    strcat( app_buf, EXAMPLE_SERVER_PORT );
    wifi9_send_command( &wifi9, app_buf );
    wifi9_rsp_check( WIFI9_CMD_SET_NETCAT_CFG );
    wifi9_log_app_buf( );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );
    Delay_ms ( 1000 );

    log_printf( &logger, "\r\nWaiting for an IP address assignment from DHCP server...\r\n" );
    for ( ; ; )
    {
        log_printf( &logger, "\r\nGet IP address: " );
        wifi9_send_command( &wifi9, WIFI9_CMD_GET_NET_CFG_STA );
        wifi9_rsp_check( WIFI9_CMD_GET_NET_CFG );
        wifi9_log_app_buf( );
        if ( !strstr ( app_buf, "0.0.0.0" ) )
        {
            break;
        }
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
    }
    wifi9_clear_app_buf( );
    Delay_ms ( 1000 );

    log_printf( &logger, "\r\nNow you can connect to the TCP server listed above via a TCP client app\r\n" );  
    log_printf( &logger, "The module is transferred to BIN-UART - for data collection\r\n" );

    wifi9_select_uart( &wifi9, WIFI9_SELECT_BIN_UART );
    log_info( &logger, " Application Task " );
    Delay_ms ( 1000 );
}

Application Task

All data received from the TCP clients will be logger to USB UART and echoed back to the clients.


void application_task ( void )
{
    wifi9_process( );
    if ( app_buf_len )
    {
        wifi9_log_app_buf( );
        wifi9_generic_write( &wifi9, app_buf, app_buf_len );
        wifi9_clear_app_buf( );
        Delay_ms ( 100 );
    }
}

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.Wifi9

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

OLED W click

0

OLED W click carries a 96 x 39px white monochrome passive matrix OLED display. The display is bright, has a wide viewing angle and low power consumption.

[Learn More]

H-Bridge 7 click

5

H-Bridge 7 Click features flexible motor driver IC for a wide variety of applications, labeled as the DRV8876N. This Click board integrates an N-channel H-bridge, charge pump regulator, and protection circuitry. The charge pump improves efficiency by allowing for both high-side and low-side N-channels MOSFETs and 100% duty cycle support.

[Learn More]

Counter Click

1

Counter click carries an LS7366R quadrature counter. The interface has ENCA and ENCB pins, along with ENCI, which is a programmable index. Counter click communicates with the target board microcontroller through the mikroBUSâ„¢ SPI interface, plus enable (CNT EN) and interrupt (LFLAG or DFLAG) pins. The board can use a 3.3V or a 5V power supply.

[Learn More]