Revolutionize your data flow with our gateway device, optimized for American IoT applications, ensuring precise data storage and processing.
A
A
Hardware Overview
How does it work?
AnyNet 3G-AA Click is based on the UG95-AA, a 3G module from Quectel, qualified to work at North American UTMS frequency bands, as well as with the GSM (2G) frequency bands, and the embedded sim card by Eseye company used to communicate with the AWS. The additional onboard Microchip MCU contains the firmware used to interface the GSM/GPRS module to UART, providing users with easy to use end-point AT commands. UART communication speed is set to 9600bps. To initiate the communication, several simple AT command strings should be transmitted to the UART pins of the click board. All the information about how to use AT commands can be found in the AT commands reference. AnyNet 3G click requires both 3.3V and 5V power supply pins from the
mikroBUS™ to operate. The 5V rail is used to power up the Quectel UG95 module itself through the LVD regulator, while the 3.3V rail is used for powering up the rest of the circuitry. There are four LEDs used to display the connection status. Before the connection and communication with the AWS is possible, the setup procedure must be followed. For detailed step by step information, refer to the setup manual. After the successful connection to the AWS and successful exchange of the certificates, the serial interface can be used to publish messages on the AWS IoT service console. AWS also provides data analysis and processing, as well as cloud storage capabilities. The click board™ has the IoT Button feature - a pin routed to the INT pin of the mikroBUS™ Setting this pin to a
HIGH logic level is considered as IoT Button press. AWS IoT gateway recognizes three types of messages: short press, long press anddouble click. The AWS IoT Button pin is based on the Amazon Dash Button hardware. The functionality of this pin is designed for developers to get started with AWS IoT, AWS Lambda, Amazon DynamoDB, Amazon SNS, and many other Amazon Web Services. IoT Button pin can be coded in cloud service to perform various tasks, such as remote control for Netflix, a switch for Philips Hue light bulb, a check-in/check-out device for Airbnb guests and so on. It can also be integrated with the third-party APIs like Twitter, Facebook, Twilio, Slack or even custom applications.
Features overview
Development board
Nucleo-64 with STM32L073RZ MCU offers a cost-effective and adaptable platform for developers to explore new ideas and prototype their designs. This board harnesses the versatility of the STM32 microcontroller, enabling users to select the optimal balance of performance and power consumption for their projects. It accommodates the STM32 microcontroller in the LQFP64 package and includes essential components such as a user LED, which doubles as an ARDUINO® signal, alongside user and reset push-buttons, and a 32.768kHz crystal oscillator for precise timing operations. Designed with expansion and flexibility in mind, the Nucleo-64 board features an ARDUINO® Uno V3 expansion connector and ST morpho extension pin
headers, granting complete access to the STM32's I/Os for comprehensive project integration. Power supply options are adaptable, supporting ST-LINK USB VBUS or external power sources, ensuring adaptability in various development environments. The board also has an on-board ST-LINK debugger/programmer with USB re-enumeration capability, simplifying the programming and debugging process. Moreover, the board is designed to simplify advanced development with its external SMPS for efficient Vcore logic supply, support for USB Device full speed or USB SNK/UFP full speed, and built-in cryptographic features, enhancing both the power efficiency and security of projects. Additional connectivity is
provided through dedicated connectors for external SMPS experimentation, a USB connector for the ST-LINK, and a MIPI® debug connector, expanding the possibilities for hardware interfacing and experimentation. Developers will find extensive support through comprehensive free software libraries and examples, courtesy of the STM32Cube MCU Package. This, combined with compatibility with a wide array of Integrated Development Environments (IDEs), including IAR Embedded Workbench®, MDK-ARM, and STM32CubeIDE, ensures a smooth and efficient development experience, allowing users to fully leverage the capabilities of the Nucleo-64 board in their projects.
Microcontroller Overview
MCU Card / MCU

Architecture
ARM Cortex-M0
MCU Memory (KB)
192
Silicon Vendor
STMicroelectronics
Pin count
64
RAM (Bytes)
20480
You complete me!
Accessories
Click Shield for Nucleo-64 comes equipped with two proprietary mikroBUS™ sockets, allowing all the Click board™ devices to be interfaced with the STM32 Nucleo-64 board with no effort. This way, Mikroe allows its users to add any functionality from our ever-growing range of Click boards™, such as WiFi, GSM, GPS, Bluetooth, ZigBee, environmental sensors, LEDs, speech recognition, motor control, movement sensors, and many more. More than 1537 Click boards™, which can be stacked and integrated, are at your disposal. The STM32 Nucleo-64 boards are based on the microcontrollers in 64-pin packages, a 32-bit MCU with an ARM Cortex M4 processor operating at 84MHz, 512Kb Flash, and 96KB SRAM, divided into two regions where the top section represents the ST-Link/V2 debugger and programmer while the bottom section of the board is an actual development board. These boards are controlled and powered conveniently through a USB connection to program and efficiently debug the Nucleo-64 board out of the box, with an additional USB cable connected to the USB mini port on the board. Most of the STM32 microcontroller pins are brought to the IO pins on the left and right edge of the board, which are then connected to two existing mikroBUS™ sockets. This Click Shield also has several switches that perform functions such as selecting the logic levels of analog signals on mikroBUS™ sockets and selecting logic voltage levels of the mikroBUS™ sockets themselves. Besides, the user is offered the possibility of using any Click board™ with the help of existing bidirectional level-shifting voltage translators, regardless of whether the Click board™ operates at a 3.3V or 5V logic voltage level. Once you connect the STM32 Nucleo-64 board with our Click Shield for Nucleo-64, you can access hundreds of Click boards™, working with 3.3V or 5V logic voltage levels.
GPS/3G External Antenna is an ideal choice for our GPS/GSM/3G Click boards™. It excels in providing strong GSM and 3G signal reception alongside impressive GPS positioning capabilities. Its robust design features a screw mount and adhesive base, ensuring secure attachment and optimal performance. This antenna boasts separate lines for GPS, GSM, and 3G, making it a versatile choice for applications that demand reliable communication and precise positioning. With a broad frequency range covering 850/900/1800/1900/2100MHz and 50Ω impedance, this antenna guarantees connectivity across various network bands. Its VSW Ratio of 2:1 and peak gain ranging from 1 to 1.5dBic (dependent on frequency) further enhance signal strength. The antenna offers a bandwidth exceeding 10MHz, ensuring consistent reception, while its linear polarization and omnidirectional azimuth coverage provide comprehensive signal accessibility.
Used MCU Pins
mikroBUS™ mapper
Take a closer look
Click board™ Schematic

Step by step
Project assembly
Track your results in real time
Application Output
1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support
Library Description
This library contains API for AnyNet 3G-AA Click driver.
Key functions:
anynet3gaa_send_cmd
- This function sends a specified command to the click module.anynet3gaa_send_cmd_with_par
- This function sends a command with specified parameter to the click module.anynet3gaa_send_cmd_check
- This function checks the command status.
Open Source
Code example
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.
/*!
* @file main.c
* @brief AnyNet 3G-AA Click Example.
*
* # Description
* This example demonstrates the use of AnyNet 3G-AA 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.
*
* ## Application Task
* Reads all the received data and logs them to the USB UART.
*
* ## Additional Function
* - static void anynet3gaa_clear_app_buf ( void )
* - static err_t anynet3gaa_process ( void )
* - static void anynet3gaa_error_check( err_t error_flag )
* - static void anynet3gaa_log_app_buf ( void )
* - static err_t anynet3gaa_rsp_check ( uint8_t *rsp )
*
* @author Stefan Filipovic
*
*/
#include "board.h"
#include "log.h"
#include "anynet3gaa.h"
// Application buffer size
#define APP_BUFFER_SIZE 256
#define PROCESS_BUFFER_SIZE 256
static anynet3gaa_t anynet3gaa;
static log_t logger;
/**
* @brief Application example variables.
* @details Variables used in application example.
*/
static uint8_t app_buf[ APP_BUFFER_SIZE ] = { 0 };
static int32_t app_buf_len = 0;
static err_t error_flag = ANYNET3GAA_OK;
/**
* @brief Clearing application buffer.
* @details This function clears memory of application
* buffer and reset its length.
*/
static void anynet3gaa_clear_app_buf ( void );
/**
* @brief Data reading function.
* @details This function reads data from device and
* appends it to the application buffer.
* @return @li @c 0 - Some data is read.
* @li @c -1 - Nothing is read.
* See #err_t definition for detailed explanation.
*/
static err_t anynet3gaa_process ( void );
/**
* @brief Check for errors.
* @details This function checks for different types of
* errors and logs them on UART or logs the response if no errors occured.
* @param[in] error_flag Error flag to check.
*/
static void anynet3gaa_error_check ( err_t error_flag );
/**
* @brief Logs application buffer.
* @details This function logs data from application buffer.
*/
static void anynet3gaa_log_app_buf ( void );
/**
* @brief Response check.
* @details This function checks for response and
* returns the status of response.
* @param[in] rsp Expected response.
* @return @li @c 0 - OK response.
* @li @c -2 - Timeout error.
* @li @c -3 - Command error.
* @li @c -4 - Unknown error.
* See #err_t definition for detailed explanation.
*/
static err_t anynet3gaa_rsp_check ( uint8_t *rsp );
void application_init ( void )
{
log_cfg_t log_cfg; /**< Logger config object. */
anynet3gaa_cfg_t anynet3gaa_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.
anynet3gaa_cfg_setup( &anynet3gaa_cfg );
ANYNET3GAA_MAP_MIKROBUS( anynet3gaa_cfg, MIKROBUS_1 );
if ( UART_ERROR == anynet3gaa_init( &anynet3gaa, &anynet3gaa_cfg ) )
{
log_error( &logger, " Application Init Error. " );
log_info( &logger, " Please, run program again... " );
for ( ; ; );
}
anynet3gaa_process( );
anynet3gaa_clear_app_buf( );
// Check communication
anynet3gaa_send_cmd( &anynet3gaa, ANYNET3GAA_CMD_AT );
error_flag = anynet3gaa_rsp_check( ANYNET3GAA_RSP_OK );
anynet3gaa_error_check( error_flag );
// Query VERSION info for the AnyNet AWS IoT code
anynet3gaa_send_cmd( &anynet3gaa, ANYNET3GAA_CMD_AWSVER );
error_flag = anynet3gaa_rsp_check( ANYNET3GAA_RSP_OK );
anynet3gaa_error_check( error_flag );
// Query IMEI of the modem on the board
anynet3gaa_send_cmd( &anynet3gaa, ANYNET3GAA_CMD_GSN );
error_flag = anynet3gaa_rsp_check( ANYNET3GAA_RSP_OK );
anynet3gaa_error_check( error_flag );
// Query ICCID of the SIM
anynet3gaa_send_cmd( &anynet3gaa, ANYNET3GAA_CMD_QCCID );
error_flag = anynet3gaa_rsp_check( ANYNET3GAA_RSP_OK );
anynet3gaa_error_check( error_flag );
// Check AWS State
anynet3gaa_send_cmd_check( &anynet3gaa, ANYNET3GAA_CMD_AWSSTATE );
error_flag = anynet3gaa_rsp_check( ANYNET3GAA_RSP_OK );
anynet3gaa_error_check( error_flag );
// Open AWS topic
#define AWS_TOPIC_OPEN "0,\"MY_TOPIC_OPEN\""
anynet3gaa_send_cmd_with_par( &anynet3gaa, ANYNET3GAA_CMD_AWSPUBOPEN, AWS_TOPIC_OPEN );
error_flag = anynet3gaa_rsp_check( ANYNET3GAA_RSP_OK );
anynet3gaa_error_check( error_flag );
// Subscribe to AWS topic
#define AWS_TOPIC_SUBSCRIBE "0,\"MY_TOPIC_SUBSCRIBE\""
anynet3gaa_send_cmd_with_par( &anynet3gaa, ANYNET3GAA_CMD_AWSSUBOPEN, AWS_TOPIC_SUBSCRIBE );
error_flag = anynet3gaa_rsp_check( ANYNET3GAA_RSP_OK );
anynet3gaa_error_check( error_flag );
anynet3gaa_clear_app_buf( );
log_info( &logger, " Application Task " );
}
void application_task ( void )
{
anynet3gaa_process( );
anynet3gaa_log_app_buf( );
anynet3gaa_clear_app_buf( );
}
void main ( void )
{
application_init( );
for ( ; ; )
{
application_task( );
}
}
static void anynet3gaa_clear_app_buf ( void )
{
memset( app_buf, 0, app_buf_len );
app_buf_len = 0;
}
static err_t anynet3gaa_process ( void )
{
uint8_t rx_buf[ PROCESS_BUFFER_SIZE ] = { 0 };
int32_t rx_size = 0;
rx_size = anynet3gaa_generic_read( &anynet3gaa, rx_buf, PROCESS_BUFFER_SIZE );
if ( rx_size > 0 )
{
int32_t buf_cnt = app_buf_len;
if ( ( ( app_buf_len + rx_size ) > APP_BUFFER_SIZE ) && ( app_buf_len > 0 ) )
{
buf_cnt = APP_BUFFER_SIZE - ( ( app_buf_len + rx_size ) - APP_BUFFER_SIZE );
memmove ( app_buf, &app_buf[ APP_BUFFER_SIZE - buf_cnt ], buf_cnt );
}
for ( int32_t rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ )
{
if ( rx_buf[ rx_cnt ] )
{
app_buf[ buf_cnt++ ] = rx_buf[ rx_cnt ];
if ( app_buf_len < APP_BUFFER_SIZE )
{
app_buf_len++;
}
}
}
return ANYNET3GAA_OK;
}
return ANYNET3GAA_ERROR;
}
static err_t anynet3gaa_rsp_check ( uint8_t *rsp )
{
uint32_t timeout_cnt = 0;
uint32_t timeout = 120000;
anynet3gaa_clear_app_buf( );
anynet3gaa_process( );
while ( ( 0 == strstr( app_buf, rsp ) ) &&
( 0 == strstr( app_buf, ANYNET3GAA_RSP_ERROR ) ) &&
( 0 == strstr( app_buf, ANYNET3GAA_RSP_SEND_FAIL ) ) )
{
anynet3gaa_process( );
if ( timeout_cnt++ > timeout )
{
anynet3gaa_clear_app_buf( );
return ANYNET3GAA_ERROR_TIMEOUT;
}
Delay_ms( 1 );
}
Delay_ms( 100 );
anynet3gaa_process( );
if ( strstr( app_buf, rsp ) )
{
return ANYNET3GAA_OK;
}
else if ( strstr( app_buf, ANYNET3GAA_RSP_ERROR ) )
{
return ANYNET3GAA_ERROR_CMD;
}
else if ( strstr( app_buf, ANYNET3GAA_RSP_SEND_FAIL ) )
{
return ANYNET3GAA_ERROR_SEND;
}
else
{
return ANYNET3GAA_ERROR_UNKNOWN;
}
}
static void anynet3gaa_error_check ( err_t error_flag )
{
switch ( error_flag )
{
case ANYNET3GAA_OK:
{
anynet3gaa_log_app_buf( );
break;
}
case ANYNET3GAA_ERROR_TIMEOUT:
{
log_error( &logger, " Timeout!" );
break;
}
case ANYNET3GAA_ERROR_CMD:
{
log_error( &logger, " CMD!" );
break;
}
case ANYNET3GAA_ERROR_SEND:
{
log_error( &logger, " SEND FAIL!" );
break;
}
case ANYNET3GAA_ERROR_UNKNOWN:
default:
{
log_error( &logger, " Unknown!" );
break;
}
}
Delay_ms( 500 );
}
static void anynet3gaa_log_app_buf ( void )
{
for ( int32_t buf_cnt = 0; buf_cnt < app_buf_len; buf_cnt++ )
{
log_printf( &logger, "%c", app_buf[ buf_cnt ] );
}
}
// ------------------------------------------------------------------------ END