Commissioning button reset (4 Presses) doesn't always work?

I’ve had problems for a while now using the commissioning button to get a device to leave a PAN and join a new one—most of the time it doesn’t work. I’ve tried slow presses with longer intervals between them, I’ve tried fast presses with short intervals and everything in between. Could this be a debouncing problem? Is it typically necessary to debounce this button, or does the XBee firmware debounce it in software?

However, there’s a bigger problem than this, which is that I don’t actually want to completely reset the module, I just want it to leave the PAN and try to join a new one (for changing a device from one coordinator to another). Is there a better way to do this that doesn’t reset all the parameters?

Maybe sending an explicit transmit request with Management Leave Request to the module. Follow this application note, you can use this frame builder or send it with ZigBee Operator.

Does it helps?

Maybe you can AT NR0 command on the module which resets only network parameters like PAN ID, SC, IO, CH etc.