# A Novel Intelligent IoT System for Improving the Safety and Planning of Air Cargo Operations
## 3 System Integration and Testing
### Laboratory Testing
The values labeled as \"Mag\" represent the digitized output of the position/magnetic sensors, \"Pz\" indicates the values of the three piezoelectric sensors, \"Switches\" is a two-digit hexadecimal number corresponding to a switch press combination, \"WiFi.RSSI\" indicates the Wi-Fi signal strength and \"Battery 1\" and \"Battery 2\" indicate the percentage of each battery pack. The fields \"Smoke Status\", \"value\", \"threshold\", \"humidity\" and \"temperature\" correspond to measurements, status indications, and alarms collected from the smoke detector. During this test, the proper orientation of the sensors was determined, since placing a ferromagnetic object on one side of the sensor increased the sensor's output while placing the same object on the other side of the sensor or changing its orientation, resulted in a decrease of the output of the sensor. The thresholds of the magnetic and piezoelectric sensors' outputs, above which the device was going to send a status change indication, in the case of the magnetic sensors or an alarm in the case of the piezoelectric sensors, to the HMI were also initially set during this testing phase. The final values of the thresholds were determined during the field testing phase of the system. vGatherInfoMqttForm vGatherInfoMqttForm REPORT_STATE_ALL_GATHERED Mag:3240, 3275, 3286, 3288, 3615, 3198, 3220, 3233, Pz:0, 0, 0. Smoke status: 20 value: 0 threshold: 120 humidity: 38 temperature: 18 Switches: @XFF ESP32W2M20T_OPTION_TOTAL_REPORT Battery 1:88K, Battery 2:100X WiFi.RSSI: -36.00 Published packet at channel:/INT/FACFA2A3 DCAB/report End mtt send  
Figure 9: RMC serial monitor report demonstrating the values read for the various sensors. The correct battery voltage reading of the microcontroller was also tested, by simultaneously monitoring the voltage reported by the microcontroller in its reports, such as the one presented in Figure 10, and the actual voltage of each cell using a multimeter. In this way, the battery percentage was properly adjusted to better represent the actual battery pack voltage percentage. The HMI application developed for the project's needs was tested thoroughly regarding three main groups of functionalities: communication with the ULD, sensor data reporting, and communication with the robotic platform. As far as the HMI communication with the ULD is concerned, the MQTT broker initialization was tested and verified that it started every time. The establishment of the communication between the HMI and the ULD was verified for each test via both the messages posted by the RMC in the serial monitor and the dashboard screen of the HMI, as depicted in Figure 5, where the connected ULDs are presented, alongside a brief overview of the ULD sensors' states. Regarding the sensor data reporting, once communication had been established between the ULD and the HMI, the sensors were triggered as described above, while checking the corresponding sensor indication in the HMI report, just as the one presented in Figure 6, to verify the change in the sensor's state. Finally, regarding the testing of the communication between the HMI and the robotic platform, several test scripts emulating the robotic platform had been developed, to testi the communication and the effective exchange of data during the loading and the unloading processes of a ULD. This was achieved by sending specific commands to the scripts corresponding to complete loading and unloading processes of ULDs on an aircraft and receiving an acknowledgment that each command had been successfully executed. All the aforementioned laboratory tests led to a better understanding of the system's capabilities as a platform for monitoring the status of a ULD at all times, as well as its limitations regarding the amount of data that can be accumulated for a single ULD locally.