According to the United Nations' (UN 2019) statistics, the world population is estimated to grow to 10 billion by 2050 [23]. As a consequence, the requirements of agricultural products are continually increasing. However, farmlands are declining, natural resources are increasingly depleted, and the rise of unpredictable nature challenges, such as global warming, salinization, and flooding, make food security the most concerning problem for all nations worldwide. In recent years, with the aim of increasing agricultural production, new solutions and technologies have been introduced in the agriculture sector [24]. An emerging trend is the application of the IoT and big data. A significant number of studies have been focused on research, experiments, and applications [25; 26]. According to the Cisco forecast, over 500 billion IoT devices will be connected to the Internet by 2030 [27]. The use of IoT and big data will enable smart agriculture and is expected to enhance efficiency and productivity [28]. Over the years, wireless sensor networks (WSN) have been strongly applied in the agricultural sector, building the foundation for developing smart agriculture [29]. The unique characteristics of WSN, such as the ability to self-organize, self-configure, self-establish, and self-recover, make it suitable for smart agriculture [30]. The sensor device consists of a radio frequency (RF) transceiver, sensor, microcontroller, and battery power [31]. The WSN focuses on applications such as environmental monitoring, machine control automation, and traceability [32; 33; 34; 35]. Along with the development of science and technology, the urgent requirement for breakthrough solutions and technologies aiming at improving productivity and efficiency in the agriculture sector has led to adoption of the IoT. The primary motivation for their applications is the breakthrough progress of smart agriculture and its inevitable role as the future of smart and sustainable environment management. IoT integrates a series of existing solutions and technologies, such as WSN, cognitive radio, ad hoc networks, cloud computing, and end-user applications [36]. In the smart agricultural sector, automation solutions and technologies, mechanical machines, knowledge, decision-making tools, services, and software are integrated seamlessly to help farmers improve productivity, product quality, and profitability [37]. In this work, a comprehensive survey of IoT applications for smart agriculture is conducted. An analysis of 135 relevant works published between 2017 and 2022 was conducted. Firstly, relevant 550 papers published in the period of (2017-2022) were retrieved from major scientific databases, namely IEEE Xplore Digital Library, Science Direct, MDPI,  
Figure 1: An illustration of IoT applications for smart agriculture. and Springer, by using keywords such as IoT-enabled smart agriculture, smart agriculture, Internet of Things, aquaponics, monitoring forestry based on IoT, tracking and tracing, smart precision farming, greenhouse production, Sigfox, LoRa, Wi-Fi, LoRaWAN, and IoT ecosystems. In the next step, we excluded papers that were published in low-repute conferences and journals, and then we conducted the content analysis for the obtained paper. Finally, 135 papers were selected for the preparation of the present work. In addition, we analyzed and discussed the benefits and challenges, open issues, trends, and opportunities of IoT in the smart agriculture sector. This work is organized as follows: Section 1 introduces our work, and in Section 2, we present an IoT ecosystem architecture for smart agriculture that consists of three main components: IoT devices, communication technology, and data storage and big data processes. Section 3 presents the IoT applications in agriculture, including (1) monitoring, (2) tracking and traceability, (3) precision agriculture, and (4) greenhouses. Section 4 introduces some open issues and future research challenges of IoT for smart agriculture. Issues are discussed for two main directions: business and technology.