## 3 Materials and Methods
### Container Tracking Device  
The container tracking device (CTD) meets the project user requirements, including pre-compliance to ISO 668 [31] and ISO 18185-3 [4] standards for HW characteristics and ISO/TS 18625 [5] for operational and system requirements. It is an electronic, compact, lightweight, battery-powered device to be installed on maritime containers by means of a suitable mechanical container and its attachment system. The function of the CTD is to monitor in real time the status of the container to which it is attached (externally on the door), regardless of geographical location (land or open sea). It has sensors (temperature, acceleration, pressure, humidity, anti-tampering of door opening) and two types of radio interfaces, covering \"long range\" and \"short range\", NB-IoT and BLE Mesh, as well as a GNSS receiver for position and timing and a UHF RFID illuminator. The NB-IoT radio interface enables the CTD to connect to a radio base station (BS) installed onboard (when offshore) or to the land-based cellular network (in coastal territorial waters or at logistic terminals ashore). The presence of the BLE radio interface allows the various CTD devices in proximity (present within the BLE's coverage range) to establish a \"mesh\"-type connection in order to exchange mutual sensor status, especially when the condition occurs where some CTDs are located in areas not reached by the cellular signal. In this situation through the mesh network, it is possible to propagate data from a CTD, in sensor node configuration, to the CTD docked to the NB-IoT cell that assumes the role of gateway between the BLE and cellular networks. Depending on the connectivity status of the radio interfaces, the device can assume the following roles:* NB-IoT terminal
* BLE Mesh Node
* NB-IoT/BLE mesh gateway  
The role of the device is dynamic and determined by the operating conditions. Each CTD can, therefore, assume various roles at different times. The role has no impact on either the hardware or the firmware of the CTDs, which are all the same. The microcontroller firmware is designed to support a range of critical functions that enable real-time monitoring and secure management of cargo conditions. Among its primary features is the ability to read environmental sensors, including those that measure temperature, humidity, and pressure. This ensures that the system can continuously monitor and report on the environmental conditions of cargo containers, helping to maintain the integrity of sensitive goods. Another essential feature is the monitoring of the RFID electronic seal. The firmware can read the seal's status, identifying whether it is tampered with, open, or closed. This capability enhances security by allowing for the instant detection of unauthorized access or breaches, ensuring that cargo remains secure throughout transit. Additionally, the firmware integrates data from an accelerometer, enabling it to detect significant movements or shocks. This feature is particularly valuable for monitoring the handling of goods, as it can alert stakeholders to potential damage caused by rough handling or unexpected impacts during transportation. The system also incorporates location tracking by reading geographic coordinates via a GNSS (Global Navigation Satellite System) module. This ensures precise real-time positioning, allowing for continuous tracking of cargo throughout its journey and enhancing overall logistics transparency. The firmware also supports time synchronization through GNSS, ensuring that all recorded data are accurately timestamped. This is critical for maintaining a consistent timeline of events, enabling better coordination and data integrity across various operational processes. Finally, the firmware is equipped with the capability to send collected data to the OneM2M ICON cloud platform. This transmission can be performed directly or through a network of mesh nodes acting as relays or gateways, ensuring reliable data delivery even in complex network environments.