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

List all devices in Thread network

Hello

In my application (based on ble_thread_dyn_mtd_coap_cli example), I would like to get the list of devices present on the network (ip).

I saw that there was a command to retrieve the RLOC16s of the routers and their children (otThreadGetRouterInfo (...) to get the list of routers and then use otThreadSendDiagnosticGet (...) to get the list of the children of a router).
If I want to get the "Mesh-Local EID" ip address of all the devices on the network, is it a good method to get all the RLOC16 in order to send commands individually to each device so that they send them back to me their mesh-Local EID or is there a simpler method?

How can I determine the IP address of a device just from its RLOC16?

Thank you

Parents Reply Children
  • Yes the only solution to have routable addresses is to either use the Mesh-Local EID addresses or the RLOC addresses but since the RLOC addresses are likely to change during the life of the Thread network, it is necessary that I use the EID addresses...

    The RLOC addresses of the routers I can get them quite easily by executing the otThreadGetRouterInfo (...) commands (or the CLI command "router table") but on the other hand I have a problem to retrieve the RLOCs of the children... In fact , I send the command otThreadSendDiagnosticGet (...) to each router so that it sends me its list of children (RLOC16). The problem I have is that the command only works once and after that it no longer works ... This command is the same as using the CLI command "networkdiagnostic get ..." which also does not works only once ...

    My strategy at the beginning was to retrieve the RLOC16s of all devices on the network to then determine their RLOC address and then send a custom frame to each device individually to send me their EID address. So I would also like to know if it is a good approach to do it like this or if there is a way to retrieve EID addresses more easily?

  • QuentinD said:
    So I would also like to know if it is a good approach to do it like this or if there is a way to retrieve EID addresses more easily?

     I don't think there is any "standard way" of doing this. I discussed this a bit with a colleague of mine, and he found this thread:

    https://groups.google.com/g/openthread-users/c/0yyFFftyLNk?pli=1

    Which contains some suggestions, at least. Another way would be the way that you suggested. I think whatever works for your case is the way to go.

    The EID address is randomly generated, so there is no way of looking it up, as far as I know.

    However, we did find out that if you ping ff03::1, you will get a reply from all the nodes, using their EID address. Perhaps that can be used in your case?

    Best regards,

    Edvin

  • Thank you very much for your advice :)
    So I will do as I thought at the beginning.

Related