# IoT-Enabled Precision Agriculture: Developing an Ecosystem for Optimized Crop Management
## 4 Experiments and Simulation
Overall, the framework was assessed by creating a simulated test that primarily aimed to measure communication performance and latency, and comparing the efficiency and reliability of RPL protocol for fixed and mobile scenarios. Wireless sensor networks (WSNs) for fixed and mobile nodes have some key differences that need to be considered when designing and implementing them. In a WSN for fixed nodes, such as in an olive farm, the sensor nodes are typically placed in a stationary manner, either in the soil or on the trees. These nodes form a stationary network structure that is relatively stable and predictable. On the other hand, in a WSN for mobile nodes, such as in a horse stable, the sensor nodes need to be attached to the animals and are constantly moving. This results in a mobile and changing network structure that is more dynamic and less predictable. It is important to compare the dynamic behaviors of both cases to understand the impact on the network and the performance of the routing protocol used, such as the destination-oriented directed acyclic graph (DODAG) in the RPL protocol. By validating both cases, the practitioners can better understand the limitations and challenges of implementing IoT systems for precision agriculture and identify the most suitable solutions for different scenarios. The fixed sensor nodes in the olive tree, as shown in Figure 3, farm scenario form a stationary network, whereas the mobile sensor nodes attached to the horses in the stable scenario form a dynamic and constantly changing network structure, as shown in Figure 4. This allows us to compare the dynamic behaviors of the network in both cases and understand the impact on the RPL protocol's destination-oriented directed acyclic graph (DODAG) formation. By validating both scenarios, the experiments aim to demonstrate the flexibility and adaptability of the proposed framework in different precision agriculture environments and provide insights for future development and optimization of IoT systems in precision agriculture. The experiment is designed to measure the communication performance and latency of the system, comparing the efficiency and reliability of the RPL protocol in both fixed and mobile scenarios. Each scenario was evaluated individually within the overall framework and yielded acceptable performance; hence, they were selected to take part in the final framework. The system assessment results have shown the suitability of our implementation for edge and fog platforms in terms of packet delivery ratio, power consumption, and packet delivery rates that demonstrate the advantages of improving mobile and fixed sensor networks. The simulation tool used for this work is the COOJA simulator, a JAVA-based simulator for Contiki OS. The COOJAs mobility plugin needs to be enabled because it is not supported by default; it must include information about mobility positions for each node during the simulation. Therefore, the mobile node speed was set to 3.33 m/s. All node information regarding mobility positions was saved in a file and loaded before the simulation process started in the simulator. In all simulations, sensors that communicated with a central sink node completed data gathering and aggregation. The monitoring unit (MU), a central unit,works as a gateway between the users and the sensors, considering the typical physical configuration of a horse farm. The MU is a set of customized sensors for each horse on the farm; equine sensors in the horse stable are assembled in the sensor node. The horse is equipped with airflow, heart rate, body temperature, speed, indicator movements, and colic sensors. Each sensor node can read multiple parameters and communicate directly with the central point. The base station is plugged into the MU, which is the system's central unit and implements all users' and administrators' functionalities, communicating between sensor nodes, and connecting the system with the Internet and cellular networks.