初学者
10 分钟

使用UG95-EA和STM32L496AG拥抱卓越的物联网数据管理

连接、存储、分析 - 您的欧洲物联网网关

AnyNet 3G-EA Click (for EU and Australia) with Discovery kit with STM32L496AG MCU

已发布 7月 22, 2025

点击板

AnyNet 3G-EA Click (for EU and Australia)

开发板

Discovery kit with STM32L496AG MCU

编译器

NECTO Studio

微控制器单元

STM32L496AG

体验高效的数据处理,为您的欧洲物联网项目提供最高级别的安全性和隐私合规性。

A

A

硬件概览

它是如何工作的?

AnyNet 3G-EA Click 基于 Quectel 的 UG95-EA,这是一个 3G 模块,能够在欧洲和澳大利亚的 UTMS 频段工作,也可以在全球范围内使用 GSM (2G) 频段。它嵌入了 Eseye 公司的 SIM 卡,用于与 AWS 通信。板载的 Microchip MCU 包含用于将 GSM/GPRS 模块接口到 UART 的固件,为用户提供易于使用的端点 AT 命令。UART 通信速度设置为 9600 bps。要启动通信,应将几个简单的 AT 命令字

符串传输到 Click 板的 UART 引脚。有关如何使用 AT 命令的所有信息可以在 AT 命令参考中找到。AnyNet 3G-EA Click 具有 IoT 按钮功能 - 一个路由到 mikroBUS™ 的 INT 引脚的引脚。将此引脚设置为高逻辑电平被视为 IoT 按钮按下。AWS IoT 网关识别三种类型的消息:短按、长按和双击。AWS IoT 按钮引脚基于 Amazon Dash 按钮硬件。此引脚的功能旨在让开发人员开始使用 AWS IoT、AWS 

Lambda、Amazon DynamoDB、Amazon SNS 和许多其他 Amazon Web Services。IoT 按钮引脚可以在云服务中编码以执行各种任务,例如 Netflix 的远程控制、Philips Hue 灯泡的开关、Airbnb 客人的签到/签出设备等。它还可以与第三方 API 集成,例如 Twitter、Facebook、Twilio、Slack 甚至自定义应用程序。

AnyNet 3G-EA Click (for EU and Australia) hardware overview image

功能概述

开发板

32L496GDISCOVERY Discovery 套件是一款功能全面的演示和开发平台,专为搭载 Arm® Cortex®-M4 内核的 STM32L496AG 微控制器设计。该套件适用于需要在高性能、先进图形处理和超低功耗之间取得平衡的应用,支持无缝原型开发,适用于各种嵌入式解决方案。STM32L496AG 采用创新的节能架构,集成

了扩展 RAM 和 Chrom-ART 图形加速器,在提升图形性能的同时保持低功耗,使其特别适用于音频处理、图形用户界面和实时数据采集等对能效要求较高的应用。为了简化开发流程,该开发板配备了板载 ST-LINK/V2-1 调试器/编程器,提供即插即用的调试和编程体验,使用户无需额外硬件即可轻松加载、调

试和测试应用程序。凭借低功耗特性、增强的内存能力以及内置调试工具,32L496GDISCOVERY 套件是开发先进嵌入式系统、实现高效能解决方案的理想选择。

Discovery kit with STM32L496AG MCU double side image

微控制器概述 

MCU卡片 / MCU

STM32L496AG Image

建筑

ARM Cortex-M4

MCU 内存 (KB)

1024

硅供应商

STMicroelectronics

引脚数

169

RAM (字节)

327680

你完善了我!

配件

GPS/3G 外置天线是我们 GPS/GSM/3G Click boards™ 的理想选择。它在提供强劲的 GSM 和 3G 信号接收以及出色的 GPS 定位能力方面表现优异。其坚固的设计采用螺丝安装和粘合底座,确保牢固的固定和最佳性能。该天线为 GPS、GSM 和 3G 提供独立的线路,是需要可靠通信和精确定位的应用的多功能选择。此天线覆盖 850/900/1800/1900/2100MHz 的宽频范围,并具有 50Ω 的阻抗,保证了在各种网络频段上的连接性。其 VSW 比为 2:1,峰值增益根据频率在 1 到 1.5dBic 之间,进一步增强了信号强度。天线的带宽超过 10MHz,确保了稳定的接收,而其线性极化和全向方位覆盖提供了全面的信号接入。

AnyNet 3G-EA Click accessories image

使用的MCU引脚

mikroBUS™映射器

Analog Output
PA4
AN
Sleep Mode
PB2
RST
DSR Handshake Output
PG11
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
DTR Handshake Input
PA0
PWM
IoT Button
PH2
INT
UART TX
PG10
TX
UART RX
PB6
RX
NC
NC
SCL
NC
NC
SDA
Power Supply
5V
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

AnyNet 3G-EA Click (for EU and Australia) Schematic schematic

一步一步来

项目组装

Discovery kit with STM32H750XB MCU front image hardware assembly

从选择您的开发板和Click板™开始。以Discovery kit with STM32L496AG MCU作为您的开发板开始。

Discovery kit with STM32H750XB MCU front image hardware assembly
Thermo 21 Click front image hardware assembly
Prog-cut hardware assembly
Thermo 21 Click complete accessories setup image hardware assembly
Board mapper by product7 hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
Discovery kit with STM32H750XB MCU NECTO MCU Selection Step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Necto image step 11 hardware assembly

软件支持

库描述

该库包含用于 AnyNet 3G-EA Click 驱动程序的 API。

关键功能:

  • anynet3gea_send_cmd - 向 Click 模块发送指定命令的功能

  • anynet3gea_send_cmd_with_par - 向 Click 模块发送带有指定参数的命令的功能

  • anynet3gea_send_cmd_check - 检查命令状态的功能

开源

代码示例

完整的应用程序代码和一个现成的项目可以通过NECTO Studio包管理器直接安装到NECTO Studio 应用程序代码也可以在MIKROE的GitHub账户中找到。

/*!
 * @file main.c
 * @brief AnyNet 3G-EA Click Example.
 *
 * # Description
 * This example demonstrates the use of AnyNet 3G-EA 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 anynet3gea_clear_app_buf ( void )
 * - static err_t anynet3gea_process ( void )
 * - static void anynet3gea_error_check( err_t error_flag )
 * - static void anynet3gea_log_app_buf ( void )
 * - static err_t anynet3gea_rsp_check ( uint8_t *rsp )
 *
 * @author Stefan Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "anynet3gea.h"

// Application buffer size
#define APP_BUFFER_SIZE                     256
#define PROCESS_BUFFER_SIZE                 256

static anynet3gea_t anynet3gea;
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 = ANYNET3GEA_OK;

/**
 * @brief Clearing application buffer.
 * @details This function clears memory of application
 * buffer and reset its length.
 */
static void anynet3gea_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 anynet3gea_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 anynet3gea_error_check ( err_t error_flag );

/**
 * @brief Logs application buffer.
 * @details This function logs data from application buffer.
 */
static void anynet3gea_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 anynet3gea_rsp_check ( uint8_t *rsp );

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    anynet3gea_cfg_t anynet3gea_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.
    anynet3gea_cfg_setup( &anynet3gea_cfg );
    ANYNET3GEA_MAP_MIKROBUS( anynet3gea_cfg, MIKROBUS_1 );
    if ( UART_ERROR == anynet3gea_init( &anynet3gea, &anynet3gea_cfg ) )
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );
        for ( ; ; );
    }
    
    anynet3gea_process( );
    anynet3gea_clear_app_buf( );

    // Check communication
    anynet3gea_send_cmd( &anynet3gea, ANYNET3GEA_CMD_AT );
    error_flag = anynet3gea_rsp_check( ANYNET3GEA_RSP_OK );
    anynet3gea_error_check( error_flag );
    
    // Query VERSION info for the AnyNet AWS IoT code
    anynet3gea_send_cmd( &anynet3gea, ANYNET3GEA_CMD_AWSVER );
    error_flag = anynet3gea_rsp_check( ANYNET3GEA_RSP_OK );
    anynet3gea_error_check( error_flag );
    
    // Query IMEI of the modem on the board
    anynet3gea_send_cmd( &anynet3gea, ANYNET3GEA_CMD_GSN );
    error_flag = anynet3gea_rsp_check( ANYNET3GEA_RSP_OK );
    anynet3gea_error_check( error_flag );
    
    // Query ICCID of the SIM
    anynet3gea_send_cmd( &anynet3gea, ANYNET3GEA_CMD_QCCID );
    error_flag = anynet3gea_rsp_check( ANYNET3GEA_RSP_OK );
    anynet3gea_error_check( error_flag );
    
    // Check AWS State
    anynet3gea_send_cmd_check( &anynet3gea, ANYNET3GEA_CMD_AWSSTATE );
    error_flag = anynet3gea_rsp_check( ANYNET3GEA_RSP_OK );
    anynet3gea_error_check( error_flag );
    
    // Open AWS topic
    #define AWS_TOPIC_OPEN "0,\"MY_TOPIC_OPEN\""
    anynet3gea_send_cmd_with_par( &anynet3gea, ANYNET3GEA_CMD_AWSPUBOPEN, AWS_TOPIC_OPEN );
    error_flag = anynet3gea_rsp_check( ANYNET3GEA_RSP_OK );
    anynet3gea_error_check( error_flag );
    
    // Subscribe to AWS topic
    #define AWS_TOPIC_SUBSCRIBE "0,\"MY_TOPIC_SUBSCRIBE\""
    anynet3gea_send_cmd_with_par( &anynet3gea, ANYNET3GEA_CMD_AWSSUBOPEN, AWS_TOPIC_SUBSCRIBE );
    error_flag = anynet3gea_rsp_check( ANYNET3GEA_RSP_OK );
    anynet3gea_error_check( error_flag );
    anynet3gea_clear_app_buf( );
    
    log_info( &logger, " Application Task " );
}

void application_task ( void )
{
    anynet3gea_process( );
    anynet3gea_log_app_buf( );
    anynet3gea_clear_app_buf( );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

static void anynet3gea_clear_app_buf ( void )
{
    memset( app_buf, 0, app_buf_len );
    app_buf_len = 0;
}

static err_t anynet3gea_process ( void )
{
    uint8_t rx_buf[ PROCESS_BUFFER_SIZE ] = { 0 };
    int32_t rx_size = 0;
    rx_size = anynet3gea_generic_read( &anynet3gea, 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 ANYNET3GEA_OK;
    }
    return ANYNET3GEA_ERROR;
}

static err_t anynet3gea_rsp_check ( uint8_t *rsp )
{
    uint32_t timeout_cnt = 0;
    uint32_t timeout = 120000;
    anynet3gea_clear_app_buf( );
    anynet3gea_process( );
    while ( ( 0 == strstr( app_buf, rsp ) ) &&
            ( 0 == strstr( app_buf, ANYNET3GEA_RSP_ERROR ) ) &&
            ( 0 == strstr( app_buf, ANYNET3GEA_RSP_SEND_FAIL ) ) )
    {
        anynet3gea_process( );
        if ( timeout_cnt++ > timeout )
        {
            anynet3gea_clear_app_buf( );
            return ANYNET3GEA_ERROR_TIMEOUT;
        }
        Delay_ms ( 1 );
    }
    Delay_ms ( 100 );
    anynet3gea_process( );
    if ( strstr( app_buf, rsp ) )
    {
        return ANYNET3GEA_OK;
    }
    else if ( strstr( app_buf, ANYNET3GEA_RSP_ERROR ) )
    {
        return ANYNET3GEA_ERROR_CMD;
    }
    else if ( strstr( app_buf, ANYNET3GEA_RSP_SEND_FAIL ) )
    {
        return ANYNET3GEA_ERROR_SEND;
    }
    else
    {
        return ANYNET3GEA_ERROR_UNKNOWN;
    }
}

static void anynet3gea_error_check ( err_t error_flag )
{
    switch ( error_flag )
    {
        case ANYNET3GEA_OK:
        {
            anynet3gea_log_app_buf( );
            break;
        }
        case ANYNET3GEA_ERROR_TIMEOUT:
        {
            log_error( &logger, " Timeout!" );
            break;
        }
        case ANYNET3GEA_ERROR_CMD:
        {
            log_error( &logger, " CMD!" );
            break;
        }
        case ANYNET3GEA_ERROR_SEND:
        {
            log_error( &logger, " SEND FAIL!" );
            break;
        }
        case ANYNET3GEA_ERROR_UNKNOWN:
        default:
        {
            log_error( &logger, " Unknown!" );
            break;
        }
    }
    Delay_ms ( 500 );
}

static void anynet3gea_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

额外支持

资源

喜欢这个项目吗?

'购买此套件' 按钮会直接带您进入购物车,您可以在购物车中轻松添加或移除产品。