# Evaluating LoRaWAN Connectivity in a Marine Scenario
## 2 Material and Methods
### Experimental Set-Up  
The layered architecture which has been designed for the specific marine application is constituted of (1) end-nodes, embedded systems, and electronics devoted to collecting and processing the information, and to support the communication; (2) multiple gateways responsible for data handling, message routing, and management of communication between platforms; (3) a server whose duty is data aggregation; (4) a web application that delivers services to end-users. In-situ tests were carried out using two types of end-nodes: some commercially available sensors such as the Field Test by Adeunis, the LT I/O Controller by Dragino, and some nodes that were developed on purpose. The latter includes three nodes (TIAMO 1, TIAMO 2, TIAMO 3, hereafter) which were developed on the basis of a ST microcontroller belonging to the STM32L4X family and a spectrometric sensor (spectrometer, hereafter) which, combined with advanced dedicated machine learning techniques and supervised identification and regression algorithms [31; 32], allows the extraction of information for monitoring the quality of marine waters, such as color and the presence of oil on the surface. The three TIAMO end-nodes (Figure 1a) were developed using the STM32 CubeMX-Win software v. 5.4.0 by STMicroelectronics (Geneva, Switzerland) for low-level management and the Atollic TrueSTUDIO STM32 v. 9.3.0 by STMicroelectronics (Geneva, Switzerland) for high-level programming. More in detail, the firmware generation takes place through a first definition of the hardware, in which STM32 CubeMX manages the definition of the peripherals by generating the low-level code that is imported into Atollic TrueSTUDIO allowing for the development of the board's operating logic using high-level programming languages (i.e., C, C ++) for the purpose. The three end-nodes were equipped with miniaturized meteorological sensors for collecting temperature, humidity, and atmospheric pressure. The spectrometer (Figure 1b) was designed using as sensing element a spectrometer type STS-VIS produced by OceanInsight, working in the visible range (350-800 nm) and thus suitable for the estimation of the concentration of chlorophyll-\(a\) and of suspended sediment even if limited to medium-low concentration levels. The processing unit was constituted of a Raspberry Pi 3B type equipped with a Sony IMX219 8-megapixel CMOS capable of producing static images up to 3280 \(\times\) 2464 pixels and supporting some video formats (e.g., 1080p30, 720p60, 640 \(\times\) 480p90). The overall spectrometer includes also a Dragino SX127X GPS HAT board, which is an expansion module for the Raspberry that includes the Semtech SX1276/1278 transceiver and the Quectel L80-M39 GPS receiver. The board connects via the GPIO connector, and it is directly powered by the Raspberry. Figure 1: (**a**) The LoRaWAN end-node TIAMO developed for the acquisition of meteorological parameters; (**b**) the spectrometer with the camera and the processing unit. Five commercially available gateways (LG308 by Dragino) equipped with GPS and with GSM capability were used to forward the packets via Ethernet to an ad-hoc private LoRaWAN server connected to a backend component which was responsible for processing and storing the data, allowing their monitoring and analysis through the information system. Specifically, the open-source Chirpstack LoRaWAN Network server was configured, and the open-source project Swagger was chosen as the backend. A web service was implemented for the visualization of the real-time tracks of the vessel equipped with IoT end-nodes to be used as a control center to detect the presence of vessels in a delimited coastal area, such as that belonging to protected marine areas. A data dashboard was implemented for the real-time visualization of marine environmental data and for providing information about the state of sea waters.