Intermediate
20 min

Achieve long-range IoT connectivity with Wio-E5-LE and PIC32MZ1024EFH064

Ultra-low-power long-range IoT communication solution

LR 15 Click with PIC32MZ clicker

Published Jan 21, 2025

Click board™

LR 15 Click

Dev. board

PIC32MZ clicker

Compiler

NECTO Studio

MCU

PIC32MZ1024EFH064

Ultra-low-power, long-range IoT connectivity with reliable LoRaWAN® support

A

A

Hardware Overview

How does it work?

LR 15 Click is based on the Wio-E5-LE, a LoRaWAN® module from Seeed Studio designed for ultra-low-power long-range communication. As the newest innovation in the Wio-E5 series, the Wio-E5-LE redefines power efficiency, offering remarkably low power consumption while delivering high-performance wireless communication. Built around the STM32WLE5JC system-on-chip (SoC) from STMicroelectronics, the module integrates a high-performance SX126X LoRa® chip with an ultra-low-power microcontroller, making it a perfect choice for a wide range of IoT applications requiring reliable and energy-efficient operation including wireless meter reading, sensor networks, and other low-power wide-area network (LPWAN) use cases. Supporting both LoRa® and (G)FSK modulation modes, the Wio-E5-LE provides many communication capabilities. LoRa® mode offers adjustable bandwidths of 62.5kHz, 125kHz, 250kHz, and 500kHz, allowing users to optimize performance based on specific application requirements. With a transmission output power of 14dBm at 868/915MHz, an exceptional sensitivity of -136.5dBm at SF12 with 125kHz bandwidth, and an impressive link budget of 158dB, this module ensures reliable and long-range connectivity even

in challenging environments. It has an embedded LoRaWAN® protocol and AT command support, enabling seamless integration and efficient operation across global frequency plans such as EU868, US915, AU915, AS923, KR920, and IN865. This Click board™ is designed in a unique format supporting the newly introduced MIKROE feature called "Click Snap." Unlike the standardized version of Click boards, this feature allows the main module area to become movable by breaking the PCB, opening up many new possibilities for implementation. Thanks to the Snap feature, the Wio-E5-LE can operate autonomously by accessing its signals directly on the pins marked 1-8. Additionally, the Snap part includes a specified and fixed screw hole position, enabling users to secure the Snap board in their desired location. The LR 15 Click communicates with the host MCU through a UART interface and AT commands via standard UART RX and TX pins. The default communication speed is set at 115200bps, ensuring efficient data exchange. It also provides an I2C interface. Still, it must be noted that the I2C interface can only be operated in the peripheral mode. In addition to the interface pins, the board features a reset (RST) pin and a RESET button for hard resetting the module

when necessary. The built-in AT command firmware on the module can be upgraded using the UART interface. This enables programming when the module is set to boot mode, which is activated by pressing the dedicated BOOT button on the board, simplifying the firmware upgrade process. Additionally, users can develop custom software using the module's internal MCU. This is supported by the SWD interface, which allows for efficient program erasure and reprogramming and provides flexibility for advanced development and customization. The board features one u.Fl connector for the main LTE antenna that MIKROE offers, like the ISM 868/915MHz Active PCB Antenna for efficient connectivity. In addition to the antenna connector, the board also includes SWD pads designed for use with MIKROE's 6-pin Needle Cable, providing an optional flash and debug SWD (Serial Wire Debug) interface functionality. This Click board™ can be operated only with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. It also comes equipped with a library containing functions and example code that can be used as a reference for further development.

LR 15 Click hardware overview image

Features overview

Development board

PIC32MZ Clicker is a compact starter development board that brings the flexibility of add-on Click boards™ to your favorite microcontroller, making it a perfect starter kit for implementing your ideas. It comes with an onboard 32-bit PIC32MZ microcontroller with FPU from Microchip, a USB connector, LED indicators, buttons, a mikroProg connector, and a header for interfacing with external electronics. Thanks to its compact design with clear and easy-recognizable silkscreen markings, it provides a fluid and immersive working experience, allowing access anywhere and under

any circumstances. Each part of the PIC32MZ Clicker development kit contains the components necessary for the most efficient operation of the same board. In addition to the possibility of choosing the PIC32MZ Clicker programming method, using USB HID mikroBootloader, or through an external mikroProg connector for PIC, dsPIC, or PIC32 programmer, the Clicker board also includes a clean and regulated power supply module for the development kit. The USB Micro-B connection can provide up to 500mA of current, which is more than enough to operate all onboard

and additional modules. All communication methods that mikroBUS™ itself supports are on this board, including the well-established mikroBUS™ socket, reset button, and several buttons and LED indicators. PIC32MZ Clicker is an integral part of the Mikroe ecosystem, allowing you to create a new application in minutes. Natively supported by Mikroe software tools, it covers many aspects of prototyping thanks to a considerable number of different Click boards™ (over a thousand boards), the number of which is growing every day.

PIC32MZ clicker double side image

Microcontroller Overview

MCU Card / MCU

default

Architecture

PIC32

MCU Memory (KB)

1024

Silicon Vendor

Microchip

Pin count

64

RAM (Bytes)

524288

You complete me!

Accessories

ISM 868/915MHz Active FPC Antenna (W3312B0100) is a powerful multiband active flat patch antenna from Pulse Electronics ideal for use in LPWA applications. This compact yet efficient flat patch antenna, designed for use in the 868MHz and 915MHz frequency bands, boasts a gain of typical 0.8dBi and a 75x15mm size. With a nominal impedance of 50Ω, it seamlessly integrates with your existing setup. The FPC material used in the antenna guarantees both durability and reliability, while its 2W power rating ensures consistent and trustworthy performance. It includes a 100mm OD coax cable with a U.FL connector, enabling seamless connectivity. Moreover, the W3312B0100 antenna provides convenient and secure mounting options through its flexible PCB thickness of 0.1mm and adhesive tape on the backside. This antenna offers reliable performance and versatility, whether for LoRaWAN®, Sigfox®, WiFi HaLow™, or other ISM and remote control applications. Additionally, it caters to various industries, including M2M, IoT, metering, and industrial automation, making it an excellent choice for a wide range of applications.

LR 15 Click accessories 1 image

6-pin Needle Cable is a compact programming cable made from high-quality materials for longevity and easy portability with a tiny square footprint, similar to a 0805 resistor. Designed for quick programming and debugging, it features a 6-pin 0.1″ pitch ribbon connector and is hand-held or temporarily fixable.

LR 15 Click accessories 2 image

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
Reset
RE5
RST
ID COMM
RG9
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
Boot Mode Control
RB3
PWM
NC
NC
INT
UART TX
RB2
TX
UART RX
RB0
RX
I2C Clock
RD10
SCL
I2C Data
RD9
SDA
NC
NC
5V
Ground
GND
GND
1

Take a closer look

Click board™ Schematic

LR 15 Click Schematic schematic

Step by step

Project assembly

PIC32MZ clicker front image hardware assembly

Start by selecting your development board and Click board™. Begin with the PIC32MZ clicker as your development board.

PIC32MZ clicker front image hardware assembly
GNSS2 Click front image hardware assembly
Prog-cut hardware assembly
GNSS2 Click complete accessories setup image hardware assembly
Micro B Connector Clicker Access - upright/background 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
Flip&Click PIC32MZ 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

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

LR 15 Click demo application is developed using the NECTO Studio, ensuring compatibility with mikroSDK's open-source libraries and tools. Designed for plug-and-play implementation and testing, the demo is fully compatible with all development, starter, and mikromedia boards featuring a mikroBUS™ socket.

Example Description
This example demonstrates the use of LR 15 Click board by showing the communication between two Click boards configured in TEST mode.

Key functions:

  • lr15_cfg_setup - Config Object Initialization function.

  • lr15_init - Initialization function.

  • lr15_reset_device - This function resets the device by toggling the reset pin logic state.

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

  • lr15_cmd_set - This function sets a value to a specified command of the Click module.

Application Init
Initializes the driver and logger.

Application Task
Application task is split in few stages:

  • LR15_POWER_UP: Powers up the device, performs a device factory reset and reads system information.

  • LR15_CONFIG_EXAMPLE: Configures device for the LoRa P2P network mode.

  • LR15_EXAMPLE: Performs a LoRa P2P test example by exchanging messages with another LR 14 Click board.

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 LR 15 Click Example.
 *
 * # Description
 * This example demonstrates the use of LR 15 Click board by showing
 * the communication between two Click boards configured in TEST mode.
 *
 * The demo application is composed of two sections :
 *
 * ## Application Init
 * Initializes the driver and logger.
 *
 * ## Application Task
 * Application task is split in few stages:
 *  - LR15_POWER_UP:
 * Powers up the device, performs a device factory reset and reads system information.
 *  - LR15_CONFIG_EXAMPLE:
 * Configures device for the LoRa P2P network mode.
 *  - LR15_EXAMPLE:
 * Performs a LoRa P2P test example by exchanging messages with another LR 15 Click board.
 *
 * ## Additional Function
 * - static void lr15_clear_app_buf ( void )
 * - static void lr15_log_app_buf ( void )
 * - static err_t lr15_process ( lr15_t *ctx )
 * - static err_t lr15_read_response ( lr15_t *ctx, uint8_t *rsp, uint32_t timeout )
 * - static err_t lr15_power_up ( lr15_t *ctx )
 * - static err_t lr15_config_example ( lr15_t *ctx )
 * - static err_t lr15_example ( lr15_t *ctx )
 *
 * @author Stefan Filipovic
 *
 */

#include "board.h"
#include "log.h"
#include "lr15.h"
#include "conversions.h"
#include "generic_pointer.h"

#define DEMO_TEXT_MESSAGE   "MIKROE - LR 15 Click board"

static lr15_t lr15;
static log_t logger;

// Application buffer size
#define APP_BUFFER_SIZE     600
#define PROCESS_BUFFER_SIZE 200

static uint8_t app_buf[ APP_BUFFER_SIZE ] = { 0 };
static int32_t app_buf_len = 0;

/**
 * @brief Example states.
 * @details Predefined enum values for application example state.
 */
typedef enum
{
    LR15_POWER_UP = 1,
    LR15_CONFIG_EXAMPLE,
    LR15_EXAMPLE

} lr15_app_state_t;

static lr15_app_state_t app_state = LR15_POWER_UP;

/**
 * @brief LR 15 clearing application buffer.
 * @details This function clears memory of application buffer and reset its length.
 * @note None.
 */
static void lr15_clear_app_buf ( void );

/**
 * @brief LR 15 log application buffer.
 * @details This function logs data from application buffer to USB UART.
 * @note None.
 */
static void lr15_log_app_buf ( void );

/**
 * @brief LR 15 data reading function.
 * @details This function reads data from device and concatenates data to application buffer. 
 * @param[in] ctx : Click context object.
 * See #lr15_t object definition for detailed explanation.
 * @return @li @c  0 - Read some data.
 *         @li @c -1 - Nothing is read.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
static err_t lr15_process ( lr15_t *ctx );

/**
 * @brief LR 15 read response function.
 * @details This function waits for a response message, reads and displays it on the USB UART.
 * @param[in] ctx : Click context object.
 * See #lr15_t object definition for detailed explanation.
 * @param[in] rsp : Expected response.
 * @param[in] timeout : Response timeout in milliseconds.
 * @return @li @c  0 - OK response.
 *         @li @c -2 - Timeout error.
 *         @li @c -3 - Command error.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
static err_t lr15_read_response ( lr15_t *ctx, uint8_t *rsp, uint32_t timeout );

/**
 * @brief LR 15 power up function.
 * @details This function powers up the device, performs device factory reset and
 * reads system information.
 * @param[in] ctx : Click context object.
 * See #lr15_t object definition for detailed explanation.
 * @return @li @c    0 - OK.
 *         @li @c != 0 - Read response error.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
static err_t lr15_power_up ( lr15_t *ctx );

/**
 * @brief LR 15 config example function.
 * @details This function configures device for LoRa P2P example.
 * @param[in] ctx : Click context object.
 * See #lr15_t object definition for detailed explanation.
 * @return @li @c    0 - OK.
 *         @li @c != 0 - Read response error.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
static err_t lr15_config_example ( lr15_t *ctx );

/**
 * @brief LR 15 example function.
 * @details This function performs a LoRa P2P test example by exchanging messages
 * with another LR 15 Click board.
 * @param[in] ctx : Click context object.
 * See #lr15_t object definition for detailed explanation.
 * @return @li @c    0 - OK.
 *         @li @c != 0 - Read response error.
 * See #err_t definition for detailed explanation.
 * @note None.
 */
static err_t lr15_example ( lr15_t *ctx );

void application_init ( void ) 
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    lr15_cfg_t lr15_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.
    lr15_cfg_setup( &lr15_cfg );
    LR15_MAP_MIKROBUS( lr15_cfg, MIKROBUS_1 );
    if ( UART_ERROR == lr15_init( &lr15, &lr15_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    log_info( &logger, " Application Task " );

    app_state = LR15_POWER_UP;
    log_printf( &logger, ">>> APP STATE - POWER UP <<<\r\n\n" );
}

void application_task ( void ) 
{
    switch ( app_state )
    {
        case LR15_POWER_UP:
        {
            if ( LR15_OK == lr15_power_up( &lr15 ) )
            {
                app_state = LR15_CONFIG_EXAMPLE;
                log_printf( &logger, ">>> APP STATE - CONFIG EXAMPLE <<<\r\n\n" );
            }
            break;
        }
        case LR15_CONFIG_EXAMPLE:
        {
            if ( LR15_OK == lr15_config_example( &lr15 ) )
            {
                app_state = LR15_EXAMPLE;
                log_printf( &logger, ">>> APP STATE - EXAMPLE <<<\r\n\n" );
            }
            break;
        }
        case LR15_EXAMPLE:
        {
            lr15_example( &lr15 );
            break;
        }
        default:
        {
            log_error( &logger, " APP STATE." );
            break;
        }
    }
}

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 lr15_clear_app_buf ( void ) 
{
    memset( app_buf, 0, app_buf_len );
    app_buf_len = 0;
}

static void lr15_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 ] );
    }
}

static err_t lr15_process ( lr15_t *ctx ) 
{
    uint8_t rx_buf[ PROCESS_BUFFER_SIZE ] = { 0 };
    int32_t overflow_bytes = 0;
    int32_t rx_cnt = 0;
    int32_t rx_size = lr15_generic_read( ctx, rx_buf, PROCESS_BUFFER_SIZE );
    if ( ( rx_size > 0 ) && ( rx_size <= APP_BUFFER_SIZE ) ) 
    {
        if ( ( app_buf_len + rx_size ) > APP_BUFFER_SIZE ) 
        {
            overflow_bytes = ( app_buf_len + rx_size ) - APP_BUFFER_SIZE;
            app_buf_len = APP_BUFFER_SIZE - rx_size;
            memmove ( app_buf, &app_buf[ overflow_bytes ], app_buf_len );
            memset ( &app_buf[ app_buf_len ], 0, overflow_bytes );
        }
        for ( rx_cnt = 0; rx_cnt < rx_size; rx_cnt++ ) 
        {
            if ( rx_buf[ rx_cnt ] ) 
            {
                app_buf[ app_buf_len++ ] = rx_buf[ rx_cnt ];
            }
        }
        return LR15_OK;
    }
    return LR15_ERROR;
}

static err_t lr15_read_response ( lr15_t *ctx, uint8_t *rsp, uint32_t timeout ) 
{
    uint32_t timeout_cnt = 0;
    lr15_clear_app_buf ( );
    lr15_process( ctx );
    while ( ( 0 == strstr( app_buf, rsp ) ) &&
            ( 0 == strstr( app_buf, LR15_RSP_ERROR ) ) )
    {
        lr15_process( ctx );
        if ( timeout_cnt++ > timeout )
        {
            lr15_log_app_buf( );
            log_error( &logger, " Timeout!" );
            return LR15_ERROR_TIMEOUT;
        }
        Delay_ms( 1 );
    }
    Delay_ms ( 200 );
    lr15_process( ctx );
    lr15_log_app_buf( );
    if ( strstr( app_buf, LR15_RSP_ERROR ) )
    {
        log_error( &logger, " CMD!" );
        return LR15_ERROR_CMD;
    }
    log_printf( &logger, "--------------------------------\r\n" );
    return LR15_OK;
}

static err_t lr15_power_up ( lr15_t *ctx )
{
    err_t error_flag = LR15_OK;
    
    log_printf( &logger, ">>> Reset device.\r\n" );
    lr15_reset_device( &lr15 );
    while ( LR15_OK == lr15_process( ctx ) )
    {
        lr15_log_app_buf( );
        lr15_clear_app_buf ( );
    }
    log_printf( &logger, "--------------------------------\r\n" );

    log_printf( &logger, ">>> Check communication.\r\n" );
    lr15_cmd_run( &lr15, LR15_CMD_AT );
    error_flag |= lr15_read_response( &lr15, LR15_RSP_AT, LR15_RSP_TIMEOUT_DEFAULT );

    log_printf( &logger, ">>> Factory reset.\r\n" );
    lr15_cmd_run( &lr15, LR15_CMD_FDEFAULT );
    error_flag |= lr15_read_response( &lr15, LR15_RSP_FDEFAULT, LR15_RSP_TIMEOUT_DEFAULT );

    log_printf( &logger, ">>> Get device firmware version.\r\n" );
    lr15_cmd_get( ctx, LR15_CMD_VER );
    error_flag |= lr15_read_response( ctx, LR15_RSP_VER, LR15_RSP_TIMEOUT_DEFAULT );

    log_printf( &logger, ">>> Get module ID.\r\n" );
    lr15_cmd_get( ctx, LR15_CMD_ID );
    error_flag |= lr15_read_response( ctx, LR15_RSP_ID, LR15_RSP_TIMEOUT_DEFAULT );

    return error_flag;
}

static err_t lr15_config_example ( lr15_t *ctx )
{
    err_t error_flag = LR15_OK;

    log_printf( &logger, ">>> Enter TEST mode.\r\n" );
    lr15_cmd_set( ctx, LR15_CMD_MODE, LR15_PARAM_MODE_TEST );
    error_flag |= lr15_read_response( ctx, LR15_RSP_MODE, LR15_RSP_TIMEOUT_DEFAULT );

    log_printf( &logger, ">>> Check test mode and RF configuration.\r\n" );
    lr15_cmd_get( ctx, LR15_CMD_TEST );
    error_flag |= lr15_read_response( ctx, LR15_RSP_TEST_RFCFG, LR15_RSP_TIMEOUT_DEFAULT );
    
    // Default RF configuration: FREQUENCY, SF, BANDWIDTH, TX PR, RX PR, TX POWER, CRC, IQ, NET
    #define RF_CFG_DEFAULT "868, SF7, 125, 8, 8, 14, ON, OFF, OFF"
    log_printf( &logger, ">>> Set RF configuration.\r\n" );
    lr15_cmd_param_set( ctx, LR15_CMD_TEST, LR15_PARAM_TEST_RFCFG, RF_CFG_DEFAULT );
    error_flag |= lr15_read_response( ctx, LR15_RSP_TEST_RFCFG, LR15_RSP_TIMEOUT_DEFAULT );

    return error_flag;
}

static err_t lr15_example ( lr15_t *ctx )
{
    err_t error_flag = LR15_OK;
    uint8_t msg_hex[ 201 ] = { 0 };
    uint8_t byte_hex[ 3 ] = { 0 };
    uint8_t len[ 10 ] = { 0 };
    uint8_t rssi[ 10 ] = { 0 };
    uint8_t snr[ 10 ] = { 0 };
    uint8_t cnt = 0;

    memset( msg_hex, 0, sizeof ( msg_hex ) );
    for ( cnt = 0; ( cnt < strlen ( DEMO_TEXT_MESSAGE ) ) && ( cnt < 100 ); cnt++ ) 
    {
        uint8_to_hex ( DEMO_TEXT_MESSAGE[ cnt ], byte_hex );
        strcat ( msg_hex, byte_hex );
    }
    log_printf( &logger, ">>> Send message: \"%s\".\r\n", ( char * ) DEMO_TEXT_MESSAGE );
    lr15_cmd_param_set( ctx, LR15_CMD_TEST, LR15_PARAM_TEST_TXLRPKT, msg_hex );
    error_flag |= lr15_read_response( ctx, LR15_RSP_TEST_TX_DONE, LR15_RSP_TIMEOUT_DEFAULT );
    
    if ( LR15_OK == error_flag )
    {
        memset( msg_hex, 0, sizeof ( msg_hex ) );
        #define RX_MODE_TIMEOUT 30000
        log_printf( &logger, ">>> Go to RX mode (timeout: 30s).\r\n" );
        lr15_cmd_param_get( ctx, LR15_CMD_TEST, LR15_PARAM_TEST_RXLRPKT );
        error_flag |= lr15_read_response( ctx, LR15_RSP_TEST_RX, RX_MODE_TIMEOUT );
    }
    
    if ( LR15_OK == error_flag )
    {
        uint8_t * __generic_ptr start_ptr = strstr( app_buf, LR15_RSP_TEST_RXLEN );
        uint8_t * __generic_ptr end_ptr = NULL;
        if ( start_ptr )
        {
            start_ptr = start_ptr + strlen ( LR15_RSP_TEST_RXLEN );
            end_ptr = strstr ( start_ptr, "," );
            memcpy ( len, start_ptr, end_ptr - start_ptr );

            start_ptr = strstr ( end_ptr, ":" ) + 1;
            end_ptr = strstr ( start_ptr, "," );
            memcpy ( rssi, start_ptr, end_ptr - start_ptr );
            
            start_ptr = strstr ( end_ptr, ":" ) + 1;
            end_ptr = strstr ( start_ptr, "\r\n" );
            memcpy ( snr, start_ptr, end_ptr - start_ptr );

            start_ptr = strstr ( end_ptr, "\"" ) + 1;
            end_ptr = strstr ( start_ptr, "\"" );
            memcpy ( msg_hex, start_ptr, end_ptr - start_ptr );

            for ( cnt = 0; cnt < strlen ( msg_hex ); cnt += 2 )
            {
                msg_hex[ cnt / 2 ] = hex_to_uint8 ( &msg_hex [ cnt ] );
            }
            msg_hex[ cnt / 2 ] = 0;
            log_printf( &logger, ">>> Parse received message.\r\n" );
            log_printf ( &logger, " Message: %s\r\n", msg_hex );
            log_printf ( &logger, " LEN: %s\r\n", len );
            log_printf ( &logger, " RSSI: %s\r\n", rssi );
            log_printf ( &logger, " SNR: %s\r\n", snr );
            log_printf( &logger, "--------------------------------\r\n" );
        }
    }

    Delay_ms ( 1000 );

    return error_flag;
}

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

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.