Recent improvements in computer and software technologies affect different areas of production systems. The productivity of an agricultural process can be accepted as one of the many domains affected by these improvements. The production volume is increased not only with new designs of agricultural machines, but also by utilizing communication technologies in the production process. Even the wireless sensor technologies have started to be used for gathering some environmental features in order to optimize production parameters as well as preserving the product in determined quality levels. However, nodes which play an important part of such systems are prone to battery depletions. To alleviate this battery problem, incorporating harvester nodes into the system has been recently considered. However, only including such nodes is not sufficient for improving the lifetime of the system. In this paper, a new distributed connected dominating set algorithm on WSNs with solar energy harvester nodes for precision agriculture applications is proposed. The novel distributed connected dominating set construction with solar energy harvesting in smart agriculture applications algorithm, namely CDSSEHA, is compared with the traditional flooding methods and with an energy efficient CDS algorithm. According to the results, the proposed algorithm increased the WSNs' lifetime by up to approximately 6 times and 1.4 times compared to the traditional flooding methods and CDS based method, respectively. Furthermore, the CDS construction process constitutes only about 15% of the whole lifetime.