The negative impacts of climate change and the increasing global population on food security and unemployment threats have motivated the adoption of the wireless sensor network (WSN)-based Agri-IoT as an indispensable underlying technology in precision agriculture and greenhouses to improve food production capacities and quality.
1. Introduction and Tutorial Contributions
Currently, agriculture is the world’s largest business, employing over one-third of the economically active global population and over 70% of the economically active population in Africa 
. The impacts of high population growth rates and climate change-induced drought on food security, unemployment threats and reduced crop quantity/quality make smart Agricultural Internet-of-Things technology (Agri-IoT) via precision farming and greenhouses the most promising remedy. However, the existing benchmarking Agri-IoT solutions can only be acquired, deployed, and managed by farmers with sufficient financial resources, an electricity grid, Wi-Fi/cellular coverage, and technical expertise in IoT, which is generally not the case in Ghana and Sub-Saharan Africa. These call for a paradigm shift in farming techniques, and the most promising game-changers are precision farming and greenhouses whose underlying technology is a robust, affordable, autonomous, and optimized, innovative WSN-based Agri-IoT 
2. The Agri-IoT Ecosystem
The authors in 
established that the existing real-world attempts of Agri-IoT could not meet both performance and user users’ expectations because they are founded on the fundamental concepts and the operational principles of classic IoT and WSN technologies. It is imperative to conduct a systematic assessment of the related architectural layers in classic IoT and propose a suitable option for the WSN-based Agri-IoT ecosystem. Generally, the conventional IoT ecosystem consists of the network architectural layers and the data management platforms 
, which are further grouped into devices (sensors, actuators, and gateways/BS), network (BS to cloud), platforms/applications’ cloud, and agents/users. Due to the domain-specific requirements of IoT applications and the incorporation of numerous heterogeneous devices with application-specific requirements, there are generally no unified or standardized IoT architectural layers. Therefore, most application-defined layers are frequently adapted from the canon architectural layers, which include the three-layer 
, the cloud-based 
, the service-oriented architecture (SOA) 
, and the fog-based 
, as illustrated in Figure 1
Figure 1. Different architectural layers in the state of the art of IoT ecosystem.
The fog-based architecture was adapted from the three-layer parent architecture to include cloud computing by offering computing, storage, and network information between the clients and the cloud services 
in a decentralized manner. Here, cloud computing and fog/edge computing architectures only differ in where data computing occurs. These layers are not unified because the respective network layers do not cover all underlying technologies that transfer data to all IoT platforms 
. Additionally, they are based on complicated centralized and flooding-based routing architectures, high-resource-demanding and capital-intensive Wi-Fi/cellular-based communication technologies. As well, they require wired infrastructural support in the farm, which is too complex, location-restricted, and capital-intensive for most low-income and non-expert farmers to implement and manage. Consequently, they are unsuitable candidates for the resource-constrained SNs in WSN-based Agri-IoT. By implication, there are no reference guidelines for designing Agri-IoT participants and supervisory protocols, controlling the speed of packet delivery, smoothing out SN’s integration, unifying technology, and creating standardized Agri-IoT reference models, among other considerations. In contrast, an Agri-IoT ecosystem, depicted in Figure 2
, consists of:
Figure 2. Generalized Agri-IoT framework consisting of: field layout overview of Agri-IoT framework (a), sample of classic Agri-IoT in the state of the art (b), and key components of an SN or a BS (c).
Agri-IoT network architectural layers: This shows how the physical network elements, network operation principles, and operational techniques interact throughout the entire ecosystem.
Network supervisory software/routing protocol and routing architectures: This contains the virtual arrangement of multiple network elements 
and the event sampling/routing protocol that constructs the routing architecture, supervises sampling and moderates all communications in the PHY layer.
Data management platform: It hosts all high-resource-demanding data analytic engines, event databases, and remote control algorithms in a cloud model.
2.1. Proposed Architectural Layers for WSN-Based Agri-IoT
In designing an efficient Agri-IoT system of global significance, it is imperative to propose suitable architectural layers and evaluate how the various components interact in these layers. With the emerging advances in low-power, freely available, and boundless communication standards (e.g., BLE) and unfulfilled potentials of CA-IoT network 
, a new framework of cluster-based architectural layers for the WSN-based Agri-IoT ecosystem is proposed in the left side of Figure 3
. The center portion of Figure 3
presents the key components/technologies required in each layer, while the Things taxonomies of hardware components from the related literature 
are depicted on the right portion of Figure 3
. The underlying layers in the four-tier layers in Figure 3
can be elaborated on as follows:
Figure 3. Proposed Agri-IoT architectural layers with core components of Agri-IoT ecosystem and the “things” taxonomy.
Integrated Application and Management Layer: This operates all agriculture-related applications that interface between the user (for example, farmer) and the Agri-IoT system to make decisions and execute remote actions to keep their crops or animals healthy. This layer manages the entire Agri-IoT system and its application-specific functionality, high-resource-demanding applications, and core business model in the cloud. This layer’s security requirements are crucial to the next sublayer; however, these are beyond the scope of this research. The business or management sublayer maintains end-to-end data integrity and security by ensuring that data are transferred to the correct user. It also ensures that the correct user executes the actuation.
Information Management Layer: This handles data processing, storage, and other specialized cloud services and functionality that make precise, actionable decisions. In Agri-IoT, the sensory data are preprocessed locally to optimize communication power but can be further processed using analytic engines in the cloud for better decision making and remote monitoring and control. This layer can be embedded in the above application layers and hosted in the cloud in a typical Agri-IoT ecosystem.
Network Management Layer:
This layer discovers, connects, and translates devices over a network, and it coordinates with the above application layers. It also contains the BS, which interfaces the resource-constrained WSN and cloud information network. By convention, the WSN sublayer must utilize low-power communication standards such as Zigbee, SigFox, LoRa, BLE, Z-Wave, SigFox, and IEEE P802.11ah (low-power Wi-Fi), while the BS-to-Cloud connectivity can be achieved via the traditional cellular networks, satellite networks, Wi-Fi, LAN, WAN, and LoRa, among others. Unlike classic IoT, Agri-IoT requires that the BS-to-Cloud connectivity utilize low-power communication standards. Also, since every communication standard for the resource-limited WSN sublayer comes with unique resource specifications and design tradeoffs between power consumption, routing architectural constraints, and bandwidth 
, the best connectivity option must be selected to achieve the desired application goals. Consequently, the stated WSN-based connectivity technologies can be classified using several distinct parameters, such as energy consumption rates, uplink/downlink data rates, packet size, SN-count per BS (gateway), network routing topology, the SNs’ sensing range, the SNs’ transmitter/receiver power, frequency bandwidth, channel width, etc. (refer to the right portion of Figure 3
Physical/Perception/Things Layer: This layer refers to the field and all devices such as SNs, actuators, RFID tags, sensors, and edge devices that interact with the environment. This layer senses and collects the necessary information from the connected devices in the WSN sublayer to the BS. In Agri-IoT networks, the sampled microclimatic data can be processed and stored on the local BS, the cloud, or both. The activities in the cloud or application layers are beyond the scope of this tutorial.
2.2. Associated Hardware Components and Technologies Required in the Proposed Architectural Layers
To precisely model and design an Agri-IoT network of desired expectations using the proposed architectural layers shown in Figure 3, the knowledge of the principal components and technologies used in each of these layers and how they interact and adapt for their intended functions is imperative. As depicted in the middle of Figure 3, the Agri-IoT ecosystem is composed of the following core components/technologies:
Things: The Things unit is the physical interface between the tracked/monitored asset and the BS or actuator controller, which aligns with the physical or perception layer. It comprises the monitored/tracked asset (for example, field, crop, or animal), the SNs, or the entire IoT devices making up the WSN (for example, SNs, actuators, IoT-enabled devices, WSNs, and other smart devices), the event sampling, and routing technology in the WSN. Since the SNs constituting this unit are resource-constrained, freely available communication standards such as Zigbee, BLE, Z-Wave, and IEEE P802.11ah (low-power Wi-Fi) are the most suitable for both SN–SN and SN–BS communications. The Things unit accesses the cloud/Internet via gateways (BS).
Gateway (BS): The BS interfaces the WSN out in the field and the applications situated in the cloud servers. This unit aligns with the network management and actuator control layer shown in the middle of Figure 3. The WSN sublayer may have more than one BS(s), each with the capacity to handle most resource-demanding computational tasks besides actuation execution, network construction, scheduling of event sampling, and network supervision services. They may also allow bidirectional communication with the cloud/user and WSN. Similar to standalone IoT devices, the BS can be equipped with 4G/5G/LTE/NB-IoT, cellular-based, Wi-Fi, LoRaWAN, or wired ethernet communication technologies to interact with the cloud, and low-power communication standards such as LoRa, low-power Wi-Fi, SIGFOX, UMTS, BLE, and Zigbee (Figure 3) to communicate with the sensor field. However, Agri-IoT networks require that both upper-layer and lower-layer communication technologies of the BS should be low-power, freely available, easy to deploy and manage, and platform-independent. The BS may preprocess or relay the raw data to the cloud for remote data processing. The BS(s) locations are strategically chosen to optimize network communication costs.
IoT Cloud: The Cloud unit aligns with the applications layer. It consists of an on-premises or remote server farm that hosts the applications layer, event data analytic engines, security protocols, robust IoT applications, user interface, and event database. The high resource-demanding data-processing tasks are mostly executed by well-equipped cloud-hosted applications to manage and store huge amounts of data, provide monitoring and data analytical services, enable communication with devices, and manage information access. The merits of edge computing can be exploited to ensure that large amounts of data are post-processed off-device to reduce the response times of the cloud.
User Interface: With the aid of a web or mobile app, the user or farmer can live-monitor the farm’s conditions and execute control actions. Additionally, a presentation or business intelligence layer may be added to coordinate the activities of non-technical business users through dashboards and reports rather than with the application layer itself.
2.3. Quality Expectations of Agri-IoT’s Architectural Layers
Although there is no unified, certified, and flexible Agri-IoT architecture layer, any suitable options deduced from the benchmarking architectures in Figure 1 must satisfy certain quality requirements, including:
Simultaneous data acquisition, analysis, and control from many sensors or actuators.
Minimization of huge raw data transmissions via data aggregation techniques to maximize actionable information quality.
Provision of reliable network architecture that supports energy-efficient routing, stable connectivity, self-adaptability, fault tolerance, operational simplicity/flexibility, platform independence, affordability, and location independence of Agri-IoT designs.
Support for automated/remote device management and updates.
Easy integration of each layer with existing applications and other IoT solutions via specified APIs.
Utilization of freely available, location-unrestricted, cheap, energy-efficient, and simple to deploy and manage by non-experts 
underlying communication technologies in the PHY and network layers as well as based on open standards to guarantee interoperability.