TOP Contributors

  1. MIKROE (2762 codes)
  2. Alcides Ramos (374 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 (139254 times)
  2. FAT32 Library (71751 times)
  3. Network Ethernet Library (57122 times)
  4. USB Device Library (47430 times)
  5. Network WiFi Library (43082 times)
  6. FT800 Library (42404 times)
  7. GSM click (29835 times)
  8. mikroSDK (28078 times)
  9. PID Library (26885 times)
  10. microSD click (26198 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

AnyNet 2G Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.5

mikroSDK Library: 2.0.0.0

Category: GSM/LTE

Downloaded: 64 times

Not followed.

License: MIT license  

AnyNet 2G Click is a cellular to AWS gateway device, which provides developers with the complete solution for various IoT applications, by using the AWS IoT and Cloud Storage services for the data storage, analyzing and processing.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "AnyNet 2G Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "AnyNet 2G Click" changes.

Do you want to report abuse regarding "AnyNet 2G Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


AnyNet 2G Click

AnyNet 2G Click is a cellular to AWS gateway device, which provides developers with the complete solution for various IoT applications, by using the AWS IoT and Cloud Storage services for the data storage, analyzing and processing.

anynet2g_click.png

Click Product page


Click library

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

Software Support

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

Standard key functions :

  • anynet2g_cfg_setup Config Object Initialization function.

    void anynet2g_cfg_setup ( anynet2g_cfg_t *cfg );
  • anynet2g_init Initialization function.

    err_t anynet2g_init ( anynet2g_t *ctx, anynet2g_cfg_t *cfg );

Example key functions :

  • anynet2g_send_cmd This function sends a specified command to the Click module.

    void anynet2g_send_cmd ( anynet2g_t *ctx, uint8_t *cmd );
  • anynet2g_send_cmd_with_par This function sends a command with specified parameter to the Click module.

    void anynet2g_send_cmd_with_par ( anynet2g_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf );
  • anynet2g_send_cmd_check This function checks the command status.

    void anynet2g_send_cmd_check ( anynet2g_t *ctx, uint8_t *at_cmd_buf );

Example Description

This example demonstrates the use of AnyNet 2G Click board.

The demo application is composed of two sections :

Application Init

Initializes the driver and sends a few AT commands to test the communication and configure the Click board.


void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    anynet2g_cfg_t anynet2g_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 " );

    // Click initialization.
    anynet2g_cfg_setup( &anynet2g_cfg );
    ANYNET2G_MAP_MIKROBUS( anynet2g_cfg, MIKROBUS_1 );
    if ( UART_ERROR == anynet2g_init( &anynet2g, &anynet2g_cfg ) )
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );
        for ( ; ; );
    }

    anynet2g_process( );
    anynet2g_clear_app_buf( );

    // Check communication
    anynet2g_send_cmd( &anynet2g, ANYNET2G_CMD_AT );
    error_flag = anynet2g_rsp_check( ANYNET2G_RSP_OK );
    anynet2g_error_check( error_flag );

    // Query VERSION info for the AnyNet AWS IoT code
    anynet2g_send_cmd( &anynet2g, ANYNET2G_CMD_AWSVER );
    error_flag = anynet2g_rsp_check( ANYNET2G_RSP_OK );
    anynet2g_error_check( error_flag );

    // Query IMEI of the modem on the board
    anynet2g_send_cmd( &anynet2g, ANYNET2G_CMD_GSN );
    error_flag = anynet2g_rsp_check( ANYNET2G_RSP_OK );
    anynet2g_error_check( error_flag );

    // Query ICCID of the SIM
    anynet2g_send_cmd( &anynet2g, ANYNET2G_CMD_QCCID );
    error_flag = anynet2g_rsp_check( ANYNET2G_RSP_OK );
    anynet2g_error_check( error_flag );

    // Check AWS State
    anynet2g_send_cmd_check( &anynet2g, ANYNET2G_CMD_AWSSTATE );
    error_flag = anynet2g_rsp_check( ANYNET2G_RSP_OK );
    anynet2g_error_check( error_flag );

    // Open AWS topic
    #define AWS_TOPIC_OPEN "0,\"MY_TOPIC_OPEN\""
    anynet2g_send_cmd_with_par( &anynet2g, ANYNET2G_CMD_AWSPUBOPEN, AWS_TOPIC_OPEN );
    error_flag = anynet2g_rsp_check( ANYNET2G_RSP_OK );
    anynet2g_error_check( error_flag );

    // Subscribe to AWS topic
    #define AWS_TOPIC_SUBSCRIBE "0,\"MY_TOPIC_SUBSCRIBE\""
    anynet2g_send_cmd_with_par( &anynet2g, ANYNET2G_CMD_AWSSUBOPEN, AWS_TOPIC_SUBSCRIBE );
    error_flag = anynet2g_rsp_check( ANYNET2G_RSP_OK );
    anynet2g_error_check( error_flag );
    anynet2g_clear_app_buf( );

    log_info( &logger, " Application Task " );
}

Application Task

Reads all the received data and logs them to the USB UART.


void application_task ( void ) 
{
    anynet2g_process( );
    anynet2g_log_app_buf( );
    anynet2g_clear_app_buf( );
}

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

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

Stepper 24 Click

0

Stepper 24 Click is a compact add-on board designed to drive small stepping motors in consumer electronics and industrial equipment applications. This board features the TB67S589FTG, a BiCD constant-current 2-phase bipolar stepping motor driver IC from Toshiba Semiconductor. Key features include a PWM chopper-type 2-phase bipolar drive system, high withstand voltage of up to 34V operating, and a maximum operating current of 2.7A per phase. The board also integrates safety mechanisms such as over-temperature, over-current, and low-supply voltage detection. Additional control is provided by the PCA9555A port expander via I2C, enabling functions like decay and torque modes, step resolution settings, and many more.

[Learn More]

Ecg 6 Click

0

ECG 6 Click is a complete solution for the development of ECG and Heart-Rate (HR) applications. It features the MAX86150, a Reflective Heart Rate Monitor and Medical-Grade Pulse Oximeter from Maxim Integrated. The Click board™ contain integrated electrocardiogram, pulse oximeter, heart rate monitor sensor module. The ECG 6 Click can be used for application in Fitness Assistant Devices, Wearable Devices, Smartphones, Tablet.

[Learn More]

Thermo 28 Click

0

Thermo 28 Click is a compact add-on board that accurately measures temperature. This board features the ams AG’s AS6221, a high-accuracy digital temperature sensor. The AS6221 consists of a Si bandgap temperature factory-calibrated sensor, 16-bit ADC, and a digital signal processor, offering a high accuracy of ±0.9°C. It provides temperature data to the host controller through a compatible I2C interface, reliability, user-selectable I2C addresses, and alert functionality, which triggers an interrupt to protect the device from excessive temperatures.

[Learn More]