openthread / ot-br-posix

OpenThread Border Router, a Thread border router for POSIX-based platforms.
https://openthread.io/
BSD 3-Clause "New" or "Revised" License
420 stars 235 forks source link

ot-br-posix losing network configuration sporadically #2566

Open dakhnod opened 3 weeks ago

dakhnod commented 3 weeks ago

I have ot-br-posix running under linux, and it allows to join a network using ot-ctl. This all works fine, until the RCP refuses to connect all of a sudden. ot-ctl dataset active yields Not found. Only re-joining the network helps.

By now I found out that the host system stores the configuration under /var/lib/thread. So far, I cannot tell if the configuration in the folder also disappears.

In any case, whould could cause the border router to simply lose its dataset?

jwhui commented 3 weeks ago

On posix systems, OpenThread stores the settings in a file. You can find the implementation here: https://github.com/openthread/openthread/blob/main/src/posix/platform/settings.cpp

The settings will only be list if:

  1. the settings are explicitly deleted (e.g. by a call to otPlatSettingsDelete())
  2. the settings file is deleted
  3. the settings file becomes corrupt