<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Using CLI but disabling the need for &amp;quot;bdb start&amp;quot; cli command.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102192/using-cli-but-disabling-the-need-for-bdb-start-cli-command</link><description>I am using the CLI example. 
 I have found how to disable the need to specify coordinator every time, and now I&amp;#39;m looking to disable the need to &amp;#39;bdb start&amp;#39; every time I boot. 
 I would like to boot the device and not need to type anything into the terminal</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jul 2023 14:08:59 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102192/using-cli-but-disabling-the-need-for-bdb-start-cli-command" /><item><title>RE: Using CLI but disabling the need for "bdb start" cli command.</title><link>https://devzone.nordicsemi.com/thread/438103?ContentTypeID=1</link><pubDate>Tue, 25 Jul 2023 14:08:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c957d4a2-6451-45ba-97b7-7cf90364808b</guid><dc:creator>AndrewDF</dc:creator><description>&lt;p&gt;Marte,&lt;/p&gt;
&lt;p&gt;Thank you. This is what I needed. I have tried both&amp;nbsp;zboss_start_no_autostart() and&amp;nbsp;&lt;span&gt;m_stack_is_started = ZB_TRUE in the past but never at the same time.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Andrew&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using CLI but disabling the need for "bdb start" cli command.</title><link>https://devzone.nordicsemi.com/thread/438064?ContentTypeID=1</link><pubDate>Tue, 25 Jul 2023 11:59:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d85298ff-b0c7-47b1-91ea-cb2497bb088a</guid><dc:creator>Marte Myrvold</dc:creator><description>&lt;p&gt;Hi Andrew,&lt;/p&gt;
&lt;p&gt;To do this you will have to change the files of the Zigbee CLI library, which I would not recommend. I will still explain how to do it.&lt;/p&gt;
&lt;p&gt;First of all, to start the stack in main.c you need to add &lt;code&gt;zboss_start_no_autostart()&lt;/code&gt;. Additionally, make sure that you have changed &lt;code&gt;zb_set_bdb_primary_channel_set(IEEE_CHANNEL_MASK)&lt;/code&gt; to &lt;code&gt;zb_set_network_coordinator_role(IEEE_CHANNEL_MASK)&lt;/code&gt;. This is an example of how main() will look:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Function for application main entry.
 */
int main(void)
{
    ret_code_t     ret;
    zb_ieee_addr_t ieee_addr;

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

    /* Initialize loging system and GPIOs. */
    log_init();

#if defined(APP_USBD_ENABLED) &amp;amp;&amp;amp; 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);

    /* 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(&amp;quot;cli_agent_coordinator&amp;quot;);

    /* 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_network_coordinator_role(IEEE_CHANNEL_MASK);
    zb_set_max_children(MAX_CHILDREN);

    zigbee_erase_persistent_storage(ERASE_PERSISTENT_CONFIG);

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

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

    /* Register handlers to identify notifications */
    ZB_AF_SET_IDENTIFY_NOTIFICATION_HANDLER(ZIGBEE_CLI_ENDPOINT, identify_handler);

    /** Start Zigbee Stack. */
    ret = zboss_start_no_autostart();
    APP_ERROR_CHECK(ret);

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

    /* Start Zigbee stack. */
    while(1)
    {
        if (zb_cli_is_stack_started())
        {
#ifdef ZIGBEE_CLI_DEBUG
            if (!zb_cli_stack_is_suspended())
            {
                zboss_main_loop_iteration();
            }
#else
            zboss_main_loop_iteration();
#endif
        }
        UNUSED_RETURN_VALUE(NRF_LOG_PROCESS());
        UNUSED_RETURN_VALUE(zb_cli_process());
    }
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The variable that checks if the stack is started for CLI, m_stack_is_started, is local to zigbee_cli_cmd_bdb.c and is only set to true if you issue the command &amp;#39;bdb start&amp;#39;. Since there is no other way to change this variable, and it needs to be true for several of the CLI commands to work, the easiest option is to simply set &lt;code&gt;m_stack_is_started = ZB_TRUE &lt;/code&gt;at the top of zigbee_cli_cmd_bdb.c instead of &lt;code&gt;ZB_FALSE&lt;/code&gt;. Please be aware that this will affect the behavior of CLI for other projects as well.&lt;/p&gt;
&lt;p&gt;This code is not thoroughly tested or qualified and should be considered provided “as-is”. Please test it with your application and let me know if you find any issues.&lt;/p&gt;
&lt;p&gt;Please be aware that for new development we recommend using nRF Connect SDK instead of nRF5 SDK, see &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/nrf-connect-sdk-and-nrf5-sdk-statement"&gt;nRF Connect SDK and nRF5 SDK statement&lt;/a&gt; . &lt;br /&gt;In nRF Connect SDK you can easily add shell to existing Zigbee examples, so you could use our generic Zigbee network coordinator sample have the device configured as a coordinator by default and automatically start the Zigbee network on startup, in addition to CLI/shell functionality.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Marte&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>