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

Read Thread MAC address

Hello All, 

I am developing a product based on thread protocol. 

I am using nRF52840 development kit and nRF5_SDK_for_Thread_and_Zigbee_v4.1.0_32ce5f8 SDK. 

I am new to thread protocol so I would like to know getting started example for my project. 

I have referred the thread related document from Nordic info center. 

With reference to CoAP server and client example test setup I ran CoAP server on 1 dev-kit and CoAP client on another dev-kit. It worked as per explanation. 

Project Requirement, 

-> My final project contains 2 parts, 1) nRF52840 as RF device (i.e.,Node)  which based on Thread and 2) is Thread based Gateway ( this any Gateway) 

-> my node should connect to gateway (like how Zigbee base Node and Coordinator connect)  and there will be some command exchange(like for example light_bulb from Zibgee) 

I have 3 queries which are listed below, 

1) I going to use base example as CoAP server example? Is this correct example for my requirement? 

2) Assuming CoAP  server is my getting started code for development I did some test here to Get MAC address. But I am not sure whether it is correct response or not? 

   below is the snippet which I used to read MAC. I modified the thread_utils.c file thread_init() function. I used otLinkGetFactoryAssignedIeeeEui64(); function to read MAC id. 

 a)  I am not sure about function parameter passed are correct? Please check the snippet and let me know your feedback. 

 b) With above function, I got one value which as below, but I am not sure the representation of data means MSB is [0] postion or MSB is [7] position?let me know your feedback.

[0]:0xf4

[1]:0xce

[2]:0x36

[3]:0x2f

[4]:0xac

[5]:0xe2

[6]:0xc1

[7]:0x9d

void thread_init(const thread_configuration_t * p_config)
{
    otExtAddress ieeeEUI64;
    otError error;

    otSysInit(0, NULL);

#if defined(MULTIPROTOCOL_802154_CONFIG_PRESENT) && defined(MULTIPROTOCOL_802154_MODE)
    uint32_t retval = multiprotocol_802154_mode_set((multiprotocol_802154_mode_t)MULTIPROTOCOL_802154_MODE);
    ASSERT(retval == NRF_SUCCESS);
#endif

#if !defined OPENTHREAD_RADIO
    platform_init();
#endif

#if FEM_CONTROL_DEFAULT_ENABLE
    fem_init();
#endif

    mp_ot_instance = otInstanceInitSingle();
    ASSERT(mp_ot_instance != NULL);

    NRF_LOG_INFO("Thread version   : %s", (uint32_t)otGetVersionString());
    NRF_LOG_INFO("Network name     : %s",
                 (uint32_t)otThreadGetNetworkName(mp_ot_instance));
    
     otLinkGetFactoryAssignedIeeeEui64(mp_ot_instance,&ieeeEUI64); //read mac address

     NRF_LOG_INFO("IeeeEUi64 Id     : %x",ieeeEUI64.m8);

..................
.................// code default
.............
}

3) Is there any other way to get MAC address of device other than programming(means which using API/function) ? 

Thanks and Regards

Rohit R

Parents
  • Hi Rohit,

    1) I am still not clear what's your functions of Gateway, does the application topology look like PC/Mobile Phone <-> Border router(Gateway) <-> Thread mesh nodes? so you can control the Thread node from an external network? If this is what you want, I would suggest you think about Metter/Homkit application protocol or SDK, because Thread is a network layer protocol. It is not very easy to use it directly for this kind of application. 

    2) You have to think about the reason why you need a Thread note MAC address, normally it is used for device identification. Thread use IEEE EUI-64 and otLinkGetFactoryAssignedIeeeEui64() is the correct function.  EUI-64 is MSB to LSB according to Use of EUI-64 for New Designs.

    3) I do not think you should bother how to get MAC address for your development. It is covered by high-level commissioning process.

    If you just start your development on Thread protocol, I strongly suggest you switch to NCS. nRF5_SDK_for_Thread_and_Zigbee is currently in the maintenance stage, there will be no further major update.

    Best regards,

    Charlie

  • Hi Charlie, 

    2) You have to think about the reason why you need a Thread note MAC address, normally it is used for device identification. Thread use IEEE EUI-64 and otLinkGetFactoryAssignedIeeeEui64() is the correct function.  EUI-64 is MSB to LSB according to Use of EUI-64 for New Designs.
    3) I do not think you should bother how to get MAC address for your development. It is covered by high-level commissioning process.
    - I need IEEE EUI-64 address (MAC address) for white listing our node with customer Gateway. So let us know the procedure to get address. This is mandatory to integrate our device and dev board with customer gateway and test our system.
    If you just start your development on Thread protocol, I strongly suggest you switch to NCS. nRF5_SDK_for_Thread_and_Zigbee is currently in the maintenance stage, there will be no further major update.

    - As we are already begun our development on SDK for thread_Zigbee 4.1 and we are close to completion so it difficult at this time to switch or upgrade to latest SDK (NCS). 

    Thanks and Regards

    Rohit R

Reply
  • Hi Charlie, 

    2) You have to think about the reason why you need a Thread note MAC address, normally it is used for device identification. Thread use IEEE EUI-64 and otLinkGetFactoryAssignedIeeeEui64() is the correct function.  EUI-64 is MSB to LSB according to Use of EUI-64 for New Designs.
    3) I do not think you should bother how to get MAC address for your development. It is covered by high-level commissioning process.
    - I need IEEE EUI-64 address (MAC address) for white listing our node with customer Gateway. So let us know the procedure to get address. This is mandatory to integrate our device and dev board with customer gateway and test our system.
    If you just start your development on Thread protocol, I strongly suggest you switch to NCS. nRF5_SDK_for_Thread_and_Zigbee is currently in the maintenance stage, there will be no further major update.

    - As we are already begun our development on SDK for thread_Zigbee 4.1 and we are close to completion so it difficult at this time to switch or upgrade to latest SDK (NCS). 

    Thanks and Regards

    Rohit R

Children
Related