This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How install default key?



How to do it? 

I use the following variants

1) 

Coordinator

-DSECURE=1

-DDEFAULT_KEY="{0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

Router 

-DSECURE=1

-DDEFAULT_KEY="{0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

This is not working.

2)

Coordinator

-DSECURE=1

-DDEFAULT_KEY="{0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

Router 

-DSECURE=0

-DDEFAULT_KEY="{0xFF, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

Works. But why is the router connected to the network without a key? 

3) 

Coordinator

uint8 zgPreConfigKeys = TRUE;

-DSECURE=1

-DDEFAULT_KEY="{0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

Router

uint8 zgPreConfigKeys = TRUE;

-DSECURE=1

-DDEFAULT_KEY="{0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

This is not working.

How to install the default key??? Only devices with a key must work in the network.

  • Hello Andrey,

    In the first case, it should works as you explained.

    In the second one, you said it works. Are you sure you can have access to your router? As you show your settings, I am surprised it works.

    You must know that in Home Automation (is it your profile?) there are the network key and Pre-config key as security parameters.

    The most popular use, the network key is send from coordinator to all devices, and Pre-config key is the same for all devices.

    In TI Zstack, if you let these parameters, it should works:

    - uint8 zgPreConfigKeys = FALSE;

    - uint8 zgUseDefaultTCLK = TRUE;

    That means, that network key will be send with encryption provided by Pre-config key.

    Also, network key is as you said: {0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D},

    and Pre-config key is { 0x5a, 0x69, 0x67, 0x42, 0x65, 0x65, 0x41, 0x6c, 0x6c, 0x69, 0x61, 0x6e, 0x63, 0x65, 0x30, 0x39 }

    Launix.

     

  • This is not working.

    In the system event  ZDO_STATE_CHANGE  returned only  DEV_NWK_DISC. 

  • I found the problem. 

    The problem is the people who write OSAL and documentation. In my project uses ADC. But to set the key is also used ADC. Before installing the function is called bool HalAdcCheckVdd(uint8 vdd).   This led to a deadlock.

    Nothing says about this moment.

    So it will be better. 

    bool HalAdcCheckVdd(uint8 vdd)
    {
    bool saveADCIE = ADCIE;
    ADCIE=0;

    ADCCON3 = 0x0F;
    while (!(ADCCON1 & 0x80));
    ADCIE=saveADCIE ;

    return (ADCH > vdd);
    }

    Why, after initialization  router

     _NIB.extendedPANID == _NIB.nwkCoordExtAddress ????

  • I encountered the similar problem like this:

    Coordinator

    -DSECURE=1

    -DDEFAULT_KEY="{0x01, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

    Router 

    -DSECURE=1

    -DDEFAULT_KEY="{0xFF, 0x03, 0x05, 0x07, 0x09, 0x0B, 0x0D, 0x0F, 0x00, 0x02, 0x04, 0x06, 0x08, 0x0A, 0x0C, 0x0D}"

    uint8 zgPreConfigKeys = TRUE;

    Works. The router connected to the network without a different key,but the coordinator can't decoding the packets that from Router. So I think that the router with a wrong key can connect the network but the data can't be decoded;

    Maybe the TCLK is the key that determine whether the router can connected the network.