-
Hi, I'm using otDatasetSetActive() to set the network params (NetKey, PAN ID, etc). I have noticed that if devices are already on the same network, (i.e. given the same parameters), then if I want to isolate/detach one device from the network, by setting new params and creating a new network, using the same API, I cannot detach the device. I confirmed via CLI that "dataset pending" gets set as well to what I was hoping only be active dataset, which means that the router I am trying to detach is deliberately distributing the new key to other nodes. ' My understanding was as long as OT Network Key is changed, it should be detached. but no! How can I disable/enable this feature? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
If the device is attached to an existing Thread network, If you want to isolate the device itself, you can detach the device from the Thread network first, by calling See relevant code: openthread/src/core/meshcop/dataset_manager.cpp Lines 193 to 220 in 3d60038 |
Beta Was this translation helpful? Give feedback.
-
To detach specific device, we can call APIs on it to stop/detach directly:
Then to move the device to another network, first need to factory reset it (clear non-volatile settings):
Then can add new dataset on it to start/join a new network. The behavior of "active/pending dataset" is correct/intended. The way to think about this is that Operational Dataset belongs to a Thread mesh and the API is changing it on the Thread mesh. |
Beta Was this translation helpful? Give feedback.
To detach specific device, we can call APIs on it to stop/detach directly:
otThreadSetEnabled()
to stop Thread MLE operation (device will detach immediately)otThreadDetachGracefully()
to do a graceful detach (inform other devices before going away).Then to move the device to another network, first need to factory reset it (clear non-volatile settings):
otInstanceFactoryReset()
and/orotInstanceErasePersistentInfo()
to erase old persisted dataset on deviceThen can add new dataset on it to start/join a new network.
The behavior of "active/pending dataset" is correct/intended. The way to think about this is that Operational Dataset belongs to a Thread mesh and the API is changing …