TOP Contributors

  1. MIKROE (2745 codes)
  2. Alcides Ramos (371 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (118 codes)
  5. Bugz Bensce (90 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 (138914 times)
  2. FAT32 Library (71500 times)
  3. Network Ethernet Library (56914 times)
  4. USB Device Library (47269 times)
  5. Network WiFi Library (42993 times)
  6. FT800 Library (42282 times)
  7. GSM click (29724 times)
  8. mikroSDK (27668 times)
  9. PID Library (26828 times)
  10. microSD click (26087 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

Wireless SUN click

Rating:

0

Author: MIKROE

Last Updated: 2024-07-08

Package Version: 2.1.0.9

mikroSDK Library: 2.0.0.0

Category: Sub-1 GHz Transceivers

Downloaded: 85 times

Not followed.

License: MIT license  

Wireless SUN Click is a compact add-on board representing a Wireless Smart Utility Network for Field Area Network (Wi-SUN FAN) solution. This board features the BP35C5, a Wi-SUN FAN-compatible wireless communication module from Rohm Semiconductor. The BP35C5 operates in the 920MHz band and includes a Wi-SUN software stack that enables operation at different transmission modes for high efficiency. Besides, certification under ARIB and the FCC allows immediate use in Japan and the US in large-scale (up to 1,000-node Sub-GHz) multi-hop mesh networks supporting channel hopping.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Wireless SUN click" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Wireless SUN click" changes.

Do you want to report abuse regarding "Wireless SUN click".

  • Information
  • Comments (0)

mikroSDK Library Blog


Wireless SUN click

Wireless SUN Click is a compact add-on board representing a Wireless Smart Utility Network for Field Area Network (Wi-SUN FAN) solution. This board features the BP35C5, a Wi-SUN FAN-compatible wireless communication module from Rohm Semiconductor. The BP35C5 operates in the 920MHz band and includes a Wi-SUN software stack that enables operation at different transmission modes for high efficiency. Besides, certification under ARIB and the FCC allows immediate use in Japan and the US in large-scale (up to 1,000-node Sub-GHz) multi-hop mesh networks supporting channel hopping.

wirelesssun_click.png

click Product page


Click library

  • Author : Stefan Filipovic
  • Date : Aug 2022.
  • Type : UART type

Software Support

We provide a library for the Wireless SUN 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 Wireless SUN Click driver.

Standard key functions :

  • wirelesssun_cfg_setup Config Object Initialization function.

    void wirelesssun_cfg_setup ( wirelesssun_cfg_t *cfg );
  • wirelesssun_init Initialization function.

    err_t wirelesssun_init ( wirelesssun_t *ctx, wirelesssun_cfg_t *cfg );

Example key functions :

  • wirelesssun_send_cmd This function sends a specified command to the click module.

    void wirelesssun_send_cmd ( wirelesssun_t *ctx, char *cmd );
  • wirelesssun_send_cmd_with_parameter This function sends a specified command to the click module with desired parameters appended to.

    void wirelesssun_send_cmd_with_parameter ( wirelesssun_t *ctx, char *cmd, char *param_buf );
  • wirelesssun_generic_read This function reads a desired number of data bytes by using UART serial interface.

    err_t wirelesssun_generic_read ( wirelesssun_t *ctx, char *data_out, uint16_t len );

Example Description

This example demonstrates the use of Wireless SUN click board by showing the communication between the two click boards configured as BORDER and ROUTER.

The demo application is composed of two sections :

Application Init

Initializes the driver and configures the click board by performing a hardware reset and a clear parameters feature, and setting the device network name, device role to BORDER or ROUTER depending on the application mode. In the end, it saves settings and reboots device.


void application_init ( void )
{
    log_cfg_t log_cfg;  /**< Logger config object. */
    wirelesssun_cfg_t wirelesssun_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.
    wirelesssun_cfg_setup( &wirelesssun_cfg );
    WIRELESSSUN_MAP_MIKROBUS( wirelesssun_cfg, MIKROBUS_1 );
    if ( UART_ERROR == wirelesssun_init( &wirelesssun, &wirelesssun_cfg ) ) 
    {
        log_error( &logger, " Communication init." );
        for ( ; ; );
    }
    app_buf_len = 0;
    app_buf_cnt = 0;

    log_printf( &logger, "\r\n - Reset device -\r\n" );
    wirelesssun_reset_device ( &wirelesssun );
    wirelesssun_rsp_check ( );

    log_printf( &logger, "\r\n - Clear parameters and reboot device -\r\n" );
    wirelesssun_send_cmd ( &wirelesssun, WIRELESSSUN_CMD_CLRST );
    wirelesssun_rsp_check ( );

    log_printf( &logger, "\r\n - Set device name -\r\n" );
    wirelesssun_send_cmd_with_parameter ( &wirelesssun, WIRELESSSUN_CMD_NETNAME, DEVICE_NETWORK_NAME );
    wirelesssun_rsp_check ( );

    log_printf( &logger, "\r\n - Set device starting role -\r\n" );
#ifdef DEMO_APP_BORDER
    wirelesssun_send_cmd_with_parameter ( &wirelesssun, WIRELESSSUN_CMD_ATSTART, WIRELESSSUN_DEVICE_ROLE_BORDER );
#else
    wirelesssun_send_cmd_with_parameter ( &wirelesssun, WIRELESSSUN_CMD_ATSTART, WIRELESSSUN_DEVICE_ROLE_ROUTER );
#endif
    wirelesssun_rsp_check ( );

    log_printf( &logger, "\r\n - Save settings and reboot device -\r\n" );
    wirelesssun_send_cmd ( &wirelesssun, WIRELESSSUN_CMD_SVRST );
    wirelesssun_rsp_check ( );

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

Application Task

Depending on the selected application mode, it reads all the received data and parses the received TCP/UDP messages (BORDER mode) or waits for the connection, reads the parent global address, and then starts sending a desired TCP/UDP messages to the parent every 3 seconds (ROUTER mode).

void application_task ( void )
{
#ifdef DEMO_APP_BORDER
    wirelesssun_process( );
    if ( strstr( app_buf, WIRELESSSUN_CMD_PROMPT_SIGN ) )
    {
        uint8_t demo_hex_msg[ 100 ] = { 0 };
        uint8_t demo_text_msg[ 50 ] = { 0 };
        char * __generic_ptr start_msg_ptr = NULL;
        char * __generic_ptr end_msg_ptr = NULL;
        uint8_t msg_len = 0;
        uint8_t msg_cnt = 0;
        if ( ( strstr( app_buf, WIRELESSSUN_RSP_TCPR ) ) || ( strstr( app_buf, WIRELESSSUN_RSP_UDPR ) ) )
        {
            if ( strstr( app_buf, WIRELESSSUN_RSP_TCPR ) )
            {
                start_msg_ptr = strstr( app_buf, WIRELESSSUN_RSP_TCPR );
            }
            else
            {
                start_msg_ptr = strstr( app_buf, WIRELESSSUN_RSP_UDPR );
            }
            start_msg_ptr = strstr ( start_msg_ptr, ">" ) + 2;
            end_msg_ptr = strstr( start_msg_ptr, WIRELESSSUN_CMD_PROMPT_SIGN );
            msg_len = ( end_msg_ptr - start_msg_ptr );
            memcpy ( demo_hex_msg, start_msg_ptr, msg_len );
            for ( msg_cnt = 0; msg_cnt < msg_len; msg_cnt += 2 )
            {
                demo_text_msg[ msg_cnt / 2 ] = hex_to_uint8 ( &demo_hex_msg [ msg_cnt ] );
            }
            if ( strstr( app_buf, WIRELESSSUN_RSP_TCPR ) )
            {
                log_printf( &logger, "\r\n - Received TCP message: \"%s\" -\r\n", demo_text_msg );
            }
            else
            {
                log_printf( &logger, "\r\n - Received UDP message: \"%s\" -\r\n", demo_text_msg );
            }
        }
        wirelesssun_clear_app_buf( );
    }
#else
    wirelesssun_wait_for_connection ( );
    uint8_t gbl_address[ 20 ] = { 0 };
    wirelesssun_get_parent_gbl_address ( gbl_address );
    for ( ; ; )
    {
        uint8_t tcp_udp_params[ 120 ] = { 0 };
        uint8_t demo_hex_msg[ 100 ] = { 0 };
        uint8_t demo_text_msg[ 50 ] = { 0 };
        uint8_t msg_cnt = 0;
        strcpy ( demo_text_msg, DEMO_TEXT_MESSAGE );
        strcpy ( tcp_udp_params, gbl_address );
        strcat ( tcp_udp_params, WIRELESSSUN_CMD_DELIMITER );
        strcat ( tcp_udp_params, WIRELESSSUN_DEFAULT_PORT );
        strcat ( tcp_udp_params, WIRELESSSUN_CMD_DELIMITER );
        for ( msg_cnt = 0; msg_cnt < strlen ( demo_text_msg ); msg_cnt++ )
        {
            uint8_to_hex ( demo_text_msg[ msg_cnt ], &demo_hex_msg[ msg_cnt * 2 ] );
        }
        strcat ( tcp_udp_params, demo_hex_msg );
        log_printf( &logger, "\r\n - Sending \"%s\" message via TCP -\r\n", demo_text_msg );
        wirelesssun_send_cmd_with_parameter ( &wirelesssun, WIRELESSSUN_CMD_TCPS, tcp_udp_params );
        wirelesssun_rsp_check ( );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );

        log_printf( &logger, "\r\n - Sending \"%s\" message via UDP -\r\n", demo_text_msg );
        wirelesssun_send_cmd_with_parameter ( &wirelesssun, WIRELESSSUN_CMD_UDPS, tcp_udp_params );
        wirelesssun_rsp_check ( );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
        Delay_ms ( 1000 );
    }
#endif
}

Note

By default, the BORDER application mode is selected. comment out the DEMO_APP_BORDER macro definition in order to switch the application mode to ROUTER.

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

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

10x10 RGB click

5

10x10 RGB Click is a matrix of 100 &quot;intelligent&quot; RGB elements, forming a 10x10 display screen. These LED elements feature internal logic, which allows them to communicate directly with the MCU.

[Learn More]

Gyro 9 click

0

Gyro 9 Click is a compact add-on board that contains a high-performance gyroscope. This board features the A3G4250D, a MEMS motion sensor from STMicroelectronics. It is a low-power 3-axes digital output gyroscope that provides unprecedented stability at zero rate level and sensitivity over temperature and time and is equipped with an embedded temperature sensor. The gyroscope has a 16-bit rate value data output with an 8-bit compensation temperature data output.

[Learn More]

M-BUS RF 3 click

0

M-BUS RF 3 Click is a compact add-on board designed for utility metering and various telemetry applications. This board features the Metis-II (2607021183000), an 868MHz radio module from Würth Elektronik. It integrates an MSP430 microcontroller and a CC1125 RF chip-set to ensure efficient data transmission. Key features include a frequency range of 868.3MHz to 869.525MHz, support for the Wireless M-BUS EN13757-4:2013 and Open Metering System (OMS) standards, and communication capabilities up to 1000 meters in line-of-sight conditions. The board also offers energy-saving functionalities such as Wake-On-Radio, an output power of +14dBm output, and AES-128 encryption for secure communication.

[Learn More]