Energy conservation is a major challenge in the Internet of Things (IoT) as the number of resource-constrained devices is connected to the network. Routing plays a vital role in IoT to extend the lifespan of the network. Routing protocol for low-power and lossy networks (RPL) is a standard routing protocol in IoT. The parent selection is a crucial role in the routing process to exchange the data. In RPL, the researchers have introduced a single metric, composite metric, and multiobjective optimization algorithm for parent selection. However, the improper parent selection causes the packet losses, congestion among the network nodes, depletes more energy, and increases the convergence time. To overcome these issues, this article proposes energy efficient optimal parent selection in RPL (EEOPS-RPL) using firefly optimization algorithm to extend the lifespan of the IoT network. In EEOPS-RPL, each node in the network is considered to be firefly and also calculates the current location of firefly, attraction of the fireflies, random function, velocity, and the global best values in the network. Residual energy and expected transmission count are attractiveness parameters and distance is a movement parameter to choose the optimum parent in the destination-oriented directed acyclic graph for data transmission. The simulation is conducted using COOJA. The EEOPS-RPL provides better performance in comparison to the efficient parent selection for RPL (EPC-RPL) and the E-RPL. The EEOPS-RPL improves the packet transmission ratio and lifespan of the network by 2% to 5%, and 5% to 10%, respectively, compared with EPC-RPL and E-RPL. In EEOPS-RPL, each participant node applies the firefly algorithm over the parent node information such as distance, residual energy, and expected transmission count through DODAG information object control message to pick the best parent node in the DODAG. The firefly algorithm provides the fast convergence that able to choose the optimal parent quickly. Thus, it avoids the packet loss during the route establishment in network. Thus, EEOPS-RPL extends the lifespan of the network and reduces the convergence time.