G Model
ARTICLE IN PRESS
AGWAT-4656; No. of Pages 13
Agricultural Water Management xxx (2016) xxx–xxx
Contents lists available at ScienceDirect
Agricultural Water Management journal homepage: www.elsevier.com/locate/agwat
A software architecture based on FIWARE cloud for Precision Agriculture J.A. López-Riquelme a,∗ , N. Pavón-Pulido b , H. Navarro-Hellín a , F. Soto-Valles a , R. Torres-Sánchez a a b
DSIE, Technical University of Cartagena, Campus Muralla del Mar s/n, Cartagena, E-30202 Spain Department of Information Technology, University of Huelva, Ed. Torreumbría (C de La Rábida), 21004, Huelva, Spain
a r t i c l e
i n f o
Article history: Received 3 June 2016 Received in revised form 5 October 2016 Accepted 22 October 2016 Available online xxx Keywords: Precision Agriculture FIWARE Cloud Computing WSN
a b s t r a c t Using suitable information storage, management and processing resources is essential when Precision Agriculture-based applications are developed. Nowadays, traditional client-server paradigm is useful but it might not be enough for this purpose. The amount of data that could be stored and processed, and the need of generating complex knowledge and rules that allow stakeholders to take appropriate decisions related to crop optimization are leading researchers to pay attention to new solutions based on designing software architectures in the Cloud. This paper demonstrates that using cloud services in the agronomic context could be considered as highly beneficial. In particular, the used cloud provider is FIWARE, since it provides open source and free development modules, and even, several enablers for agriculture. An application has been developed by using the FIWARE components, and it has been validated in real crops located in a semiarid area of the South of Spain with the aim of reducing the amount of water necessary for irrigation tasks. The advantages of using FIWARE, opposite to the use of traditional systems, are properly analysed and highlighted. In addition, a discussion that emphasizes the advantages of using FIWARE instead of other well-known cloud providers is also presented. © 2016 Elsevier B.V. All rights reserved.
1. Introduction Water and food are the main resources that meet the needs of human beings. Agriculture provides most of the food, but it also consumes most of the Earth’s available fresh water. Furthermore, agriculture is not only a food source, but the main income stream for more than 70% of population in certain regions of Earth, such as many areas in Africa with low-income economies (Chibuzor and Lionel, 2006). On the other hand, the food and agriculture sector represents 5.9% of world Gross Domestic Product (GDP), at least 35% of worldwide employment, and in the European context it is one of the largest manufacturing sectors (Brewster et al., 2012). In arid and semiarid regions, as Southern Spain, the water supply is an important factor that considerably affects agriculture. In fact, water optimization is a key requirement for sustainable and economically profitable crops in such areas (IDAE, 2005). Development of innovative irrigation systems that efficiently use water is a major
∗ Corresponding author at: Dpto. de Tecnología Electrónica, ETSI Industriales, Campus Muralla del Mar s/n, 30202, Cartagena, Murcia, Spain. E-mail addresses:
[email protected],
[email protected] (J.A. López-Riquelme).
priority. In these regions, farmers must irrigate their crops effectively; therefore, they must find new solutions and methods that improve the irrigation programming systems, taking into account not only the state of the soil and the plants, but also climate information. All these data should be properly interpreted to decide the most suitable actions to carry out. Precision Agriculture (PA) is a set of techniques that provide a suitable solution to these problems because it aims to optimize field-level management with regard to crop science by matching farming practices more closely to crop needs. Economic advantages are also obtained by boosting competitiveness through more efficient practices (e.g. better management of water usage and costs). On the other hand, Information and Communication Technologies (ICTs), such as Global Positioning Systems (GPS), and Geographic Information Systems (GIS), Remote Sensing and Wireless Sensor Networks (WSNs), among others, are used to acquire information about the crop needs. PA techniques use this information to achieve the proposed objectives, in particular, intensive monitoring of crops, data analysis, decision making and application of control actions (López et al., 2015; Zhang et al., 2002). According to scientific literature, many ICT-based agricultural applications have been carried out during the last two decades (De
http://dx.doi.org/10.1016/j.agwat.2016.10.020 0378-3774/© 2016 Elsevier B.V. All rights reserved.
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13 2
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
la Rosa et al., 2016; García Morillo et al., 2015; López et al., 2015; Navarro-Hellín et al., 2015; Oates et al., 2015; Puerto et al., 2013). Most of these applications need to use a great amount of information that should be properly acquired or generated, processed and stored. Almost all of these solutions are based on proprietary systems or simply developed at research level, and both approaches are usually incompatible. Consequently, there is not currently (and it is probably hard to obtain), a common worldwide database with a normalized schema for freely sharing agricultural information between stakeholders in the context of PA. Having this database available would be very interesting for administrations and governments, since water resources distribution could be more efficiently planned. Moreover, appropriately processing the information by using novel statistical and Soft Computing-based approaches should be very useful for generating knowledge that enables taking decisions and predicting future undesirable happenings (or their consequences), such as droughts, plagues or climate events, among others. Given that building this kind of agricultural information storage should be enormously beneficial, new Cloud Computing-based techniques should be considered for meeting this goal. However, many of the existing PA-based systems are currently implemented by using traditional web hosting servers (Vyas et al., 2016). On the other hand, those that include Cloud Computing techniques often use general purpose cloud providers that do not offer agricultureoriented specific services. Furthermore, most PA-based systems are usually designed ad-hoc with the purpose of solving a specific problem in a specific kind of crop; therefore, most solutions are not easily applicable in another context (Sales et al., 2013). Future Internet-based solutions could successfully address the problem. In particular, the Future Internet (FI) could be considered as a set of related emerging technologies and standards (Granell et al., 2016). Specifically, the pervasive connectivity promised by the Cloud Computing paradigm, the Internet of Things (IoT) phenomenon and Big Data innovations might lead to disruptive changes in the design and development of data-intensive applications as the required in PA. In particular, the EU’s Future Internet Public-Private Partnership (FI-PPP) is a program that aims to make service infrastructures and business processes more intelligent, more efficient and more sustainable through tighter integration with FI technologies (Brewster et al., 2012). The use of these technologies could allow researchers and developers to design and implement normalized storage systems for saving worldwide agronomical information that stakeholders could easily share and process with the aim of generating knowledge, useful for decision making in an agronomical context. In literature, works that analyse the possible benefits of applying Cloud Computing to Smart Farming can be found (Zhu et al., 2013; Choudhary et al., 2016); however, most of them do not address how to design software architectures in this context. The main objective of this work is focused on designing a cloudbased software architecture that enables the deployment of PA systems, based on the use of WSNs, capable of acquiring information of the crop, sending it to the cloud and transparently storing, managing and sharing such information. Such architecture consists of a set of software components that allow worldwide agronomical information to be warehoused in a common data warehouse that stores normalized information from the agronomical point of view. The Cloud Computing paradigm has been selected for designing and developing the mentioned architecture, since it exhibits interesting features, such as cost reduction, agility, scalability and elasticity, among others, when such paradigm is compared to other traditional web hosting services. In particular, the system has been deployed and proved in the FIWARE Cloud, since FIWARE is a part of the mentioned FI-PPP program and it provides certain advantages over other known cloud providers, mainly related to cost and the
existence of specific products and services that could be used in the agricultural context. The tests have demonstrated that using such architecture, agronomical data registration is easy and transparent regardless of the used hardware architecture. The paper is organized as follows. Section 2 describes the methodology, tools and software modules that have been used in this work, together with the hardware architecture that has allowed the Cloud-based software architecture to be properly validated. Section 3 shows the main obtained results. Such results have been appropriately discussed with the purpose of demonstrating that the proposed architecture (and, in general, the FI paradigm), provides interesting benefits and advantages in the agronomical context. Finally, main conclusions and future work are shown in Section 4. 2. Materials and methods In the PA context it is necessary to design systems capable of monitoring different variables that affect the crop growing process (soil, environment, water and plant), and to use appropriate techniques to analyse such information allowing stakeholders to take decisions related to production optimization. For this purpose, an autonomous, compact and wireless device, compatible with most agronomic sensors found in the market and which could be placed anywhere in the crop, has been developed. Specifically, the device is capable of sensing different parameters such as water content, temperature or electrical conductivity and matric potential in the soil, among others, at present. This allows the farmer to get information about the water needs of the crop in real time, and to take decisions about how to manage irrigation in an optimal manner. Such device is the essential component of a Wireless Sensor Network, that can be deployed with the aim of monitoring crops. The retrieved information should be properly stored and processed; consequently, an appropriate software architecture should be defined and implemented for this purpose. This software architecture should have a set of specific features and should meet some requirements. Particularly, it should allow the implementation of a distributed, reliable and secure collection of modules and components, which should be easily shared and reused. The mentioned architecture is also required to be scalable and elastic (from the hardware and software resources point of view). Finally, and not less important, such architecture should provide a set of rich, universal and easy to use Web Services, which enable the storage and management of information generated by most of devices and hardware architectures used in the context of agriculture. According to this purpose, a common worldwide database with a normalized schema for freely sharing agricultural information between stakeholders involved, in the context of PA, should be achieved. As it will be explained and justified below, the FIWARE platform has been selected for meeting the aforementioned features and requirements. The following subsections describe the farms where the sensor nodes have been deployed (with the purpose of validating the correct operation of the proposed software architecture). After this, the hardware architecture components and FIWARE modules that have been used will be described. Finally, the tests carried out for validating the cloud-based architecture will be also detailed. 2.1. Experimental plots/description of the farms Widhoc Smart Solutions S.L. is a Spin-Off of the Technical University of Cartagena, in Murcia (Spain) which provides products and services, mainly, for optimizing the irrigation water in the agricultural sector. This company, which has a lot of costumers of woody and horticultural crops, distributed in the southern of Spain (see
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
3
Fig. 1. Woody and horticultural crops, distributed in the southern of Spain where several WSNs have been deployed by the Widhoc company.
Fig. 1), has allowed the proposed cloud PA-based system to be validated in a real environment with different kind of crops. This fact is relevant because most works in literature present ad-hoc case studies whose results are hardly applied to other environments and crops. However, in this work, the proposed software architecture has been validated in two of the Widhoc’s customers’ farms. Note that, since the Widhoc company has also deployed PAbased systems hosted by a traditional web hosting service, it has been possible to analyse and compare the results obtained with the new proposed system and the traditional web hosted system. The first experiment was carried out in a farm (FARM #1) of fino lemon trees (Citrus limon L. Burm.fil cv. 49.) on C. macrophylla Wester (Navarro-Hellín et al., 2015). The orchard consists of 10year-old lemon trees, and it is located in Murcia (SE Spain), with GPS coordinates 38◦ 06’ 45.76” N, 1◦ 07’ 49.76” W and 166 m of elevation. Tree spacing was 7.0 m × 5.5 m, with an average ground coverage of about 47%. Two drip irrigation lines (0.8 m apart) were used for each tree row. There were 4 emitters (4 L h−1 ) on both sides of each tree. The second experiment was carried out in a commercial plantation (FARM #2) of 12-years-old almond trees (Prunus dulcis (Mill.) D.A. Webb cv ‘Guara’), grafted on ‘GF 677’ rootstock, planted at a tree spacing 6 × 6 m, and located in Murcia SE Spain with coordinates 37◦ 41’ 17.89” N, 0◦ 56’ 58.95” W and elevation of 33 m. The soil is characterized by a deep and homogeneous sandy – clay – loam with low organic matter (1.1%). The soil has a water-holding capacity of about 150 mm m−1 and bulk density varying within 1.3–1.59 Mg m−3 . One drip irrigation line was used for each tree row with 4 emitters (4 L h−1 ) for tree. The climate in the aforementioned farms is Mediterranean type. Average values of mean annual temperature and annual rainfall determined over 3 years of experiment (2013–2015), at a nearby automatic weather station were 18.1 ± 0.4 ◦ C and 204.7 ± 18.7 mm,
respectively. The corresponding value of reference crop evapotranspiration (ET0 ) calculated by using the FAO–Penman–Monteith equation (Allen et al., 1998) was 1304.5 ± 30.4 mm. The information about soil characterization has been previously obtained from available data before installing the new system. 2.2. Hardware architecture The Widhoc GPRS Node, which is manufactured by the Widhoc Smart Solutions company, has been used with the purpose of validating the proposed software architecture. The electronic design of the node includes basic components plus several functionalities and characteristics described in this section. The modular design consists of several electronic boards: (1) A main board named MEWiN Mainboard (Multi-Environmental Wireless Node Mainboard), which includes the common components used in any WSN-based application. Some of these components are a microcontroller, a radio module, a real time clock and a microSD interface, among others. (2) A second board, named MEWiN GPRS-Board, which allows different types of commercial sensors to be connected. (3) Finally, a GPRS module is used with the aim of sending data from the sensors to the data server (NavarroHellín et al., 2015). The core of the MEWiN platform (see Fig. 2a and b) is the low power microcontroller MSP430F2618 by Texas Instruments, in charge of managing the behaviour of the node. It includes a GPRS modem in the MEWiN GPRS-Board (see Fig. 2c), that is connected to the MEWiN Main-Board (see Fig. 2d), through expansion connectors, which are redirected to different analogue and digital I/O, to UART from microcontroller, to energy supply and to ground lines. The MEWIN GPRS-Board consists of several interfaces and voltage converters (two CC/CC converters of 12 V and 5 V; SDI-12, 0–3 V and 4–20 mA interfaces; and digital I/O), which allows the device to be
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
4
Fig. 2. Widhoc GPRS Node’s pictures and specifications. (a) Main technical details of the device. (b) Final setup showing the three boards connected. (c) MEWiN GPRS-Board. (d) MEWiN Mainboard.
connected with a large range of commercial sensors to use in several applications. One of the main characteristics of this interface board is the connection of a GSM modem in order to send information to the data server. In particular, the used modem is the SIM900 (SIMCom, Ida-Virumaa, Estonia), with the purpose of sending HTTP requests. 2.3. The FIWARE platform Cloud Computing, also named on-demand computing, is defined as a kind of Internet-based computing that delivers on-demand shared data storage and processing resources to a wide range of devices. It is considered as a model that enables ubiquitous access to a shared pool of configurable computing resources, which are fast provided and released with minimal management effort, according to the existing demand (Kavis, 2014). Note that, Cloud Computing model goes beyond the concept of Internet hosting service. In fact, this paradigm offers different models of deployment, depending on the selected provider: private, public or hybrid clouds. In addition, the cloud model is designed by considering three connected layers: Infrastructure as a Service (IaaS), Platform as a Service (PaaS) and Software as a Service (SaaS), as shown in Fig. 3. SaaS layer enables final users to access Internet-based applications by using “thin” clients, such as those based on the use of browsers (HTTP/HTTPS
clients), or apps executed in smart mobile devices. PaaS layer allows software developers to design and implement a wide range of applications delivered through the SaaS layer. Finally, IaaS layer could be considered as the most basic cloud-service model that provides physical machines and resources by using virtualization technologies (Voorsluys et al., 2011). Nowadays, there are many providers that offer a wide variety of cloud-based services at the level of SaaS, PaaS and IaaS. In fact, many big companies, such as, Google, Microsoft or Amazon, among others, provide a great number of cloud services in the context of cloud storage, virtual servers, Business Intelligence (BI), Big Data management, Internet of Things (IoT), mobile applications, websites and web apps, financial services, genomics, retail and commerce, gaming or machine learning. There are even IoT platforms based on using services provided by such companies. For instance, the Kaa IoT platform offers services in a local virtual machine or in a virtual machine deployed by using an Amazon Web Services (AWS) account. Most providers are oriented to supply a general framework that stakeholders can configure and customize according to the expected objectives; however, almost no provider provides specific services related to specific fields, such as, for example, agriculture. In addition, such providers often offer a very limited number of free resources, both at the level of PaaS and IaaS layers, by using a quotas-based system. One of the main problems in systems such
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
5
Fig. 3. A graphical representation of the three cloud layers available when a software architecture is implemented in a cloud provider.
as Google or Amazon is to easily estimate when free quotas will be exceeded. This problem could become serious since when an application exceeds the free quotas, the owner is charged for the additional usage up to a daily maximum amount that can be properly configured. Such configuration is not easy to define a priori. Consequently, the economic cost grows according to the usage. This paying-for-usage model could be a good strategy for many companies and developers that work in the field of ICT; however, it could also curb the intention of many non-ICT related users of using Cloud-based systems; in particular, in the context of Agriculture, where people could not become familiar with PA-based solutions. After considering the aforementioned benefits and drawbacks, the selected cloud framework for this work is FIWARE, which could be defined as a platform that “provides a rather simple yet powerful set of APIs (Application Programming Interfaces) that ease the development of smart applications in multiple vertical sectors”. Moreover, “the specifications of these APIs are public and royaltyfree” and “an open-source reference implementation of each of the FIWARE components is publicly available, so that, multiple FIWARE providers can emerge faster in the market with a low-cost proposition” (Fiware Project, 2016). Furthermore, FIWARE community is committed to materialise the FIWARE mission, that is: “to build an open sustainable ecosystem around public, royalty-free and implementation-driven software platform standards that will ease the development of new smart applications in multiple sectors” (Fiware Project, 2016). Particularly, FIWARE ecosystem provides both general and specific enablers for allowing developers to design, implement and deploy cloud-based solutions for many different problems that can be also delivered through the FIspace platform (an integrated collaboration system). More specifically, FIspace is a “Future-Internet-based extensible SaaS-platform fostering seamless, efficient, and effective business collaboration across organizational boundaries” (FIspace D200.1, 2013). This is another interesting feature that many cloud providers do not offer. One of the sectors considered by FIWARE is specifically the Agriculture field, throughout the SmartAgriFood Accelerator, which supports Small and Medium-sized Enterprises (SMEs) that develop smart services and apps to be addressed in the agri-food sector. In particular, the SME Widhoc, which has enabled the experiments of
this work to be carried out, belongs to the set of companies that comprises such accelerator. In order to build a cloud software architecture deployed in FIWARE, it is necessary to know the set of components that the platform provides. In this work, the main goal of the proposed system is to allow agricultural information to be easily stored, shared and interchanged, in a reliable, secured, standardized and normalized way, by using a software architecture, whose modules are based on FIWARE components. In particular, in the experiments, such information is acquired by the WSN nodes described in Section 2.2, which have been specifically designed with the purpose of carrying out monitoring tasks in real agricultural environments. FIWARE provides a set of generic enablers (GE), that can be used as software components of different applications and/or architectures. Moreover, it includes security protocols, such as OAuth2, when the information is interchanged, since it is necessary to ensure the involved agents privacy. Table 1 shows a brief description of the main GEs that are available. Summarizing, in this work, a set of GEs, such as the CB GE, the Cosmos GE, the Cygnus Injector or the Wirecloud Application Mashup, are employed with the aim of easily making data flow between crops and users possible, in a standardized and normalized way, see Fig. 4. Once the necessary virtual machines (VM) have been created with the required resources, the CB instances are deployed on those servers that FIWARE makes available for developers on FI-Lab, defined as “a non-commercial sandbox environment where innovation and experimentation based on FIWARE technologies takes place” (Fiware Project, 2016).
2.4. Description of the experiments Several experiments have been conducted with the aim of demonstrating the benefits of using the proposed FIWARE-based software architecture. First, a set of specific trials, at the laboratory, were designed in order to validate the performance of the GPRS node described in Section 2.2, when it exchanges information with the FIWARE cloud. Later, several nodes were deployed in the two farms described in Section 2.1, with the aim of ensuring that the system properly works in real scenarios. In this case, the farmers’ feedback was also taken into account throughout a set
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model
ARTICLE IN PRESS
AGWAT-4656; No. of Pages 13
J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
6
Table 1 Set of main generic enablers provided by the FIWARE platform. Enabler
Description
Context Broker (CB)
One of the main modules. It follows the Publish/Subscribe paradigm. It allows data communication to be conducted in an easy way by using a standard communication protocol based on Restful over HTTP. It is used at the SaaS level.
Main Context Broker (Orion CB) Particular instance of CB GE Cosmos
Cygnus Injector
Access control Wirecloud Application Mashup
It could be hosted by launching virtual machines in the context of IAAS. (More flexibility and privacy). It is used with the aim of persisting such historical information coming from the CB (which is only capable of storing current data), achieving historical data storage and allowing the big data analysis, if required. It allows the CB GE to be connected to the Big Data Analysis GE. It is used for storing persistent data in Cosmos. It is needed for authentication management. It is used with the aim of developing the apps user interfaces.
of events organized by the Widhoc company, which allowed some selected customers to know the offered service. Such feedback has been especially useful to enhance the provided service. Specifically, three GPRS sensor nodes were deployed in FARM #1. On the other hand, four devices were deployed in FARM #2 for monitoring this crop. The selection of the number of nodes were made by several agronomists that works with the Widhoc company by considering several aspects, such as, economic cost of the components, suitability according to the parameters that should be measured and geographical and crop size issues. By taking into account all these features, only three and four nodes were needed, respectively. Particularly, four sensors were connected to all the GPRS nodes installed in both farms: (1) a MPS-6 (Decagon Devices, Pullman WAUSA) for measuring the soil matric potential and the temperature of the soil at a depth of 30 cm, and (2) three 10-HS (Decagon Devices, Pullman WA-USA) for measuring the volumetric water content at 20, 40 and 80 cm of depth, and located at 25 cm from a represen-
tative dripper and 2.25 m from the trunk. The mentioned sensors were used for measuring the matric potential (m ) and volumetric soil water content (v ) every 15 min. The data was sent to the platform every hour with the purpose of optimizing the power consumption. 3. Results and discussion This section details the main results obtained in this work and shows the main benefits of using the proposed FIWARE-based software architecture, whose working is fully described. 3.1. Description of the proposed FIWARE software architecture As mentioned before, FIWARE could be defined as a Cloud Computing ecosystem that enables the design and development of applications in the Cloud, by using a set of free and open source generic and specific enablers. The software architecture proposed in this work has been developed by using the generic enablers previously described. The main objective is to provide an online, distributed, scalable, elastic, reliable and secured framework that allows stakeholders to store and process information and to generate valuable knowledge aimed to enable decision making in the PA context. In order to do this, a common worldwide database with a normalized schema, for freely sharing agricultural data, has been designed. Such database has been implemented by using the Cosmos and CB GEs. The global architecture of the system (see Fig. 4), consists of the following modules: • A completely autonomous hardware device named “FIWARE Smart Agricultural Node”, that is in charge of reading the agricultural sensors connected to it and sending the information to the FIWARE server component. • A FIWARE software component capable of receiving all the information sent by the remote nodes, that is, a customized CB GE that runs in a private virtual machine. Later, such information is properly stored by using the Cosmos GE throughout the Cygnus connector. • A customizable graphic user interface that enables the visualization of the information. In particular, three interconnected
Fig. 4. Diagram that summarizes the main hardware and software components used in this work.
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
widgets have been developed for this purpose in the FIspace platform.
3.1.1. The FIWARE server component The FIWARE server is in charge of receiving the information from the smart agricultural node, storing it and providing the suitable webservices that will be used by the graphical user interface to visualize the sensor information. It could be considered as a key element for the proposed software architecture, since it hosts the set of proposed software components that runs in the backend, since it runs in a virtual machine (VM), hosted in the FIWARE Lab (FILab), which allows developers to setup the basic virtual infrastructure needed to run applications that make use of the APIs provided by FIWARE GEs. As mentioned before, several FIWARE GEs have been used to implement the software architecture components (see Fig. 5), that runs in the FIWARE server:
• The Context Broker GE (CB GE): It receives the data sent by the Smart Agricultural Node, throughout the Cygnus connector. A MySQL database (with one table) has been specifically designed for storing the sensor readings acquired by the GPRS nodes, see Fig. 6a; and the Cosmos GE (which uses four tables), see Fig. 6b, has been designed for storing information about how the nodes and sensors are organized. The tables of the Cosmos database are SystemAMS for saving the description of the installation; NodeAMS for storing the description of each deployed node in all the available installations; and SensorAMS and SensorTypeAMS for saving information about the type of sensors and the specific sensors connected to each node. • Tomcat Server: The Tomcat server communicates with both the Cosmos GE and the MySQL database, and provides the set of webservices that the frontend widgets use. • MySQL database: The purpose of the MySQL database (which stores the sensor readings with their timestamps), is to enable the development of those webservices that provide information to the frontend widgets with a very low latency.
7
The dataflow between the GPRS node and the Cosmos GE is shown in Fig. 7. The CB GE can be considered as the FIWARE entry point of the information generated by all the available sensors, and it stores the last received value from each one. The interaction between the sensors and the server is carried out by using properly configured Update Context and Subscribe Context operations. The connection between Cosmos and the CB is enabled by the Cygnus connector by using a subscribe operation. Thus, each sensor value (with its timestamp), is received by the CB entity and properly saved in the database. The persistence of data can be configured in two different ways: (1) Storing data according to specific time intervals (ONINTERVAL option); and (2) storing data when an attribute value changes (ONCHANGE option). In the proposed system, the ONINTERVAL option has been selected. 3.1.2. Description of the graphical user interface The Application Mashup or Wirecloud GE (available in both FIWARE and FIspace), has been used during the graphical user interface design stage. In particular, if the user wants to access the information generated by the available sensors, he/she has to use the designed frontend. Only the Wirecloud API is needed if the frontend requests the last value of a specific sensor; however, it is necessary to implement other PHP and Javascript modules, if the historical information of an entity is required to be retrieved by using a frontend. The Wirecloud GE grants the ability of creating different applications that will be finally uploaded to the FIspace market place. Such applications can be developed using a wide range of different web programming languages, such as HTML, CSS, Javascript, PHP or XML, among others. In this work, different widgets are used as key elements of the user interface. One widget is the WIDHOC Field Status, which shows the location of the nodes and the graphical representation of the set of data retrieved from each sensor (see Fig. 8). Another one is the WIDHOC Multisensor Indicator, which displays the last data received by the node that is selected in the Google map (see Fig. 9). The WIDHOC Multisensor Monitor widget display the last 50 values received by the sensors connected to a specific node (see Fig. 10). Finally, Fig. 11 shows a picture of the whole system.
Fig. 5. Architecture of the FIWARE Server Component.
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13 8
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
Fig. 6. Tables of the two defined databases. (a) Structure of the table defined in the MySQL database. (b) Structure of the four tables defined in the Cosmos Server.
Fig. 7. A graphical representation of the data-flow between the GPRS node, the backend and the frontend.
3.2. Agronomical results generated by the FIWARE architecture Verifying that all the relevant information is suitably acquired, sent to and stored in the FIWARE cloud is required. Furthermore, it is also particularly important to analyse several performance parameters related to for instance, nodes’ electrical consumption, network latency, response delays, or number of loss messages and data, if it is desired to satisfy the expectations of users; since, if data are not properly sent, stored and retrieved, the crop monitoring process could lead to stakeholders to misunderstand the crop
behaviour and, then, to take wrong decisions about the irrigation model that should be applied. In particular, several experiments (described in Section 2.4), have allowed the system to be properly analysed and validated, considering all the aforementioned issues. In this section, the obtained results after conducting such trials are detailed. First, data obtained from laboratory tests are shown and discussed. Then, the performance of the Cloud system is evaluated from the results obtained in the real crops described in Section 2.1.
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
9
Fig. 8. A screenshot of the “WIDHOC Field Status” widget. The central graphical representation shows soil matric potential and volumetric water content and temperature collected during 5 days in a specific crop.
Fig. 9. A screenshot of the “WIDHOC Multisensor Indicator” widget.
Fig. 10. A screenshot of the “WIDHOC Multisensor Monitor” widget.
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13 10
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
Fig. 11. A picture of the GPRS node, the sensors and the frontend of the implemented system.
3.2.1. Laboratory results Obtaining results from laboratory tests is necessary to validate the system before going to the deployment stage. Specifically, power consumption and autonomy tests in a controlled environment are particularly useful to ensure that the node is capable of carrying out its tasks in the real crop with a minimum (or even without), human intervention. Therefore, this section shows and discusses those results related to node autonomy from the power consumption point of view. As mentioned before, the designed node is capable of sending information to the Cloud by using a GPRS device, which implies variable throughput and latency that depend on the number of other users concurrently sharing the service. Furthermore, the speed of data transfer could vary depending on the technology. In addition, the behaviour of the Cloud backend is also relevant to estimate such communication parameters. Latency is an important feature because it has a certain influence in power consumption, since the longer the node takes to send a message and receive the response, the higher the node power consumption is, because the radio module has to be turned on during the whole process. With the purpose of testing that the GPRS node power consumption is within an appropriate range, several real power consumption values have been calculated both in a controlled laboratory environment and after deploying a set of nodes in real plots. As mentioned before, the GPRS node is equipped with a microSD card that locally stores information about the connected sensors, the sample period and the transmission rate or the GPRS and remote server configurations, among others. The installer could easily change the operation mode by simply rewriting some parameters in a few files. In addition, the device also implements an algorithm specifically designed for battery life optimization. In fact, the solar panel connection is only activated if the battery is outside a specified voltage range. According to the node state, that is: (1) initialization and configuration, (2) standby, (3) interface warm-up, (4) digital sensor data acquisition, (5) GPRS standby and (6) GPRS module transmission; node consumption and then node autonomy could vary. Fig. 12 shows the power consumption values of such states. They
Fig. 12. Power consumption of the device in any state.
were measured with the YOKOGAWA WT210 wattmeter and the associated WTVIEWER software. As shown in the experiments, the node only reaches the state (1) when it is switched on or the reset button is pressed. The device worked in the state (2) during the most part of the time. In this case, the power consumption was kept below 600 A. The sequence of states (3) and (4) was repeated every 15 min (sample rate), first reading the digital sensors and later the analogue sensors. After 1 h (sending rate), all the collected data from sensors, which were available in the card, were sent to the server. Obviously, as this procedure requires the radio module to be turned on, the consumption could be affected by network latency. Finally, an average power consumption of the device of 4.29 mA was calculated. More information about this process could be found in (Navarro-Hellín et al., 2015).
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
Results demonstrate that the consumption values are in the expected range. In fact, as the devices are equipped with a Li-Po of 2300mAh, 3.7 nominal voltage and an external solar panel of 0.8 W (5 V/160 mA), the estimated autonomy of the device is of approximately 22 days without Sun and unlimited if the whole charging system is properly working. 3.2.2. Results obtained from the experiments in real crops The experiments in real crops have been designed with the purpose of demonstrating that using a Cloud software architecture (particularly when the FIWARE platform is used), is very useful for farmers and other stakeholders in the agri-food sector, since the proposed cloud system allows agricultural information to be monitored, properly retrieved and processed, in a standardized, normalized, reliable and safe way, with the aim of generating enough knowledge that enables decision making in the context of crop management, in an optimal manner. In particular, in the farms where the system has been tested, the main objective has been aimed to both minimize the water consumption and improve the crop production. In order to do this, the farms’ owners hired the Widhoc SME’s services. Such company properly installed the proposed solution (including all the required sensors and nodes and deploying the FIWARE-cloud-based software architecture). All the information monitored by the system was at the disposal of not only the farmers, but a set of agronomist experts that collaborate with Widhoc, with the purpose of generating a suitable and optimized irrigation strategy (which should be applied by such farmers), according to the retrieved data and the expected goals. In this case, both farmers and agronomist experts can be considered as system’s stakeholders. In fact, they are specifically the final users of the proposed system. With the purpose of proving the proper operation of the full charging system and validating the autonomy results obtained at the laboratory, a real test was carried out over a period of two months. Fig. 13 shows the voltage recorded over the mentioned period (1st April to 28th May 2016), in detail. Note that, the battery voltage was kept between the desired values thanks to the solar panel and the charging algorithm. On the other hand, it is necessary to ensure that the system is reliably working, in the sense that messages are properly sent and received by the cloud backend, and the stored information is consistent. Data provided by the nodes installed in the plots described in Section 2.1 have been properly analysed with the purpose of validating the performance of the system. A representative set of obtained results are shown in this section.
11
Figs. 14 and 15 respectively show the soil matric potential and the soil volumetric water content acquired with the soil sensors MPS-6 and 10-HS, in both the fino lemon crop (FARM #1) and the almonds crop (FARM #2). Specifically, Fig. 14 represents the data acquired by the Node #1 of FARM #1 during May 2016. Such representation demonstrates that the water needs has been kept, since the m values are greater than −20 kPa. Moreover, the variations in the v values are related to the irrigations cycles applied to the crop during the aforementioned month. Finally, the v values measured at 40 and 80 cm of depth reveal a correct drain and an appropriate selected irrigation frequency when the retentive soil characteristics are considered. On the other hand, a similar analysis for the m and the v values measured with Node #2 of FARM #2 could be determined in Fig. 15. 3.2.3. Final remarks Summarizing, results show that the whole proposed cloudbased system is properly working both at the laboratory and in real crops. One major advantage of the system is related to scalability from both hardware and software points of view. In fact, the node has been designed to enable the inclusion of new sensors frequently used in agriculture, thanks to the set of interfaces embedded in the GPRS board. In addition, reprogramming the firmware is also a relatively simple task. On the other hand, from the software developer point of view, the system maintenance is easy, since the software architecture is based on reusable components hosted in the FIWARE cloud. Moreover, the databases’ schemas are generic enough for including information of new sensors that could be easily added, if required; consequently, the objective of designing a scalable, reusable and easy-of-sharing warehouse, in the context of PA, is met. On the other hand, it is not necessary to acquire and maintain expensive computing equipment, because FIWARE offers a set of virtual machines that can be properly configured and are automatically scaled according to the application requirements. When the FIWARE cloud provider is compared to other wellknown public cloud providers, the first one offers an open source and free solution that supplies all the necessary modules for Cloud Computing (including Big Data), in a safe and reliable manner. Furthermore, FIspace and the SmartAgriFood project offer interesting modules focused on the design and development of solutions for the agri-food sector, including components that enable the business to business processes, as for example, the Business Collaboration Module (BCM) and the Event Processing Module (EPM), among oth-
Fig. 13. Battery voltage discharge and charge curve during 2 months period of NODE #2 and NODE #3 deployed in FARM #1 and FARM #2, respectively.
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13 12
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
Fig. 14. Soil matric potential and volumetric water content values collected during one month with the NODE #1 deployed in the fino lemon crop (FARM #1).
Fig. 15. Soil matric potential and volumetric water content values collected during one month with the NODE #2 deployed in the almonds crop (FARM #2).
ers. Note that, other general providers such as Google or Amazon only allows some general services to be used free of charge, but subject to the conditions of a system based on quotas; therefore, FIWARE is cheaper and offers more services.
4. Conclusions In this paper, a software architecture hosted in the FIWARE cloud has been presented. The designed software components allow worldwide agronomical information to be stored in a common data
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020
G Model AGWAT-4656; No. of Pages 13
ARTICLE IN PRESS J.A. López-Riquelme et al. / Agricultural Water Management xxx (2016) xxx–xxx
warehouse that saves normalized information from the agronomical point of view. Stakeholders and particularly agronomists can effortlessly analyse (by using an easy and usable user interface, see Fig. 8), the monitored information that allow them to take decisions about irrigation control and other crop management procedures. In fact, agronomists that works with Widhoc make useful reports for customers by using the valuable knowledge that the proposed system provides. Such reports are helping farmers to improve their productivity and to minimize the water consumption. Experiments have demonstrated that using the proposed system easily and transparently enables agronomical data registration, regardless of the used hardware architecture, since all the software modules (firmware, backend and frontend), are highly uncoupled. From both the hardware and software developer points of view, the system is easily scalable. The FIWARE cloud provides a suitable hosting site for the software architecture, whose modules are reusable and can be easily maintained, without the need of acquiring expensive computing hardware equipment. The virtual machines provided by FIWARE are easily to configure and the system is automatically scaled according to the application requirements. Moreover, the FIWARE cloud offers a set of interesting benefits for the agri-food sector, since it provides a collection of specific enablers that allow stakeholders to share agricultural information in a normalized, reliable and secure manner. In fact, the proposed software architecture will be properly extended by including features supplied by FISpace, in the context of Agriculture, with the purpose of integrating modules that make the business to business procedures easier. Acknowledgments The development of this work was supported by the Spanish Ministry of Science and Innovation through the projects cDrone (ref. TIN2013-45920-R) and RIDEFRUT (ref. AGL2013-49047-C2-1R). We would like to thank Widhoc Smart Solutions S.L. for letting us to use their facilities to carry out the tests. This article also is the result of the activity carried out under the “Research Programme for Groups of Scientific Excellence at Region of Murcia” of the Seneca Foundation (Agency for Science and Technology of the Region of Murcia). References Allen, R.G., Pereira, L.S., Raes, D., Smith, M., 1998. Crop evapotranspiration: guidelines for computing crop water requirements. In: Irrigation and Drainage Paper No. 56. Food and Agriculture Organization of the United Nations, Rome, Italy. Brewster, C., Wolfert, S., Sundmaeker, H., 2012. Identifying the ICT challenges of the agri-food sector to define the architectural requirements for a future
13
internet core platform. In: Proceedings of the eChallenges e-2012 Conference, Lisbon, October. Chibuzor, E., Lionel, S., 2006. Self organising wireless sensor networks as a land management tool in developing countries: a preliminary survey. In: Proceedings of the London Communications Symposium (LCS 2006), London September. Choudhary, S.K., Jadoun, R.S., Mandoriya, H.L., 2016. Role of cloud computing technology in agriculture fields. Comput. Eng. Intell. Syst. 7, 1–7. Cosmos GE. Description, 2016. Architecture of the BigData Analysis Generic Enabler (GE), https://forge.fiware.org/plugins/mediawiki/wiki/fiware/index. php/FIWARE.ArchitectureDescription.Data.BigData. Consultedon May 2016. De la Ros, J.M., Conesa, M.R., Domingo, R., Aguayo, E., Falagán, N., Pérez-Pastor, A., 2016. Combined effects of deficit irrigation and crop level on early nectarine trees. Agric. Water Manage. 170, 120–132, http://dx.doi.org/10.1016/j.agwat. 2016.01.012, ISSN 0378-3774. FIspace D200.1, 2013. FIspace Design and Release Plan WP200 Deliverable. Consulted on May 2016. Fiware Project, 2016. Core Platform for the Future Internet. Private Public Partnership Project (PPP), https://www.fiware.org. Consulted on May 2016. García Morillo, J., Martín, M., Camacho, E., Rodríguez Díaz, J.A., Montesinos, P., 2015. Toward precision irrigation for intensive strawberry cultivation. Agric. Water Manage. 151, 43–51, http://dx.doi.org/10.1016/j.agwat.2014.09.021. Granell, C., Havlik, D., Schade, S., Sabeur, Z., Delaney, C., Pielorz, J., Usländer, T., Mazzetti, P., Schleidt, K., Kobernus, M., Havlik, F., Rune Bodsberg, N., Berre, A., Mon, J.L., 2016. Future Internet technologies for environmental applications. Environ. Modell. Software 78, 1–15, http://dx.doi.org/10.1016/j.envsoft.2015. 12.015, ISSN 1364-8152. IDAE (Energy Diversification and Saving Institute, spanish Ministry of Industry, Tourism and Commerce), 2005. Ahorro y Eficiencia Energética en Agricultura de Regadío, Madrid. Kavis, M.J., 2014. Architecting the Cloud: Design Decisions for Cloud Computing Service Models (SaaS, PaaS, and IaaS). Wiley, ISBN-13 978-1118617618, ISBN-10 1118617614. López, J.A., Navarro, H., Soto, F., Pavón, N., Suardíaz, J., Torres, R., 2015. GAIA2: amultifunctional wireless device for enhancing crop management. Agric. Water Manage. 151, 75–86, http://dx.doi.org/10.1016/j.agwat.2014.10.023. Navarro-Hellín, H., Torres-Sánchez, R., Soto-Valles, F., Albaladejo-Pérez, C., López-Riquelme, J.A., Domingo-Miguel, R., 2015. A wireless sensors architecture for efficient irrigation water management. Agric. Water Manage. 151, 64–74, http://dx.doi.org/10.1016/j.agwat.2014.10.022. Oates, M.J., Vázquez de León, A.L., Intrigliolo, D.S., Molina Martínez, J.M., Ruiz-Canales, A., 2015. Evaluation of an experimental system of soil moisture registration for irrigation management in potted vineyard (Vitis vinifera L. CV Bobal) of multi-depth temperature compensation based in resistivity measurements. Agric. Water Manage. 151, 126–135, http://dx.doi.org/10.1016/ j.agwat.2014.10.029. Puerto, P., Domingo, R., Torres, R., Pérez-Pastor, A., García-Riquelme, M., 2013. Remote management of deficit irrigation in almond trees based on maximum daily trunk shrinkage. Water relations and yield. Agric. Water Manage. 126, 33–45. Sales, N., Remedios, O., Arsenio, A., 2013. Wireless sensor and actuator system for smart irrigation on the cloud. IEEE 2nd World Forum on Internet of Things (WF-IoT), 2015, 1–6. Voorsluys, W., Broberg, J., Buyya, R., 2011. In: Buyya, R., Broberg, J., Goscinski, A. (Eds.), Introduction to Cloud Computing, in Cloud Computing: Principles and Paradigms. John Wiley & Sons, Inc., Hoboken, NJ, USA, http://dx.doi.org/10. 1002/9780470940105, ch1. Vyas, D., Borole, A., Singh, S., 2016. Smart agriculture monitoring and data acquisition system. Int. Res. J. Eng. Technol. (IRJET) 03, 1823–1826. Zhang, N., Wang, M., Wang, N., 2002. Precision agriculture-a worldwide overview. Comput. Electron. Agric. 36, 113–132. Zhu, Y., Wu, D., Lil, S., 2013. Cloud computing and agricultural development of China: theory and practice. IJCSI Int. J. Comput. Sci. Issues 10, 7–12.
Please cite this article in press as: López-Riquelme, J.A., et al., A software architecture based on FIWARE cloud for Precision Agriculture. Agric. Water Manage. (2016), http://dx.doi.org/10.1016/j.agwat.2016.10.020