Openthread SED detection of parent

Hi,

I am trying to come up with a different approach to SED reattachment using a backing off MLE session. Is there a way for the SED to keep on the polling even when in detached state? As far as I know, the polling would get ACK/NAK from the parent. So when the SED gets ACK after a period of NAK, that indicates a possible parent come back and the SED can issue a MLE session then. But as I can see, the SED stops polling after detached from the thread network. 

Cheers,

Kaushalya

  • Hi Maria,

    I have tried modifying OPENTHREAD_CONFIG_FAILED_CHILD_TRANSMISSIONS to 100 in [sdk path]\v2.9.0\modules\lib\openthread\src\core\config\misc.h. But still my SED seems detaching within one failed poll cycle.

    How can I keep the SED in child state inspite of transmission failure for a longer time?

    Cheers,

    Kaushalya

  • Hi Kaushalya, 

    Sorry for long delay in replying this. Maria is away and this thread fell into the cracks where we could not see the delay. 

    I am starting to look into the configuration files and to my understanding it seems that the detach is coming from OpenThreads own link failure logic and not from the Kconfigs you are trying to calibrate/tweak.

    In modules/lib/openthread/src/core/thread/mesh_forwarder.hpp the child’s parent link is dropped after kFailedRouterTransmissions consecutive NoAck results. That constant is hard-coded to 4 and is hit quickly when your polls/data all fail while the host is powered  down OPENTHREAD_CONFIG_FAILED_CHILD_TRANSMISSIONS only affects how a parent drops its children; it doesn’t stop the child from detaching itself.

    These thresholds are hardcoded and prebuilt into the Nordic OpenThread library so there is nothing much you can do about it. You can try to do this to make your SED to be attached for longer you need to use opensource OpenThread and need to prestine compile the whole OpenThread sources and not using the Nordic prebuilt library.

    • Rebuild OpenThread from source (not the prebuilt Nordic lib): set CONFIG_OPENTHREAD_NORDIC_LIBRARY=n in your app, then patch modules/lib/openthread/src/core/thread/mesh_forwarder.hpp to raise kFailedRouterTransmissions (e.g., 50 or 100) or wrap it in a macro you define. Example change: static constexpr uint8_t kFailedRouterTransmissions = 50;.
    • Keep your large CONFIG_OPENTHREAD_MLE_CHILD_TIMEOUT so the parent won’t drop the child while the host is down.
    • To avoid burning through the failure counter, back off polling and app traffic when you detect the host is off (e.g., call otLinkSetPollPeriod() to a large interval or pause transmissions). That avoids rapid NoAck accumulation.

    After patching, rebuild so OpenThread is recompiled; then check build/zephyr/.config to confirm CONFIG_OPENTHREAD_NORDIC_LIBRARY is off and verify in logs that detaches no longer occur after a single failed send

    Note:

  • Hi Susheel, Many thanks for the detailed reply. In fact, I have moved on to other tasks and this issue is still holding in the backlog. So I have to refresh myself where I left off. 

    I guess it is ok if I modify these files in my current SDK 2.9.0 to do a temporary workaround? 

    Is there a way to keep these mods across SDK updates to same 2.9.0? i.e. not using SDK 2.10.x but updates to 2.9.0 itself.

    Cheers,

    Kaushalya

  • Yes Kaushalya, you can patch those files in your current NCSv2.9.0 but please make sure that you select CONFIG_OPENTHREAD_NORDIC_LIBRARY=n and prestine build the whole OpenThread sources.

    Also note that a local edit in your SDK repo will be overwritten by a west update or similar commands, so you might have to maintain your own branch which branches out from NCSv2.9.0

Related