improve script to detect convergence of the network in RPL