TOP Contributors

  1. MIKROE (2784 codes)
  2. Alcides Ramos (405 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (133 codes)
  5. Bugz Bensce (97 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 (141277 times)
  2. FAT32 Library (74088 times)
  3. Network Ethernet Library (58715 times)
  4. USB Device Library (48826 times)
  5. Network WiFi Library (44525 times)
  6. FT800 Library (44073 times)
  7. GSM click (30804 times)
  8. mikroSDK (29654 times)
  9. PID Library (27355 times)
  10. microSD click (27251 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

NeoMesh 868MHz Click

Rating:

0

Author: MIKROE

Last Updated: 2024-10-31

Package Version: 2.1.0.6

mikroSDK Library: 2.0.0.0

Category: Sub-1 GHz Transceivers

Downloaded: 125 times

Not followed.

License: MIT license  

NeoMesh Click - 868MHz is a compact add-on board with a low-power, long-range transceiver, ideal for Mesh wireless networking. This board features the NC1000C-8, a wireless Mesh network module from NeoCortec. With an additional antenna that MikroE offers connected to the module’s u.Fl connector, you can create a fully functional wireless Mesh network node that will work in the Sub-GHz frequency band of 868MHz. The module has a generic application layer that can configured to suit applications.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "NeoMesh 868MHz Click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "NeoMesh 868MHz Click" changes.

Do you want to report abuse regarding "NeoMesh 868MHz Click".

  • Information
  • Comments (0)

mikroSDK Library Blog


NeoMesh 868MHz Click

NeoMesh Click - 868MHz is a compact add-on board with a low-power, long-range transceiver, ideal for Mesh wireless networking. This board features the NC1000C-8, a wireless Mesh network module from NeoCortec. With an additional antenna that MikroE offers connected to the module’s u.Fl connector, you can create a fully functional wireless Mesh network node that will work in the Sub-GHz frequency band of 868MHz. The module has a generic application layer that can configured to suit applications.

neomesh868_click.png

Click Product page


Click library

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

Software Support

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

Standard key functions :

  • neomesh868mhz_cfg_setup Config Object Initialization function.

    void neomesh868mhz_cfg_setup ( neomesh868mhz_cfg_t *cfg );
  • neomesh868mhz_init Initialization function.

    err_t neomesh868mhz_init ( neomesh868mhz_t *ctx, neomesh868mhz_cfg_t *cfg );

Example key functions :

  • neomesh868mhz_send_aapi_frame This function sends a desired AAPI frame by using UART serial interface.

    err_t neomesh868mhz_send_aapi_frame ( neomesh868mhz_t *ctx, neomesh868mhz_aapi_frame_t *frame );
  • neomesh868mhz_read_aapi_frame This function reads an AAPI frame by using UART serial interface.

    err_t neomesh868mhz_read_aapi_frame ( neomesh868mhz_t *ctx, neomesh868mhz_aapi_frame_t *frame );
  • neomesh868mhz_send_sapi_frame This function sends a desired SAPI frame by using UART serial interface.

    err_t neomesh868mhz_send_sapi_frame ( neomesh868mhz_t *ctx, neomesh868mhz_sapi_frame_t *frame );

Example Description

This example demonstrates the use of NeoMesh 868MHz Click board by showing the communication between the two Click boards.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the Click board for the selected application mode.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    neomesh868mhz_cfg_t neomesh868mhz_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.
    neomesh868mhz_cfg_setup( &neomesh868mhz_cfg );
    NEOMESH868MHZ_MAP_MIKROBUS( neomesh868mhz_cfg, MIKROBUS_1 );
    if ( UART_ERROR == neomesh868mhz_init( &neomesh868mhz, &neomesh868mhz_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }

    log_printf( &logger, "\r\n Enable SAPI over AAPI\r\n" );
    aapi_frame.cmd = NEOMESH868MHZ_CMD_SAPI_TO_AAPI;
    aapi_frame.len = 0;
    neomesh868mhz_send_aapi_frame ( &neomesh868mhz, &aapi_frame );
    neomesh868mhz_parse_sapi_rsp ( NEOMESH868MHZ_SAPI_RSP_BOOTLOADER_START );

    log_printf( &logger, "\r\n Login with password\r\n" );
    sapi_frame.cmd = NEOMESH868MHZ_SAPI_CMD_LOGIN;
    sapi_frame.len = 5;
    sapi_frame.payload[ 0 ] = NEOMESH868MHZ_SAPI_LOGIN_PASSWORD_0;
    sapi_frame.payload[ 1 ] = NEOMESH868MHZ_SAPI_LOGIN_PASSWORD_1;
    sapi_frame.payload[ 2 ] = NEOMESH868MHZ_SAPI_LOGIN_PASSWORD_2;
    sapi_frame.payload[ 3 ] = NEOMESH868MHZ_SAPI_LOGIN_PASSWORD_3;
    sapi_frame.payload[ 4 ] = NEOMESH868MHZ_SAPI_LOGIN_PASSWORD_4;
    neomesh868mhz_send_sapi_frame ( &neomesh868mhz, &sapi_frame );
    neomesh868mhz_parse_sapi_rsp ( NEOMESH868MHZ_SAPI_RSP_OK );

    log_printf( &logger, "\r\n Set NODE ID to: " );
    sapi_frame.cmd = NEOMESH868MHZ_SAPI_CMD_SET_SETTING;
    sapi_frame.len = 3;
    sapi_frame.payload[ 0 ] = NEOMESH868MHZ_SAPI_SETTINGS_ID_NODE_ID;
#if ( DEMO_APP == APP_RECEIVER_1 )
    log_printf( &logger, "%.4X\r\n", ( uint16_t ) NODE_ID_RECEIVER_1 );
    sapi_frame.payload[ 1 ] = ( uint8_t ) ( ( NODE_ID_RECEIVER_1 >> 8 ) & 0xFF );
    sapi_frame.payload[ 2 ] = ( uint8_t ) ( NODE_ID_RECEIVER_1 & 0xFF );
#elif ( DEMO_APP == APP_RECEIVER_2 )
    log_printf( &logger, "%.4X\r\n", ( uint16_t ) NODE_ID_RECEIVER_2 );
    sapi_frame.payload[ 1 ] = ( uint8_t ) ( ( NODE_ID_RECEIVER_2 >> 8 ) & 0xFF );
    sapi_frame.payload[ 2 ] = ( uint8_t ) ( NODE_ID_RECEIVER_2 & 0xFF );
#elif ( DEMO_APP == APP_ORIGINATOR )
    log_printf( &logger, "%.4X\r\n", ( uint16_t ) NODE_ID_ORIGINATOR );
    sapi_frame.payload[ 1 ] = ( uint8_t ) ( ( NODE_ID_ORIGINATOR >> 8 ) & 0xFF );
    sapi_frame.payload[ 2 ] = ( uint8_t ) ( NODE_ID_ORIGINATOR & 0xFF );
#endif
    neomesh868mhz_send_sapi_frame ( &neomesh868mhz, &sapi_frame );
    neomesh868mhz_parse_sapi_rsp ( NEOMESH868MHZ_SAPI_RSP_OK );

    log_printf( &logger, "\r\n Commit settings\r\n" );
    sapi_frame.cmd = NEOMESH868MHZ_SAPI_CMD_COMMIT_SETTINGS;
    sapi_frame.len = 0;
    neomesh868mhz_send_sapi_frame ( &neomesh868mhz, &sapi_frame );
    neomesh868mhz_parse_sapi_rsp ( NEOMESH868MHZ_SAPI_RSP_OK );

    log_printf( &logger, "\r\n Start protocol stack\r\n" );
    sapi_frame.cmd = NEOMESH868MHZ_SAPI_CMD_START_PROTOCOL_STACK;
    sapi_frame.len = 0;
    neomesh868mhz_send_sapi_frame ( &neomesh868mhz, &sapi_frame );
    neomesh868mhz_parse_sapi_rsp ( NEOMESH868MHZ_SAPI_RSP_PROTOCOL_STACK_START );
    // Wait for the device to actually switch back to application layer
    while ( !neomesh868mhz_get_cts_pin ( &neomesh868mhz ) );

    log_printf( &logger, "\r\n Get NODE info\r\n" );
    aapi_frame.cmd = NEOMESH868MHZ_CMD_NODE_INFO;
    aapi_frame.len = 0;
    neomesh868mhz_send_aapi_frame ( &neomesh868mhz, &aapi_frame );
    neomesh868mhz_parse_aapi_rsp ( NEOMESH868MHZ_RSP_NODE_INFO );

    log_printf( &logger, "\r\n Get neighbour list\r\n" );
    aapi_frame.cmd = NEOMESH868MHZ_CMD_NEIGHBOUR_LIST;
    aapi_frame.len = 0;
    neomesh868mhz_send_aapi_frame ( &neomesh868mhz, &aapi_frame );
    neomesh868mhz_parse_aapi_rsp ( NEOMESH868MHZ_RSP_NEIGHBOUR_LIST );

#if ( DEMO_APP == APP_RECEIVER_1 )
    log_printf( &logger, "\r\n Application Mode: Receiver 1\r\n" );
#elif ( DEMO_APP == APP_RECEIVER_2 )
    log_printf( &logger, "\r\n Application Mode: Receiver 2\r\n" );
#elif ( DEMO_APP == APP_ORIGINATOR )
    log_printf( &logger, "\r\n Application Mode: Originator\r\n" );
#else
    #error "Selected application mode is not supported!"
#endif

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

Application Task

One Click board should be set to originator mode and the others to receiver 1 or 2. If the SINGLE_RECEIVER_MODE is enabled, the originator device sends a desired message to RECEIVER_1 node and waits for an acknowledge response, otherwise it sends the same message to both RECEIVER_1 and RECEIVER_2 nodes. The receiver devices reads and parses all incoming AAPI frames and displays them on the USB UART.

void application_task ( void )
{
#if ( DEMO_APP == APP_ORIGINATOR )
    log_printf( &logger, "\r\n Send message to node: %.4X\r\n", ( uint16_t ) NODE_ID_RECEIVER_1 );
    aapi_frame.cmd = NEOMESH868MHZ_CMD_ACK_SEND;
    aapi_frame.len = 3 + strlen ( DEMO_TEXT_MESSAGE );
    aapi_frame.payload[ 0 ] = ( uint8_t ) ( ( NODE_ID_RECEIVER_1 >> 8 ) & 0xFF );
    aapi_frame.payload[ 1 ] = ( uint8_t ) ( NODE_ID_RECEIVER_1 & 0xFF );
    aapi_frame.payload[ 2 ] = DEFAULT_PORT;
    strcpy ( &aapi_frame.payload[ 3 ], DEMO_TEXT_MESSAGE );
    if ( NEOMESH868MHZ_OK == neomesh868mhz_send_aapi_frame ( &neomesh868mhz, &aapi_frame ) )
    {
        neomesh868mhz_parse_aapi_rsp ( NEOMESH868MHZ_RSP_ACK );
    }
    #ifndef SINGLE_RECEIVER_MODE
        log_printf( &logger, "\r\n Send message to node: %.4X\r\n", ( uint16_t ) NODE_ID_RECEIVER_2 );
        aapi_frame.cmd = NEOMESH868MHZ_CMD_ACK_SEND;
        aapi_frame.len = 3 + strlen ( DEMO_TEXT_MESSAGE );
        aapi_frame.payload[ 0 ] = ( uint8_t ) ( ( NODE_ID_RECEIVER_2 >> 8 ) & 0xFF );
        aapi_frame.payload[ 1 ] = ( uint8_t ) ( NODE_ID_RECEIVER_2 & 0xFF );
        aapi_frame.payload[ 2 ] = DEFAULT_PORT;
        strcpy ( &aapi_frame.payload[ 3 ], DEMO_TEXT_MESSAGE );
        if ( NEOMESH868MHZ_OK == neomesh868mhz_send_aapi_frame ( &neomesh868mhz, &aapi_frame ) )
        {
            neomesh868mhz_parse_aapi_rsp ( NEOMESH868MHZ_RSP_ACK );
        }
    #endif
#else
   neomesh868mhz_parse_aapi_rsp ( NULL );
#endif
}

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

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

Wheatstone click

5

Wheatstone Click is a measurement Click board which utilizes a Wheatstone bridge circuit onboard, in order to precisely measure the resistance of an external element. Besides the wheatstone bridge circuit, this Click board also utilizes MAX4208 – an ultra-low offset/drift, precision instrumentation amplifier, from Maxim Integrated.

[Learn More]

Step Down 12 Click

0

Step Down 12 Click is a compact add-on board for reliable DC-DC step-down applications. Based on Texas Instruments' TPS62902 synchronous step-down converter, it features the DCS-Control topology, which combines hysteretic, voltage mode, and current mode control for precision and fast response to voltage changes. Supporting a wide input voltage range of 3V to 17V, it provides stable output voltages with accuracy within ±1% and can enter power save mode for high efficiency under light loads. With 16 configurable output voltages from 0.7V to 5.5V, this Click board™ is ideal for applications in factory automation, building systems, data centers, enterprise computing, and motor drives where efficient, stable power conversion is essential.

[Learn More]

LightRanger Click

0

LightRanger Click is a proximity sensor carrying STs VL6180X IC. This chip is based on STs patented FlightSense technology...

[Learn More]