*2.3. EcoSens Aquamonitrix System in a WasteWater Treatment Domain*

A distributed scenario is assumed in the wastewater treatment domain, e.g., WWTPs in many regions or countries. This is a complex IoT scenario, as it involves the management of a large number of sensors. The sensors are hosted in the *devices*, see Section 2.1, developed with the aim of collecting, processing and transmitting data associated with *assets* (nitrate and nitrite concentrations). The proposed scenario demands a solution that allows to integrate, manage and scale a large number of IoT devices and users. In order to meet these requirements, the EcoSens Aquamonitrix System has been implemented in a wastewater treatment plant scenario. This smart water quality monitoring system (SWQMS) depicted by Figure 5 is powered by the IoT platform described in the Section 2.2 to leverage the potential of wireless sensor networks and the sensor, see Section 2.1.

In the EcoSens Aquamonitrix System, the integration of the device with the IoT platform is achieved thanks to the information management middleware (see layer 2 of IoT architecture). Specifically, it uses an operation, henceforth *thingSend*, as a result of versioning the RESTful API to send the water quality data collected by the devices to the platform. This feature is useful because it allows to customize the body of the request and provides a special URL (endpoint) to access the *HTTP parser*, a Web service in charge of decoding and preprocessing the information. In this way, this innovative system takes advantage of the new functionalities offered by the Internet of Things based on the architecture studied in the Section 2.2. The devices are deployed in the influent and effluent of each WWTP. The devices communicate with the cloud via the mobile network, using the General Packet Radio Service (GPRS). At the top of the Figure 5 is the cloud, where instances of the components *message broker*, *DB Time series*, *Object repository*, and *Cloud Code SandBox* have been deployed. As a starting point, it is supposed the creation of an *organization* entity in the system. This entity has associated a *user* with administrator permissions. There are five different processes involved in the operation of the SWQMS: system initialization, capture and storage of information, information modeling, data analytics and visualization, and management of information. These processes are described below.
