The Internet of Things (IoT) and the Wireless Sensor Networks (WSNs) attract attention of the research communities due to their rapid and promising development. These paradigms have been predicted to play a leading role in our daily life in the near future. The limited resources and the restricted number of communication channels in these networks create new challenges especially in collision and access conflicts. To bring appropriate solutions for these problems, several works, in the literature, focus on centralized and distributed approaches. Traditional distributed protocols assume that the MAC and Routing layers act independently. Moreover, the dynamic topology and the central point of failure restrict the development of centralized techniques. In this paper, we present a distributed weight-based TDMA-MAC scheduling algorithm (WB-DTSA). The proposed solution takes advantage of routing information to improve the communication latency and the schedule length. Simulation results show better performance, in comparison to similar distributed channel assignment approaches. The latency is improved by 47% and the schedule length is reduced by 23%.