中级
30 分钟

使用 LR1110 和 STM32L073RZ 为物联网通信开启新可能

连接不可达的区域

LR IoT Click with Nucleo-64 with STM32L073RZ MCU

已发布 6月 24, 2024

点击板

LR IoT Click

开发板

Nucleo-64 with STM32L073RZ MCU

编译器

NECTO Studio

微控制器单元

STM32L073RZ

LR物联网代表了连接的未来,一场开启物联网通信新可能的长距离革命。

A

A

硬件概览

它是如何工作的?

LR IoT Click基于Semtech Corporation的LR1110,这是一款旨在增强基于LoRa®的地理定位应用的长距离、超低功耗收发器。该平台解决方案支持LoRa®和(G)FSK调制,用于通过主动的868/915MHz ISM频段天线进行LPWAN应用,Mikroe也提供这种天线。LR1110还具有低功耗的多频段前端,可以获取多个用于地理定位的机会信号(802.11b/g/n WiFi AP MAC地址、GNSS(GPS、北斗)卫星信号),然后使用LPWAN网络将它们传输到地理定位服务器,该服务器计算物体的位置。此Click板™经过优化,适用于需要室内和室外地理定位的低功耗应用,例如资产定位、可追溯性、遗失和盗窃预防、资产回收和库存管理。LR1110使用三种操作模式:WiFi被动扫描和两种用于户外地理定位的GNSS模式,例如GNSS自主和辅助模式。通过WiFi被动扫描,LR1110可以发现设备附近可用的WiFi

 b/g/n接入点并提取MAC地址以进行地理定位。目标是至少获取2个MAC地址,并在发送到在线WiFi查找服务后定位设备。LR1110实现的WiFi被动扫描还可以提取接入点在信标或探测响应中包含的国家代码信息。除了WiFi,还有一个快速且低功耗的GNSS扫描器,使用我们提供的主动GNSS天线,捕捉GNSS卫星广播的信号的一小部分并提取计算设备位置所需的信息。这些信息然后被汇集成NAV消息,可以发送到后端系统以计算设备位置。如前所述,GNSS扫描器有两种操作模式:自主和辅助。在自主模式下,不需要任何辅助数据,LR1110会搜索和解码强卫星的信号以进行室内/室外检测,而在辅助模式下,可以搜索所有可见卫星,并且需要与地理定位服务器连接以计算设备位置。此Click板™通过标准SPI接口与MCU通信,支持最常见的SPI模式——SPI模式0,最大频率为16MHz。它还具有

一个中断引脚,连接到mikroBUS™插槽的INT引脚,使主机MCU可以对LR1110系统中的特殊事件作出反应而无需寄存器轮询。一个“BUSY”指示器,标记为BSY,并连接到mikroBUS™插槽的PWM引脚,表示内部MCU无法接收来自主机MCU的任何命令,还有一个连接在mikroBUS™插槽RST引脚和板载复位按钮上的通用复位功能。它还使用两个LED指示器,标记为STAT1和STAT2,用于可选的GNSS和WiFi网络活动状态的视觉指示,当然也可以根据用户自己的愿望和需求进行配置。此Click板™仅可在3.3V逻辑电压水平下运行。使用具有不同逻辑电平的MCU之前,板必须进行适当的逻辑电压电平转换。此外,它配备了包含函数和示例代码的库,可用作进一步开发的参考。

LR IoT Click hardware overview image

功能概述

开发板

Nucleo-64搭载STM32L073RZ MCU提供了一个经济实惠且灵活的平台,供开发人员探索新的想法并原型化其设计。该板利用了STM32微控制器的多功能性,使用户能够为其项目选择性能和功耗之间的最佳平衡。它采用LQFP64封装的STM32微控制器,并包括一些必要的组件,例如用户LED,可以同时作为ARDUINO®信号使用,以及用户和复位按钮,以及用于精准定时操作的32.768kHz晶体振荡器。设计时考虑了扩展性和灵活性,Nucleo-64板具有ARDUINO® 

Uno V3扩展连接器和ST morpho扩展引脚标头,为全面项目集成提供了对STM32 I/O的完全访问权限。电源选项具有适应性,支持ST-LINK USB VBUS或外部电源,确保在各种开发环境中的适应性。该板还配备了一个内置的ST-LINK调试器/编程器,具有USB重新枚举功能,简化了编程和调试过程。此外,该板还设计了外部SMPS,以实现有效的Vcore逻辑供电,支持USB设备全速或USB SNK/UFP全速,以及内置的加密功能,增强了项目的功耗效率和安全性。通过专用

连接器提供了额外的连接性,用于外部SMPS实验、ST-LINK的USB连接器和MIPI®调试连接器,扩展了硬件接口和实验的可能性。开发人员将通过STM32Cube MCU软件包中全面的免费软件库和示例得到广泛的支持。这与与各种集成开发环境(IDE)的兼容性相结合,包括IAR Embedded Workbench®、MDK-ARM和STM32CubeIDE,确保了平稳高效的开发体验,使用户能够充分发挥Nucleo-64板在其项目中的功能。

Nucleo 64 with STM32L073RZ MCU double side image

微控制器概述 

MCU卡片 / MCU

default

建筑

ARM Cortex-M0

MCU 内存 (KB)

192

硅供应商

STMicroelectronics

引脚数

64

RAM (字节)

20480

你完善了我!

配件

Click Shield for Nucleo-64 配备了两个专有的 mikroBUS™ 插座,使得所有的 Click board™ 设备都可以轻松地与 STM32 Nucleo-64 开发板连接。这样,Mikroe 允许其用户从不断增长的 Click boards™ 范围中添加任何功能,如 WiFi、GSM、GPS、蓝牙、ZigBee、环境传感器、LED、语音识别、电机控制、运动传感器等。您可以使用超过 1537 个 Click boards™,这些 Click boards™ 可以堆叠和集成。STM32 Nucleo-64 开发板基于 64 引脚封装的微控制器,采用 32 位 MCU,配备 ARM Cortex M4 处理器,运行速度为 84MHz,具有 512Kb Flash 和 96KB SRAM,分为两个区域,顶部区域代表 ST-Link/V2 调试器和编程器,而底部区域是一个实际的开发板。通过 USB 连接方便地控制和供电这些板子,以便直接对 Nucleo-64 开发板进行编程和高效调试,其中还需要额外的 USB 线连接到板子上的 USB 迷你接口。大多数 STM32 微控制器引脚都连接到了板子左右边缘的 IO 引脚上,然后连接到两个现有的 mikroBUS™ 插座上。该 Click Shield 还有几个开关,用于选择 mikroBUS™ 插座上模拟信号的逻辑电平和 mikroBUS™ 插座本身的逻辑电压电平。此外,用户还可以通过现有的双向电平转换器,使用任何 Click board™,无论 Click board™ 是否在 3.3V 或 5V 逻辑电压电平下运行。一旦将 STM32 Nucleo-64 开发板与我们的 Click Shield for Nucleo-64 连接,您就可以访问数百个工作于 3.3V 或 5V 逻辑电压电平的 Click boards™。

Click Shield for Nucleo-64 accessories 1 image

868MHz直角橡胶天线是一种紧凑而多功能的无线通信解决方案。其工作频率范围为868-915MHz,确保最佳的信号接收和传输。具有50欧姆阻抗,兼容各种设备和系统。这款天线具有2dB增益,增强信号强度并延长通信范围。其垂直极化进一步提高了信号清晰度。设计能够处理高达50W的输入功率,是各种应用的坚固选择。天线长度仅为48毫米,既隐蔽又实用。SMA公头连接器确保与设备的连接安全可靠。无论是与物联网设备、远程传感器或其他无线技术配合使用,868MHz直角天线都能提供您所需的性能和灵活性,实现无缝通信。

LR IoT Click accessories 1 image

这款GPS有源嵌入式天线是我们提供的所有GPS/GNSS Click板™的绝佳选择。凭借其高增益和有源频段过滤功能,当需要增强定位时,它是完美的选择。它可以直接安装在PCB上。GPS/GNSS模块配有一根10厘米长的小电缆,允许其远离小型IPEX连接器进行定位。

LR IoT Click accessories 2 image

WiFi橡胶2.4GHz天线是一款为搭载WiFi模块的Click板™应用设计的多功能配件。这款天线专为增强无线连接而量身定制,是开发人员和工程师的必备之选。天线顶端采用直角SMA公头连接器,能够与Click板™或SMA母模块连接器无缝集成。这种用户友好型设计简化了安装,并确保在各种设置中的灵活性。工作在2400-2500MHz频率范围内,这款天线保证在广泛的WiFi网络中提供可靠连接。其50欧姆阻抗促进了高效的信号传输,而2dB增益显著增强了信号强度和范围。100MHz带宽轻松满足数据传输和通信稳定性需求。垂直极化进一步提高了信号接收能力。天线可以处理最高50W的输入功率,使其适用于高功率应用而不影响性能。其紧凑的50毫米长度确保其隐蔽且不引人注目。无论您是在设计物联网设备、智能家居应用还是工业设备,这款配备SMA公头连接器的WiFi橡胶天线都是确保最佳无线连接的理想选择。它是一款强大的工具,可使您的设备在无线技术中保持可靠连接和有效通信。

LR IoT Click accessories 3 image

IPEX-SMA 电缆是一种射频 (RF) 电缆组件。"IPEX" 指的是 IPEX 连接器,这是一种常用于小型电子设备的微型同轴连接器。"SMA" 代表 SubMiniature Version A,是另一种常用于射频应用的同轴连接器。IPEX-SMA 电缆组件的一端是 IPEX 连接器,另一端是 SMA 连接器,使其能够连接使用这些特定连接器的设备或组件。这些电缆常用于 WiFi 或蜂窝天线、GPS 模块以及其他需要可靠且低损耗连接的射频通信系统。

LR IoT Click accessories 4 image

使用的MCU引脚

mikroBUS™映射器

NC
NC
AN
Reset
PC12
RST
SPI Chip Select
PB12
CS
SPI Clock
PB3
SCK
SPI Data OUT
PB4
MISO
SPI Data IN
PB5
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Busy Indicator
PC8
PWM
Interrupt
PC14
INT
NC
NC
TX
NC
NC
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
1

“仔细看看!”

Click board™ 原理图

LR IoT Click Schematic schematic

一步一步来

项目组装

Click Shield for Nucleo-64 accessories 1 image hardware assembly

从选择您的开发板和Click板™开始。以Nucleo-64 with STM32L073RZ MCU作为您的开发板开始。

Click Shield for Nucleo-64 accessories 1 image hardware assembly
Nucleo 64 with STM32F401RE MCU front image hardware assembly
LTE IoT 5 Click front image hardware assembly
Prog-cut hardware assembly
LTE IoT 5 Click complete accessories setup image hardware assembly
Board mapper by product8 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
Clicker 4 for STM32F4 HA MCU Step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

软件支持

库描述

该库包含 LR IoT Click 驱动程序的 API。

关键功能:

  • lriot_get_wifi_scan_results - 此函数执行WiFi扫描并读取结果

  • lriot_get_gnss_scan_results - 此函数执行GNSS扫描并读取结果

  • lriot_send_lora_message - 此函数向接收器发送LoRa消息

开源

代码示例

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

/*!
 * @file main.c
 * @brief LR IoT Click example
 *
 * # Description
 * This example demonstrates the use of LR IoT Click board by reading a GNSS and WiFi 
 * scanning results and displaying it on the USB UART. In the case of a tranceive firmware
 * the communication between two devices over LoRa will be demonstrated as well.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver, performs the Click default configuration, and after that reads
 * and displays the chip's firmware information. In the case you need to update or change the default
 * firmware refer to the @b LRIOT_UPDATE_FIRMWARE and @b LRIOT_FIRMWARE_SELECTOR macro definition.
 *
 * ## Application Task
 * There are 3 types of the example: 
 * 1. Modem firmware: reads a GNSS and WiFi scanning results and displays them on the USB UART.
 * 2. Transcever firmware (application mode transmitter ): reads a GNSS and WiFi scanning results
 *    as well as the chip internal temperature and sends specific LoRa messages containing that information
 *    to the LoRa receiver.
 * 3. Transcever firmware (application mode receiver): reads all incoming LoRa packets and displays them
 *    on the USB UART.
 *
 * @author Stefan Filipovic
 *
 */
#include "board.h"
#include "log.h"
#include "lriot.h"
#include "conversions.h"

static lriot_t lriot;
static log_t logger;

#if ( LRIOT_FIRMWARE_SELECTOR == LRIOT_TRANSCEIVE_FIRMWARE )
// Comment out the line below in order to switch the application mode to receiver
#define DEMO_APP_TRANSMITTER
#endif

/**
 * @brief LR IoT display gnss scan results function.
 * @details This function parses a GNSS scan results object and displays it on the USB UART.
 * @param[in] results : GNSS scan results object.
 * See #lriot_gnss_scan_results_t object definition for detailed explanation.
 * @return None.
 * @note None.
 */
static void lriot_display_gnss_scan_results ( lriot_gnss_scan_results_t results );

/**
 * @brief LR IoT display wifi scan results function.
 * @details This function parses a WiFi scan results object and displays it on the USB UART.
 * @param[in] results : WiFi scan results object.
 * See #lriot_wifi_scan_results_t object definition for detailed explanation.
 * @return None.
 * @note None.
 */
static void lriot_display_wifi_scan_results ( lriot_wifi_scan_results_t results );

/**
 * @brief LR IoT display chip info function.
 * @details This function parses a chip firmware information object and displays it on the USB UART.
 * @param[in] info : Chip information object.
 * See #lriot_chip_info_t object definition for detailed explanation.
 * @return None.
 * @note None.
 */
static void lriot_display_chip_info ( lriot_chip_info_t info );

void application_init ( void )
{
    log_cfg_t log_cfg;      /**< Logger config object. */
    lriot_cfg_t lriot_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.
    lriot_cfg_setup( &lriot_cfg );
    LRIOT_MAP_MIKROBUS( lriot_cfg, MIKROBUS_1 );
    
    if ( SPI_MASTER_ERROR == lriot_init( &lriot, &lriot_cfg ) )
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    if ( LRIOT_ERROR == lriot_default_cfg ( &lriot ) )
    {
        log_error( &logger, " Default configuration." );
        for ( ; ; );
    }
    
    lriot_chip_info_t chip_info;
    if ( LRIOT_OK == lriot_get_chip_info ( &lriot, &chip_info ) ) 
    {
        lriot_display_chip_info ( chip_info );
    }
    
    log_info( &logger, " Application Task " );
}

void application_task ( void )
{
#if ( LRIOT_FIRMWARE_SELECTOR == LRIOT_TRANSCEIVE_FIRMWARE )
    uint8_t lora_buffer[ LRIOT_LORA_PKT_PAYLOAD_LEN ] = { 0 };
    #ifdef DEMO_APP_TRANSMITTER
        lriot_gnss_scan_results_t gnss_results = { 0 };
        lriot_wifi_scan_results_t wifi_results = { 0 };
        uint8_t tmp_buf[ 30 ] = { 0 };
        float temperature = 0;
        
        if ( LRIOT_OK == lriot_get_gnss_scan_results ( &lriot, &gnss_results ) )
        {
            lriot_display_gnss_scan_results ( gnss_results );
        }
        
        memset( lora_buffer, 0, sizeof ( lora_buffer ) );
        strcpy( lora_buffer, "Number of sattelites found is " );
        uint16_to_str ( gnss_results.num_satellites, tmp_buf );
        l_trim ( tmp_buf );
        strcat( lora_buffer, tmp_buf );
        if ( LRIOT_OK == lriot_send_lora_message ( &lriot, lora_buffer ) )
        {
            log_printf( &logger, "Send LoRa message - done\r\n" );
        }
        
        if ( LRIOT_OK == lriot_get_wifi_scan_results ( &lriot, &wifi_results ) )
        {
            lriot_display_wifi_scan_results ( wifi_results );
        }
        memset( lora_buffer, 0, sizeof ( lora_buffer ) );
        strcpy( lora_buffer, "Number of WiFi scan results is " );
        uint16_to_str ( wifi_results.num_wifi_results, tmp_buf );
        l_trim ( tmp_buf );
        strcat( lora_buffer, tmp_buf );
        if ( LRIOT_OK == lriot_send_lora_message ( &lriot, lora_buffer ) )
        {
            log_printf( &logger, "Send LoRa message - done\r\n" );
        }
        
        log_printf ( &logger, "**************************************************************\r\n" );
        if ( LRIOT_OK == lriot_get_temperature ( &lriot, &temperature ) )
        {
            log_printf ( &logger, "Temperature : %.2f degC\r\n", temperature );
        }
        memset( lora_buffer, 0, sizeof ( lora_buffer ) );
        strcpy( lora_buffer, "My temperature is " );
        float_to_str ( temperature, tmp_buf );
        l_trim ( tmp_buf );
        tmp_buf[ 5 ] = 0;
        strcat( lora_buffer, tmp_buf );
        strcat( lora_buffer, " degC" );
        if ( LRIOT_OK == lriot_send_lora_message ( &lriot, lora_buffer ) )
        {
            log_printf( &logger, "Send LoRa message - done\r\n" );
        }
    #else
        lriot_lora_packet_status_t pkt_status;
        if ( LRIOT_OK == lriot_read_lora_message ( &lriot, &pkt_status, lora_buffer ) )
        {
            log_printf ( &logger, "**************************************************************\r\n" );
            log_printf ( &logger, "*                      RECEIVED LORA PACKET                  *\r\n" );
            log_printf ( &logger, "**************************************************************\r\n" );
            log_printf ( &logger, " RSSI        : %d dBm\r\n", ( uint16_t ) pkt_status.rssi_pkt_in_dbm );
            log_printf ( &logger, " Signal RSSI : %d dBm\r\n", ( uint16_t ) pkt_status.signal_rssi_pkt_in_dbm );
            log_printf ( &logger, " SNR         : %d dB\r\n", ( uint16_t ) pkt_status.snr_pkt_in_db );
            log_printf ( &logger, " Message     : \"%s\"\r\n\n", lora_buffer );
        }
    #endif
#else
    lriot_gnss_scan_results_t gnss_results = { 0 };
    lriot_wifi_scan_results_t wifi_results = { 0 };
    
    if ( LRIOT_OK == lriot_get_gnss_scan_results ( &lriot, &gnss_results ) )
    {
        lriot_display_gnss_scan_results ( gnss_results );
    }
    
    if ( LRIOT_OK == lriot_get_wifi_scan_results ( &lriot, &wifi_results ) )
    {
        lriot_display_wifi_scan_results ( wifi_results );
    }
#endif
}

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 lriot_display_gnss_scan_results ( lriot_gnss_scan_results_t results )
{
    log_printf ( &logger, "**************************************************************\r\n" );
    log_printf ( &logger, "*                      GNSS SCAN RESULTS                     *\r\n" );
    log_printf ( &logger, "**************************************************************\r\n" );
    log_printf ( &logger, "Number of satellites found: %u\r\n", ( uint16_t ) results.num_satellites );
    
#if ( LRIOT_FIRMWARE_SELECTOR == LRIOT_TRANSCEIVE_FIRMWARE )
    for ( uint8_t cnt = 0; cnt < results.num_satellites; cnt++ )
    {
        log_printf ( &logger, "{\r\n\tSatellite ID : %u", results.satellite_id_cnr_doppler[ cnt ].satellite_id );
        log_printf ( &logger, "\r\n\tC/N0         : %d dB-Hz", results.satellite_id_cnr_doppler[ cnt ].cnr );
        log_printf ( &logger, "\r\n\tSV doppler   : %d Hz\r\n},\r\n", results.satellite_id_cnr_doppler[ cnt ].doppler );
    }
#else
    for ( uint8_t cnt = 0; cnt < results.num_satellites; cnt++ )
    {
        log_printf ( &logger, "{\r\n\tSatellite ID : %u", results.satellite_id_cnr[ cnt ].satellite_id );
        log_printf ( &logger, "\r\n\tC/N0         : %d dB-Hz\r\n},\r\n", results.satellite_id_cnr[ cnt ].cnr );
    }
#endif
    if ( ( results.scan_results_len > 0 ) && 
         ( LR1110_GNSS_DESTINATION_SOLVER == results.destination_id ) )
    {
        log_printf ( &logger, "NAV message : " );
        for ( uint16_t cnt = 0; cnt < results.scan_results_len; cnt++ )
        {
            log_printf ( &logger, "%.2X", results.scan_results[ cnt ] );
        }
        log_printf ( &logger, "\r\n" );
    }
}

static void lriot_display_wifi_scan_results ( lriot_wifi_scan_results_t results )
{
    log_printf ( &logger, "**************************************************************\r\n" );
    log_printf ( &logger, "*                      WiFi SCAN RESULTS                     *\r\n" );
    log_printf ( &logger, "**************************************************************\r\n" );
    log_printf ( &logger, "Number of WiFi results: %u\r\n", ( uint16_t ) results.num_wifi_results );

    for ( uint8_t i = 0; i < results.num_wifi_results; i++ )
    {
        log_printf ( &logger, "{\r\n\tSSID   : \"%s\",\r\n\tMAC    : \"", results.scan_results[ i ].ssid_bytes );
        for ( uint16_t j = 0; j < LR1110_WIFI_MAC_ADDRESS_LENGTH; j++ )
        {
            log_printf ( &logger, "%.2x", ( uint16_t ) results.scan_results[ i ].mac_address_2[ j ] );
            if ( j < ( LR1110_WIFI_MAC_ADDRESS_LENGTH - 1 ) )
            {
                log_printf ( &logger, ":" );
            }
        }
        log_printf ( &logger, "\",\r\n\tChannel: %u,\r\n", ( int16_t ) results.scan_results[ i ].current_channel );
        log_printf ( &logger, "\tType   : %u,\r\n", ( int16_t ) results.scan_results[ i ].data_rate_info_byte );
        log_printf ( &logger, "\tRSSI   : %d dBm\r\n},\r\n", ( int16_t ) results.scan_results[ i ].rssi );
    }
    log_printf ( &logger, "Scanning time : %d ms\r\n",
                 ( results.timings.demodulation_us + results.timings.rx_capture_us +
                   results.timings.rx_correlation_us + results.timings.rx_detection_us ) / 1000 );
}

static void lriot_display_chip_info ( lriot_chip_info_t info )
{
    log_printf ( &logger, "**************************************************************\r\n");
    log_printf ( &logger, "*                          CHIP INFO                         *\r\n");
    log_printf ( &logger, "**************************************************************\r\n");
    
#if ( LRIOT_FIRMWARE_SELECTOR == LRIOT_TRANSCEIVE_FIRMWARE )
    log_printf ( &logger, "HARDWARE   : 0x%.2X\r\n", ( uint16_t ) info.version.hw );
    log_printf ( &logger, "TYPE       : 0x%.2X\r\n", ( uint16_t ) info.version.type );
    log_printf ( &logger, "FIRMWARE   : 0x%.4X\r\n", info.version.fw );
    
    log_printf ( &logger, "UID        : " );
    for ( uint8_t cnt = 0; cnt < ( LR1110_SYSTEM_UID_LENGTH - 1 ); cnt++ )
    {
        log_printf ( &logger, "%.2X-", ( uint16_t ) info.uid[ cnt ] );
    }
    log_printf ( &logger, "%.2X\r\n", ( uint16_t ) info.uid[ LR1110_SYSTEM_UID_LENGTH - 1 ] );
    log_printf ( &logger, "JOIN EUI   : " );
    for ( uint8_t cnt = 0; cnt < ( LR1110_SYSTEM_JOIN_EUI_LENGTH - 1 ); cnt++ )
    {
        log_printf ( &logger, "%.2X-", ( uint16_t ) info.join_eui[ cnt ] );
    }
    log_printf ( &logger, "%.2X\r\n", ( uint16_t ) info.join_eui[ LR1110_SYSTEM_JOIN_EUI_LENGTH - 1 ] );
    log_printf ( &logger, "PIN        : " );
    for ( uint8_t cnt = 0; cnt < LR1110_SYSTEM_PIN_LENGTH; cnt++ )
    {
        log_printf ( &logger, "%.2X", ( uint16_t ) info.pin[ cnt ] );
    }
    log_printf ( &logger, "\r\n\n" );
#else
    log_printf ( &logger, "BOOTLOADER : 0x%.8LX\r\n", info.version.bootloader );
    log_printf ( &logger, "FIRMWARE   : 0x%.8LX\r\n", info.version.firmware );
    log_printf ( &logger, "LORAWAN    : 0x%.4X\r\n", info.version.lorawan );
    
    log_printf ( &logger, "CHIP EUI   : " );
    for ( uint8_t cnt = 0; cnt < ( LR1110_MODEM_CHIP_EUI_LENGTH - 1 ); cnt++ )
    {
        log_printf ( &logger, "%.2X-", ( uint16_t ) info.chip_eui[ cnt ] );
    }
    log_printf ( &logger, "%.2X\r\n", ( uint16_t ) info.chip_eui[ LR1110_MODEM_CHIP_EUI_LENGTH - 1 ] );
    log_printf ( &logger, "DEV EUI    : " );
    for ( uint8_t cnt = 0; cnt < ( LR1110_MODEM_DEV_EUI_LENGTH - 1 ); cnt++ )
    {
        log_printf ( &logger, "%.2X-", ( uint16_t ) info.dev_eui[ cnt ] );
    }
    log_printf ( &logger, "%.2X\r\n", ( uint16_t ) info.dev_eui[ LR1110_MODEM_DEV_EUI_LENGTH - 1 ] );
    log_printf ( &logger, "JOIN EUI   : " );
    for ( uint8_t cnt = 0; cnt < ( LR1110_MODEM_JOIN_EUI_LENGTH - 1 ); cnt++ )
    {
        log_printf ( &logger, "%.2X-", ( uint16_t ) info.join_eui[ cnt ] );
    }
    log_printf ( &logger, "%.2X\r\n", ( uint16_t ) info.join_eui[ LR1110_MODEM_JOIN_EUI_LENGTH - 1 ] );
    log_printf ( &logger, "PIN        : %.8LX\r\n\n", info.pin );
#endif
}

// ------------------------------------------------------------------------ END

额外支持

资源

喜欢这个项目吗?

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