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

How to Make nRF52840 as Zigbee HA1.2 Coordinator

HI i want to use nRF52840 as Zigbee HA1.2 Coordinator, how to coding ? 

nRF52840 support this stack or not ?

Thank

  • Dear

    secret key required for Zigbee authentication is "5A:69:67:42:65:65:41:6C:6C:69:61:6E:63:65:30:39"

    faire-ca-soi-meme.fr/.../

  • Hi UL Dara, 

    you can try taking a look at the this thread: 

    https://devzone.nordicsemi.com/f/nordic-q-a/33683/zigbee-coordinator-with-xiaomi-devices

    It goes through some of the steps on how to swap the key. 

  • Hi UL Dara, 

    there is one, ultimately important point mentioned by Bjørn:

    A Zigbee Home Automation device can join a Zigbee 3.0 Centralized Network that does not require a key exchange.

    The key exchange is required in Nordic's coordinator example by default. I know this causes a lot of headaches, when you try to do some interoperability tests, but consider it as a security precaution.

    There is an API to disable/enable this so-called compatibility mode. It can be called after ZB_BDB_SIGNAL_DEVICE_FISRT_START/REBOOT signals. For debug purposes, it may be wise to just call it inside zboss_signal_handler, upon reception of those signals.

    I hope this helps Slight smile. For further investigation of your case, you may try to post traffic dump from the failed attempt. There is a nrf52840-based sniffer available on github to do so.

  • Dear tomchy

    Tanke for your reply

    The code put like this right ?

    and how to put requited key 

    void zboss_signal_handler(zb_uint8_t param)
    {
        /* Read signal description out of memory buffer. */
        zb_zdo_app_signal_type_t sig = zb_get_app_signal(param, NULL);
        zb_ret_t                 status = ZB_GET_APP_SIGNAL_STATUS(param);
        zb_ret_t                 zb_err_code;
        zb_bool_t                comm_status;
    
        switch(sig)
        {
            case ZB_BDB_SIGNAL_DEVICE_FIRST_START: // Device started and commissioned first time after NVRAM erase.
            case ZB_BDB_SIGNAL_DEVICE_REBOOT:      // BDB initialization completed after device reboot, use NVRAM contents during initialization. Device joined/rejoined and started.
               
                zb_bdb_set_legacy_device_support(0);
                if (status == RET_OK)
                {
                    NRF_LOG_INFO("Device started OK. Start network steering.");
                    bsp_board_led_on(ZIGBEE_NETWORK_STATE_LED);
                    comm_status = bdb_start_top_level_commissioning(ZB_BDB_NETWORK_STEERING);
                    ZB_COMM_STATUS_CHECK(comm_status);
                }
                else
                {
                    NRF_LOG_ERROR("Device startup failed. Status: %d. Retry network formation after 1 second.", status);
                    bsp_board_led_off(ZIGBEE_NETWORK_STATE_LED);
                    zb_err_code = ZB_SCHEDULE_ALARM(bdb_restart_top_level_commissioning, 0, ZB_TIME_ONE_SECOND);
                    ZB_ERROR_CHECK(zb_err_code);
                }
                break;
    
            case ZB_BDB_SIGNAL_STEERING:
                if (status == RET_OK)
                {
                    /* Schedule an alarm to notify about the end of steering period */
                    NRF_LOG_INFO("Network steering started");
                    zb_err_code = ZB_SCHEDULE_ALARM(steering_finished, 0, ZB_TIME_ONE_SECOND * ZB_ZGP_DEFAULT_COMMISSIONING_WINDOW);
                    ZB_ERROR_CHECK(zb_err_code);
                }
                else
                {
                    NRF_LOG_INFO("Network steering failed to start. Status: %d. Retry network formation after 1 second.", status);
                    bsp_board_led_off(ZIGBEE_NETWORK_STATE_LED);
                    zb_err_code = ZB_SCHEDULE_ALARM(bdb_restart_top_level_commissioning, 0, ZB_TIME_ONE_SECOND);
                    ZB_ERROR_CHECK(zb_err_code);
                }
                break;
    
            case ZB_ZDO_SIGNAL_PRODUCTION_CONFIG_READY:
                if (status != RET_OK)
                {
                    NRF_LOG_WARNING("Production config is not present or invalid");
                }
                break;
    
            default:
                /* Unhandled signal. For more information see: zb_zdo_app_signal_type_e and zb_ret_e */
                NRF_LOG_INFO("Unhandled signal %d. Status: %d", sig, status);
                break;
        }
    
        /* All callbacks should either reuse or free passed buffers. If param == 0, the buffer is invalid (not passed) */
        if (param)
        {
            ZB_FREE_BUF_BY_REF(param);
        }
    }

    Thank

  • The key you posted appears to be the same used in the example, i.e. the one found in nRF5_SDK_for_Thread_and_Zigbee_v2.0.0\external\zboss\include\zb_config.h , on line 161.

    /* 5.1.2.3.2 test specification - The default value for DUT-GPP being a Basic Combo pr a Basic Proxy
    * is "ZigBeeAlliance09", i.e. {0x5A 0x69 0x67 0x42 0x65 0x65 0x41 0x6C 0x6C 0x69 0x61 0x6E
    * 0x63 0x65 0x30 0x39}. */
    #define ZB_ZGP_DEFAULT_LINK_KEY "ZigBeeAlliance09"

Related