The Internet of Things (IoT) is a network of various interconnected objects capable of collecting and exchanging data without human interaction. These objects have limited processing power, storage space, memory, bandwidth and energy. Therefore, due to these limitations, data transmission and routing are challenging issues where data collection and analysis methods are essential. The Routing Protocol for Low-power and Lossy Networks (RPL) is one of the best alternatives to ensure routing in LoWPAN6 networks. However, RPL lacks scalability and basically designed for non-dynamic devices. Another drawback of the RPL protocol is the lack of load balancing support, leading to unfair distribution of traffic in the network that may decrease network efficiency. This study proposes a novel RPL-based routing protocol, QFS-RPL, using Q-learning algorithm policy and ideation from the Fisheye State Routing (FSR) protocol. The proposed QFS-RPL is as lightweight and agile as the standardized RPL and partially outperforms the mRPL protocol on mobile networks. This method supports multi-path routing, and at any given time in the network lifetime, all possible paths for sending data from any node to the sink are available. Therefore, QFS-RPL provides high resilience against errors, failures, and sudden network changes. To evaluate the performance of the proposed method, the Contiki operating system and Cooja simulator have been used in scenarios with mobile and stationary nodes and random network topologies. The results have been compared with RPL and mRPL. We have developed an algorithm for ease of data transfer in the IoT, which provides better performance than existing protocols, especially when dealing with a mobile network. The performance evaluation criteria considered for simulation are load balancing, energy consumption, number of table entries, Packet Delivery Ratio (PDR), End-to-End (E2E) latency, network throughput, convergence speed, and control packet overhead.