This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Question) Can I use zigbee and UART at the same time?

Hello, this is the person who asked about "devzone.nordicsemi.com/.../question-serial-output-uart". First of all, thank you very much for your sincere reply.

The reason why I want to use 2 UARTs is because I want to see the 'Data' which is received by connecting 2 boards to UART communication and 1 board to PC.

Now that the two boards and the PC (UART) communication have been resolved, I am inquiring about what I am trying to do with this method.

Please look at the picture below.

Used three boards (nrf52840) as shown in the figure above. (End Device, Coordinator (zb_cli_agent),Serial_UARTE)

And each one.
We used zigbee_right(zr), zigbee_cli_agent(cli), and serial_uartes(su) sdk.

'zr' and 'cli' are.
I connected by looking at

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.0.0%2Fzigbee_multi_sensor_example.html

and

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_tz_v4.1.0%2Fzigbee_example_cli_agent.html

and I saw that the value was coming in.

And I wanted to communicate UART with Cli and su, so I porting the UART definitions and functions in su. 

But, if serial is initialed, command window does not appear.

int main(void)
{
    ret_code_t     ret;
    zb_ieee_addr_t ieee_addr;
    
/* UART */
    int i;
    char ReadData[100];
/* END UART */

    /* Intiialise the leds */
    bsp_board_init(BSP_INIT_LEDS);
    bsp_board_leds_off();

    /* Initialize loging system and GPIOs. */
    nrf_drv_power_init(NULL);
    log_init();
 
#if defined(APP_USBD_ENABLED) && APP_USBD_ENABLED
    ret = nrf_drv_clock_init();
    APP_ERROR_CHECK(ret);
    nrf_drv_clock_lfclk_request(NULL);
#endif
   
    ret = app_timer_init();
    APP_ERROR_CHECK(ret);

    
/* UART */ // Serial_init

    ret = nrf_serial_init(&serial0_uarte, &m_uarte0_drv_config, &serial0_config);
    APP_ERROR_CHECK(ret);

    ret = nrf_serial_init(&serial1_uarte, &m_uarte1_drv_config, &serial1_config);
    APP_ERROR_CHECK(ret);

/* END UART */


    /* Initialize the Zigbee CLI subsystem */
    zb_cli_init(ZIGBEE_CLI_ENDPOINT);

    /* Set Zigbee stack logging level and traffic dump subsystem. */
    ZB_SET_TRACE_LEVEL(ZIGBEE_TRACE_LEVEL);
    ZB_SET_TRACE_MASK(ZIGBEE_TRACE_MASK);
    ZB_SET_TRAF_DUMP_OFF();

    /* Initialize Zigbee stack. */
    ZB_INIT("cli_agent_router");

    /* Set device address to the value read from FICR registers. */
    zb_osif_get_ieee_eui64(ieee_addr);
    zb_set_long_address(ieee_addr);

    zb_set_bdb_primary_channel_set(IEEE_CHANNEL_MASK);
    zigbee_erase_persistent_storage(ERASE_PERSISTENT_CONFIG);

    /* Register CLI Agent device context (endpoints). */
    ZB_AF_REGISTER_DEVICE_CTX(&cli_agent_ctx);

    /* Set the endpoint receive hook */
    ZB_AF_SET_ENDPOINT_HANDLER(ZIGBEE_CLI_ENDPOINT, cli_agent_ep_handler);

    /* Start Zigbee CLI subsystem. */
    zb_cli_start();

Can I use zigbee and UART at the same time?
If so, I would appreciate it if you could tell me how.

And can the Coordinator receive a message like "Hello Nordic zigbee" from the End Device without zb_light as shown in the figure above?

Thank you for reading the long article.

Related