Hello! Based on you example I try to develop a simple HelloWorld example that follows chapter 11 of the specification. It says that to form a network a energy scan should be performed. That works perfectly fine but during role changes, it's currently the only device, the channel get reset to 11.
Log output:
:INFO:Role changed: 2
:DEBUG:22
:INFO:Role changed: 5
:DEBUG:11
Is there a internal scan or something?
Edit:
I seems that the role change uses channel data stored in non volatile memory and otLinkSetChannel()
only writes there if the channel is not already set.