For the success of critical applications in the IoT, there is a need to counteract the effects of external interference, especially when the unlicensed spectrum is used. One way of improving the performance is with a routing protocol that quickly reacts to changes in the environment and avoids path and/or frequencies with higher interference. In this paper, we propose an optimization to the RPL protocol, called TAMU‐RPL, that can keep a more accurate estimation of link quality to the neighbors and quickly react to degradation on the links. TAMU‐RPL also uses the quality of links at different frequencies and opportunistically avoids the ones with bad quality. It is evaluated through simulations with connectivity traces from a 40‐node test bed and in a real 5‐node deployment. We compare TAMU‐RPL with a baseline RPL protocol and a Dijkstra‐based shortest‐path algorithm. Results show that TAMU‐RPL can successfully explore the neighbors and obtain ETX values much closer to the ones obtained with a shortest‐path tree, even when link quality changes over time. In the simulation evaluation, TAMU‐RPL was able to double the number of packets received at the sink compared to RPL and reduced the average delay of packets (in time slots) by more than 10%. In the real deployment, the number of packets received at the sink was increased by more than 33%.