You are on page 1of 11

Computers and Electronics in Agriculture 158 (2019) 122–132

Contents lists available at ScienceDirect

Computers and Electronics in Agriculture


journal homepage: www.elsevier.com/locate/compag

Original papers

Continuous monitoring seed testing equipaments using internet of things T


a,⁎ a a
Rodrigo Santos de Souza , João Ladislau Barbará Lopes , Claudio Fernando Resin Geyer ,
Leonardo da Rosa Silveira Joãob, Anderson Afonso Cardozob, Adenauer Corrêa Yaminb,
Gizele Ingrid Gadottib, Jorge Luis Victoria Barbosac
a
Federal University of Rio Grande do Sul, PO Box 15064, Av. Bento Gonçalves, 9500, 91501-970 Porto Alegre, RS, Brazil
b
Federal University of Pelotas, R. Gomes Carneiro, 1, 96010-610 Pelotas, RS, Brazil
c
University of Vale do Rio dos Sinos, Av. Unisinos, 950, 93022-750 São Leopoldo, RS, Brazil

ARTICLE INFO ABSTRACT

Keywords: The lack of functional, calibrated equipment, along with using inconsistent testing method contribute to the
Seed analysis variable, unreliable results produced by seed laboratories. The objective of this article is present to presente the
Middleware development of an integrated system consisting of hardware, middleware, and application to continuously
Internet of things monitor and record the performance of seed testing equipment from the beginning to the completion of each test
Context awareness
in seed testing laboratories. The central element of the proposed system is the CoIoT middleware
(Context + IoT), which provides mechanisms for managing IoT devices and context awareness mechanisms to
monitor and record the equipment functions, throughout the seed testing processes. The developed system was
tested in the Official Seed Analysis Laboratory (OSTL) of the Brazilian Agricultural Research Corporation
(Embrapa). The proposed system was evaluated using the Technology Acceptance Model (TAM), which con-
siders aspects of ease of use and usefulness. To validate the results, a scale of 1 (user totally disagree) to 5 (user
totally agree) was used. For ease of use the average was of 4.7, and for usefulness, the average was of 4.4. The
results achieved are promising, which encourages the continuity of research to further optimize CoIoT.

1. Introduction perform the tests (Brasil, 2009).


To meet the high demand of seed testing, the Official Seed Testing
The main purpose of seed testing is to determine the quality of the Laboratory (OSTL) of Brazilian Agricultural Research Company
seed and its value for planting. A Seed Testing Laboratory (STL) eval- (Embrapa) has been established since 1960 to plan and supervise, co-
uated the end product of seed production systems including: planting, ordinate and control the activities related to the execut agricultural
harvesting, processing, treatment, storage. The central function of STL research and establish agricultural policies.1
is to standardize seed testing processes through the rules established by The research has developed by a consortium involving the Federal
the seed testing organizations. The results of seed testing are used to University of Pelotas, the Federal University of Rio Grande do Sul and
issue reports or certificates stating the quality of seeds tested. These Embrapa. This consortium is intended to develop Ubiquitous
reports are the bases for marketing, storage, distribution of seeds. Seed Computing solutions (Ubicomp), which explore solutions that con-
testing is also used in research and the identification of quality pro- tribute synergistically to agricultural research activities. In Ubicomp,
blems (Tillmann and Menezes, 2012). computational systems use different contextual variables collected from
To perform seed testing accurately and uniformly, laboratories must widely distributed environments (Knappmeyer et al., 2013). Recent
have appropriate equipment that is calibrated regularly and follows technological advances in the Internet of Things (IoT) have provided
uniform procedures. The Rules for Seed Testing (RAT) describe the the use of large-scale sensors as sources of contextual information for
uniform procedures that standardize the analyses to 19 obtain con- ubiquitous applications (Perera et al., 2014).
sistent, reliable results regardless of the analysts or the laboratories that Many of the challenges related to using the IoT device in obtaining

Corresponding author.

E-mail addresses: rssouza@inf.ufrgs.br (R. Santos de Souza), jlblopes@inf.com.br (J.L. Barbará Lopes), geyer@inf.com.br (C.F. Resin Geyer),
ldrsjoao@inf.ufpel.edu.br (L. da Rosa Silveira João), adenauer@inf.ufpel.edu.br (A. Corrêa Yamin), gizele.gadotti@ufpel.edu.br (G.I. Gadotti),
jbarbosa@unisinos.br (J.L. Victoria Barbosa).
1
https://www.embrapa.br/.

https://doi.org/10.1016/j.compag.2019.01.024
Received 22 August 2017; Received in revised form 3 September 2018; Accepted 20 January 2019
0168-1699/ © 2019 Elsevier B.V. All rights reserved.
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

contextual information associate with the difference between the ubi- designated, the lower temperature should maintain for 16 h and the
quitous high-level requirements of applications and the typical low- higher temperature for 8 h. Light must be illuminated for at least 8 h
level operational profile (Perera et al., 2014). Given the operational every 24-h cycle (Brasil, 2009; ISTA, 2016).
demands of OSTL, the objective of this research is to propose an in- The equipment must maintain a uniform temperature throughout
tegrated solution to context aware monitoring of seed testing labora- the chamber, i.e., each shelf must have the same temperature. Requires
tories, consisting of hardware, middleware, and application. The out- temperature monitoring at various points inside the chamber to detect a
come of the proposed technology is to monitor and record seed testing change in temperatures to guarantee the quality of the results provided.
equipment and operations in seed testing laboratories using the pro- With the implementation of the quality system in STL, daily logs of
posed middleware, called CoIoT (Context + IoT). The CoIoT provides temperature readings require in chambers or germinators. Many la-
the middleware support to ubiquitous applications and mechanisms for boratories still use paper spreadsheets that fill out manually. Other la-
managing the IoT devices. boratories have data loggers. Although the data collected can be stored
CoIoT is a middleware developed from EXEHDA (Execution digitally, automated data collection is rarely used, resulting in loss of
Environment for Highly Distributed Applications) (Lopes et al., 2014) data, in some cases, due to delay in its detection, which leads to ger-
that aggregates the treatment of sensor and actuator devices and uses minator problems and delays in seed sales. In turn can result in delay in
the infrastructure resources of the ubiquitous environment provided by sowing, reduced yield, profits.
EXEHDA. CoIoT is event-driven, managed by rules, with distributed The use of ubiquitous technology enables monitoring germination
processing of the context. It acts proactively both in the acquisition of equipment 24 h a day, 7 d a week, without human interference. The use
contextual information from the physical environment and in remote of context processing rules makes it possible to evaluate the data col-
action on the environment. EXEHDA, in turn, provides a software ar- lected, triggering notifications or actions, such as sending e-mail, text
chitecture that aims to create and manage a ubiquitous environment, as messages, and/or activating lights.
well as promote the execution of ubiquitous applications under this Researchers, research support personnel, students in postgraduate
environment. classes, and training courses often use OSTL facilities for seed testing
Many authors have been addressing context awareness in the per- activities. Therefore, the generation of notifications must be persona-
spective of IoT (LogMeIn, 2017; by Altair, 2017; Kostelník et al., 2011; lized and directed to the user who is using the equipment.
Pires et al., 2014), but the support offered to IoT application develop-
ment usually is limited. The context awareness mechanisms of these 2.2. CoIoT: a middleware to IoT
projects do not provide support to collecting and processing of context
in a distributed way, through rules, as well as for acting in the en- CoIoT is a middleware that has different IOT devices, such as sen-
vironment. The differential of the CoIoT is the distributed processing of sors and heterogeneous actuators. In the CoIoT technology, the com-
the contextual information in which part of the processing takes place putational environment consists of cells in which the computational
near the edge of the environment, i.e., near the place where the in- devices distribute as shown in Fig. 1.
formation is produced. This approach enables reducing the volume of The primary components of this environment are:
data sent over the network, as well as the reliance on communication
infrastructures provided by third parties in handling critical events. In • EXEHDAbase the central element of the cell responsible for all es-
addition, the context processing in CoIoT occurs through ECA (Event- sential services and reference to the other elements;
Condition-Action) rules that are triggered by environmental incidents. • EXEHDAnode that corresponds to the computational devices in-
The strategy based on events adopted in the design of the architecture volved in the execution of the applications;
occurs both in the collection of the sensed information of the en- • mobile EXEHDAnode, a sub-case of the former, which corresponds
vironment as in its processing. This method allows the processing of to typically mobile devices that can move between cells in the
contextual information at the time of its occurrence. ubiquitous environment, such as notebooks, tablets or smartphones;
The CoIoT context awareness mechanisms allow the acquisition and • EXEHDAedge that consists of the edge element of the ubiquitous
recording of OSTL equipment states throughout the procedures of seed environment, responsible for interoperating between the different
testing. After a processing step to identify critical situations are gen- middleware modules and the IoT devices; and
erated notifications to the users and actions are triggered when neces- • EXEHDAgateway that manages the inherent heterogeneous tech-
sary. nological systems of sensors and actuators.
This study is structured as follows: Section 2, details the material
and methods, highlights research challenges, describes CoIoT features. The proposed context-handling approach for CoIoT has its func-
Section 3, outlines the application developed for seed testing labora- tionality distributed between two types of servers: Context Server and
tories. Section 4, presents the prototipation and evaluation of the pro- Edge Server. The Edge Server is designed to act primarily on managing
posed technology. Finally, Section 5, concluding remarks. interactions with the physical environment, such as reading of tem-
perature, humidity, light or triggering an alarm. In turn, the Context
2. Material and methods Server operates in the storage and processing of contextual information,
i.e., in interpretation of sensors data (Lopes et al., 2014).
2.1. Challenges in controlling seed testing environments The proposed architecture for CoIoT, presented in Fig. 2, allows
managing the collection and processing of contextual information as
Seed testing procedures require accurate equipment. In the case of well as the performance of the computational environment.
germination tests, the process is carried out in BOD (Biochemical Context processing in CoIoT occurs in a distributed way between
Oxygen Demand), a germination chamber that creates a controlled Edge and Context Servers. The Rule Engine module is the first level of
environment according to the Rules for Seed Testing (Brasil, 2009). The processing, while the Context Processor (Context Server) is the second
main parameters that must manage are temperature, humidity, and level. The rules submitted to the Rule Engine must be elaborated to
light. attend, as a priority, the critical events. The treatment of the critical
All species require that temperature and humidity remain within events must be carried out in the shortest possible time and with
specific limits, while some species require temperature and lighting minimum failures. Because the Edge Server is generally allocated
alternation. Regardless of the testing requirements, temperature var- physically close to the monitored environment, allowing an action
iation should not be greater than 2 °C in each 24 h period according to (alerts, activation/deactivation of electromechanical equipment, etc.)
the Brazilian Seed testing rules. When alternating temperatures are regardless of any loss of communication with the Context Server caused

123
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

Fig. 1. Cellular Organization of the Ubiquitous Environment.

by a network failure. an action triggered by a rule. This strategy was adopted to simplify the
On the other hand, rules that need to include the handling of his- implementation of time windows allowing rules to active, deactivate or
torical information, access data collected from other Edge Servers, or change these time window specifications dynamically (Cardozo et al.,
that involve other context processing models, must be processed in the 2016).
Context Server. Both of the context processing modules were designed Although the ECA model is the core mechanism of contextual
based on the ECA (Event-Condition-Action) type model of rules treatment used, both the condition treated and the action to be per-
(Terfloth, 2009), which are triggered by environmental events. In the formed by the rule admit other processing models that can be invoked
Internet of Things, environmental events occur when there is an im- by the rule, which is due to the type of domain application to be served
portant change in some context of interest, for example, a temperature by CoIoT.
reaching a particular value or the identification of a user’s input in a The Context Repository module uses a relational model for the
room, etc. The management system must intercept these events and, representation of contextual information, which provides a historical
through the applications, notify the operators, so that they can fix the record of this data. The structure of the Context Repository reflects the
problem (Perera et al., 2014). architectural organization of the EXEHDA Middleware, thus con-
CoIoT provides support for both simple events and compound templating the relationship between applications, components, sensors,
events. A simple event refers to an instantaneous, atomic occurrence of environments and contexts of interest. Also, the repository module
an event of interest at a given instant of time. Meanwhile, a compound stores the architecture configuration data and publications of existing
event consists of the combination of simple events occurring in a par- sensors in the ubiquitous environment. These data used by the Context
ticular time interval (Terfloth, 2009). processor module to trigger the appropriate actions depending on the
The event handling model proposed for CoIoT considers a set of contextual information.
simple events generated from the architecture because of: (i) changes of Given the inherently distributed characteristic of ubiquitous appli-
state of the contexts of interest collected through sensors; (ii) temporal cations, Interoperation Modules of CoIoT have been designed to
occurrence; (iii) activation/deactivation of actuators; and (iv) changes promote interoperability between the Edge Servers and Context Server,
in the infrastructure of the computational environment. CoIoT provides as well as with other middleware services. The design of this module
the support for compound events through the processing of rules, where based on the REST architectural style (Fielding, 2000).
a treated condition for an event may have a “true” or “false” outcome The Notifier Module has the function of generating notifications
allowing the combination of these events to perform more complex from the context processing results carried out by the Context
processing. Processor. This module uses a reporting strategy based on the model
The structure of the rules designed for CoIoT have the following publisher/subscriber, which receives subscriptions for all services or
elements: applications that require notifications regarding changes in the states of
context (Tanenbaum and Steen, 2007).
• Rule Name: it identifies the rule and compound event produced All the settings necessary for the operation of CoIoT managed
when processing the rule; through a web interface provided by the Configurator Module. Some
• Group: group to which the rule belongs; of the features offered are: the configuration of sensors and actuators
• Event: event that triggers the rule, which can be simple or com- (adding, removing and changing), the management of device drivers,
pound; management of contextual processing rules, the configuration of access
• Condition: logical operation to be treated; and to Context Server and Edge Server, Gateways management, among
• Action: action executed every time the condition is true. others.
The Publisher Module has the function of firing the requests of
Rules in CoIoT can organize into groups which may be active or sending contextual information to the other layers of the middleware,
inactive for processing. A control group can be enabled or disabled from interoperating with Context Server via Interoperation Module. The

124
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

Fig. 2. CoIot architecture.

publications organized in a FIFO (first in, first out) system and are Scheduler modules. These modules are designed to handle the two main
processed according to network availability. Considering the possible types of acquisition events to be dealt with in IoT: time events and
miscommunications between the Edge Server and the Context Server as environmental events (Perera et al., 2014). The Trigger Module
well as any network delays, it has been designed a Local Persistence manages environment events. This module has been incorporated into
Module for Edge Servers whose function is to perform temporary sto- the gateways so that state changes of the contextual variables can be
rage queue of contextual information until these propagated to the monitored locally, thus reducing data traffic on the network. The
context server. Scheduler Module manages temporal events. This module is located
With the purpose of ensuring interoperability with market tech- on the Edge Server to deal with the temporal control in the architecture
nologies, and also enhance the distribution of gathering initiatives and/ at the time of the reading events, thus improving the CoIoT response
or acting, two types of gateways were used: (i) Proprietary Gateway, activity. Because the Edge Server runs in EXEHDAedge, the hardware
which has heterogeneous features varying according to its manu- requirements of the device selected for this purpose ensure greater re-
facturers; and (ii) Native Gateway, whose features are integrated into liability in controlling over time events than the EXEHDAgateway.
the CoIoT architecture. The Virtual Gateway module acts as virtua- The Communication Module and Resource Manager have been de-
lization of the Native Gateways and implements two basic types of signed to manage aspects associated with communication between the
modules: Drivers and Triggers. Drivers are architectural modules re- gateways and the Edge Server. The Communication Module controls
sponsible for the access to the real values captured by the sensors, as the communications via REST API as the Resources Manager provides
well as the execution of commands sent to the actuators. Drivers en- a discovery engine that handles the connection and disconnection of
capsulate and control the sensors and actuators in an individualized devices on the network, regular occurrences of IoT.
manner, preventing operational differences of these devices to propa- The Collector Module has the function of directing the gathering
gate to other components of the architecture. The sensor reading based requests to the respective gateways in agreement with instructions from
on events being managed by the architecture through the Trigger and the Rules Engine, Context Server, or applications. Supervisor module

125
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

Fig. 3. Temporal Windows - DT: Daytime temperature; NT: Nighttime Temperature; DTW: Daytime transition window; WD: daytime temporal window; NTW:
nighttime transition window; NW: Nighttime temporal window.

Table 1
Context processing rules of Edge Server to seed testing.
Rule name Group Event Condition Action

Published the temperature Default 30 min interval Condition is always true Publishes the temperature
Night temperature out of range NW Temperatute is readed Temperature < NT − 2 OU Send alert to usuer
Temperature > NT + 2 Action the BOD light
Action the center light
Change NW window NW Light is readed Light = = on Active the DTW group
Desactive the NW group
Publish the light
DTW window time exceeded DTW Temperature is readed Time of DTW window>30 Publish alert of user
Action the BOD ligth
Action the center ligth
Change N window DTW Temperature is readed Temperature > DT Activate WD group
Desativate DTW group
Day temperature out of range WD Temperature is readed Temperature < DT − 2 OU Send alert to user
Temperature > DT + 2 Action BOD light
Action central light
Change NW window WD Light is readed Light = = off Activate NTW group
Desactivate WD group
Publish light state
NTW window time exceeded NTW Temperature is readed Time NTW window > 30 Send alert to user
Action BOD light
Action center light
Change NTW window NTW Temperature is readed Temperature > NT Activate WD group
Desactive DTW group

brings together the actuation commands, receiving the control para- each laboratory’s BODs, generate notifications and a historical log. The
meters and resolving any conflicts between the requests from different temperature is collected and compared to the day and night standards
sources. The Actuator module has a similar function to the Collector specified in the testing rules for the seed evaluated. Notifications gen-
Module, receiving the actuation commands and the operating para- erated to the users according to specified preferences (i.e., whenever
meters (length, activation energy, etc.) and forwarding to the appro- the temperature varies by more than 2 °C). Notifications also generated
priate gateways for further processing. when the transition time between day and night temperatures exceeds
the 30-min limit and when the light not activated in the period corre-
3. SALApp: an application for Seed Analysis Laboratories sponding to the day or deactivated before the expected 16 h have
elapsed.
Considering the high sharing of the OSTL infrastructure among the The middleware support for the scenario considers the scheduling
users and the operational needs of it, the Context awareness approach settings of sensor readings at regular intervals and a set of context
designed for the laboratory contemplates contextual information of two processing rules. Users can adjust both according to operational needs
natures: (i) context of the environment and, (ii) context of the Users. through the SALApp application interface.
The context of the environment includes all the physical information The context processing rules used were organized between the Edge
sensed by the internal environment of the laboratory and its equipment, and Context Servers to meet the proposed scenario. The criteria em-
such as temperature and humidity. The user context, in turn, consists of ployed in the distribution of the rules were: (i) minimization of data
the specifications made by the user which stored in his profile, such as flow and (ii) continuity of monitoring even at times of loss of com-
address, telephone number and e-mail. munication between servers.
The OSTL operating scenario discussed in this paper presented in In the Edge Server, the rules used in the scenario organized into
Fig. 3 and involves monitoring the temperature and internal lighting of groups, which control each of the time windows present in the scenario

126
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

Table 2
Context processing rules of Context Server to seed testing.
Rule name Group Event Condition Action

Persist the temperature Default Temperature is published Condition is always true Persist the temperature in Context Repository
Persist the light Default Light is publish Condition is always true Persiste the light in Context Repository
Alert the user Default User alert is published Condition is always true Send alert to user

(Fig. 3). These groups activated through rules triggered by events able to have a different access level to the menus according to the
produced by the environment. At each time window change, a rule permission granted. These menus allow access to the various func-
group activated while the other groups are disabled. The daytime tionalities offered by SALApp and presented in Fig. 4.
transition window (DTW) and the nighttime transition window (NTW) The functionalities offered by the Management Module include the
activated when the light is turned on and off, respectively. Whereas, the manipulation of context processing rules, scheduling, and sensor
day temporal (WD) and night temporal (NW) windows indicate when reading triggers, as well as the configuration of access to the acquisition
the set temperatures reached. The rules used in the scenario are pre- and actuation devices, such as Edge Servers, Gateways, sensors, and
sented in Tables 1 and 2. actuators. These functions are made available through application in-
Given the premise that information must be accessible regardless of terfaces, some of which presented in Figs. 5 and 6.
the computational device used, the technologies employed in IoT ap- The management of the acquisition and/or actuation devices,
plications must have resources that allow self-adaptation when changes adding or removing a device, can be performed either automatically, in
occur in the execution environment. In the development of SALApp the case of devices that support the UPnP (Universal Plug and Play)
responsive technologies were used in its layout. The layout is said to be protocol, or manually. The automatic registration is only allowed once
responsive when it adapts to the size of the device without impairing its approved by an authorized user, avoiding the registration of un-
functionality. Therefore, the application can be accessed in the same recognized devices.
way, as much by desktops and notebooks as by tablets and/or smart- The SALApp application includes in its Management Module func-
phones. SALApp is also responsible for creating an intuitive interface so tions, such as user registration, manufacturers, OSTL equipment man-
that the user can manage the resources available in an easy way. agement, and the scheduling of equipment to users to enable shared
The application developer has two main modules that contemplate use. The scheduling management interface has control buttons common
the modes of operation, the Management Module, and the Visualization to the other interfaces, and an exclusive button. This button has the
Module. function of graphically displaying the history of the contextual in-
The Management Module allows the management of the various formation of the equipment during the scheduling period, which
laboratory. These resources can be of administrative, such as the profile usually corresponds to the time window of an experiment (see Fig. 7).
of the users and the scheduling of the equipment for users, or these The user, once registered, assumes a standard profile that can
resources can be of the context treatment, such as data collection change later. A key aspect of user profile settings is setting notification
(sensing), its processing and actuation on the environment. This module preferences. This configuration reflects the behavior of the CoIoT con-
developed with the principle of support at different levels of access text processing rules depending on personal preferences.
according to the user’s profile.
The Visualization Module provides several visualization tools that 3.2. Visualization module
allow access to the history of contextual information in different ways.
SALApp is a valuable tool in evaluating the behavior of the physical The Visualization Module of the SALApp application allows the
variables involved in the testing processes. selection of the context of interest to be displayed, which can be pre-
sented in the form of a textual report (Fig. 8) or through a graphic style
3.1. Management module (Fig. 9). Through this module, the OSTL researcher can visually check
the physical quantities that monitored in the BOD during the periods of
The Management Module of the SALApp application enables the the test, which directly influence the results of seed germination.
management of the OSTL infrastructure regarding the middleware The developed graphical report allows visualizing the values of
support provided by CoIoT which involves acquisition, actuation, different tests in OSTL. The selection of the sensors to be displayed
context processing, and notification. SALApp also contemplates the made from a menu with multiple selection support. Also, an inspection
management of aspects of the evaluated scenario, which are char- feature is available that allows the comparison of the values at a certain
acteristics of the operational profile of the laboratory. point in time. The user can define the time window of the data viewed
Access to the Management Module is through login, each user being through the graphical interface that displays the sensed values.

Fig. 4. Acesso Interface to features offered through SALApp.

127
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

Fig. 5. Configuration Interface of Edge Server.

Fig. 6. Configuration Interface of Sensors.

4. Prototipation and evaluation implemented in the Python language aimed at building Web applica-
tions which simplify the development of REST APIs. Using Django, re-
This section presents the prototyping of CoIoT middleware, high- sources have been implemented, accessible through URIs, for the ma-
lighting the technology and hardware employed, and the evaluation of nipulation of several elements that make up the CoIoT architecture,
this solution through the Technology Acceptance Model. such as gateways, sensors, actuators, rules, among others. Also, all
operations performed on the Context Repository done through the REST
4.1. Prototipation API. Access to resources made available by the API is accessible via a
user and password authentication. The data transmitted to and by the
In developing the prototyping of the CoIoT architecture, several REST API is standardized in a JSON format. The specification of the
technological tools were used, based on the Python language. The use of main features implemented as well as the access URIs are presented in
Phyton has been particularly helpful in the prototyping stage by sim- Tables 3 and 4. Fig. 10 presents the example of a GET request made in
plifying code adjustments during the early phases of architecture im- curl for collecting sensor identified as “ TemperatureBOD1 ” and its
plementation and its startup in OSTL. structured response in JSON.
The Interoperation and Communication Modules were implemented The Context Processor modules from both the Edge Server and the
using Django.2 Django is an MVC (Model-view-controller) framework Context Server were implemented from the Business Rules tool.3

2 3
https://www.djangoproject.com. https://github.com/venmo/business-rules.

128
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

Fig. 7. Scheduling Management Interface.

Fig. 8. Visualizations interface of textual report.

Business-Rules is an ECA rule engine, developed in Python, whose rules Python language aimed at building applications that need to schedule
structured in a JSON format. The use of JSON is pertinent in this case the execution of tasks. Scheduled tasks can be run only once or peri-
because it simplifies the construction and distribution of the rules odically and can be added or removed dynamically.
through the distributed components of the CoIoT architecture since this According to the rules established for OSTL operation, the sensed
is the standard format adopted in structuring the data sent through the data are processed in a distributed manner and published periodically
REST API. The Context Repository, managed by the Context Server, was in the Context Server for storage for later use. The processing performed
implemented in a relational database and using the PostgreSQL man- by the CoIoT architecture takes place independently of the applications
ager. and remains operational even when these applications are not running.
The Scheduler module implemented through the APScheduler Fig. 11 shows the distribution of the CoIoT architecture among the
(Advanced Python Scheduler)4 to control the reading of the sensors devices used in OSTL, with emphasis on Edge and Context Servers,
through time events. APScheduler consists of a tool implemented in the gateways, actuators, and the different type of sensors.
The hardware used for hosting the Context Server was a desktop
with Intel Pentium E2160-1.8 GHz dual-core processor, with 3 Gb of
4
https://apscheduler.readthedocs.io/. RAM and with the Ubuntu Server Operating System. For the Edge

129
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

Fig. 9. Visualizations interface of Graphical report.

Table 3 disseminated software platform. The criterion of using a disseminated


Resources of the API REST for managing sensors and actuators. software platform was to be able to support the greatest possible
URI Action Description number of sensing and actuation technologies.
After reviewing the literature, the NodeMCU6 microcomputer was
/sensor or/actuator GET Returns a set of sensors or actuators with chosen. NodeMCU is an open source platform for IoT device develop-
all their information
ment based on the ESP82667 processor (Fig. 12(B)).
/sensor or/actuator POST Registers a new sensor or actuator
/sensor/id or/actuator/id GET Returns a sensor or actuator with all their
The sensors selected for the prototype OSTL based on 1-Wire tech-
information nologye8 which characterized as a data transmission network. It is
/sensor/id or/actuator/id PUT Alters sensor or actuator configuration based on addressable electronic devices and stands out for its versatility
/sensor/id or/actuator/id DELETE Removes a sensor or actuator and ease of implementation. The temperature sensors used can be seen
/sensor/read/{id} or GET Returns a sensor or actuator value
in Fig. 12(D). This sensor is wrapped in an aluminum casing to give
/actuator/read/{id}
/actuator/write/{id} PUT Sends an actuation request greater mechanical strength and to insulate from moisture. To exploit
the reactive feature of the architecture, actuators (light alert) were also
used based on 1-Wire technology. These actuators are triggered when
the attention of laboratory workers needed with some equipment.
Table 4
Resources of the API REST for managing the publication queue.
4.2. Evaluation
URI Action Description

/publication GET Returns queue of unprocessed publications


This section presents an evaluation of the technology developed and
/publication POST Registers a new publication containing one or the results obtained from the study that conducted.
more sensors The evaluation involved OSTL volunteer users. Four types of re-
/publication/ DELETE Clears the publication queue search, five students, and one technician participated in the study. Each
/publication/{id} DELETE Removes a publication
participant used a mobile device and a desktop. We performed basic
training on the application operation beforehand. Participants were
asked to respond to a questionnaire to evaluate their experience of
using the system.
Server, the Raspberry PI model B5 (Fig. 12(C)) with Raspbian Operating
The answers ranged from 1 point (totally disagree, negative ex-
System used. Raspberry Pi is a computer developed by the University of
perience) to 5 points (totally agree, positive experience). To evaluate
Cambridge Computing Laboratory that is small, reasonably priced,
the model acceptability, checking the system usability, the questions
energy efficient, user-friendly, and hevea very active user community
were defined based on the Technology Acceptance Model (TAM) (Yoon
that based on the principles of free software. All of these aspects were
and Kim, 2007). The TAM model considers the following main themes
instrumental in selecting Raspberry Pi as the Edge Server. Also, Rasp-
for application acceptance: (i) Ease of use (user-friendly), and (ii)
berry Pi provides enough processing power allowing the handling of
Usefulness: Does the new technology improve accuracy and precision of
complex rules, management, and communication with different proto-
seed testing?.
cols and sensing devices.
Tables 5 and 6 contain the questions or statements included in the
Gateways, represent IoT devices with reduced computing power
questionnaire, the responses of the participants, and the average score.
when compared to Edge Server, which introduces challenges when it
The questions/statements were simple, short and direct to the point.
designed. The following aspects considered when selecting the Native
Both tables present the questions/statements in the first column and
Gateway hardware (Fig. 12(A)): (i) low power consumption, (ii) the
possibility of wireless operation (Wi-Fi) and (iii) the use of a
6
http://nodemcu.com/.
7
https://espressif.com/.
5 8
http://www.raspberrypi.org. http://www.maximintegrated.com.

130
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

Fig. 10. Example of using the REST API in requesting the value of a sensor.

Fig. 11. OSTL hardware allocation.

Fig. 12. Devices: (A) Native Gateway; (B) NodeMCU; (C) Raspberry PI; (D) Temperature Sensor DS18B20.

131
R. Santos de Souza et al. Computers and Electronics in Agriculture 158 (2019) 122–132

Table 5
Ease of use evaluation.
Question Totally disagree Partially disagree Neutral Partially agree Totally agree Average

1. The user interface is easy to understand. 0.0%(0) 0.0%(0) 0.0%(0) 40.0%(4) 60.0%(6) 4.6
2. The user interface is easy to use. 0.0%(0) 0.0%(0) 0.0%(0) 30.0%(3) 70.0%(7) 4.7
3. The option are clear and objectives 0.0%(0) 0.0%(0) 10.0%(1) 20.0%(2) 70.0%(7) 4.6
4. With little effort I can select a context of interest. 0.0%(0) 0.0%(0) 0.0%(0) 20.0%(2) 80.0%(8) 4.8
5. The user interface is properly adapted to the devices. 0.0%(0) 0.0%(0) 0.0%(0) 30.0%(3) 70.0%(7) 4.7

Table 6
Usefulness evaluation.
Question Totally disagree Partially disagree Neutral Partially agree Totally agree Average

1. The options presented are relevant. 0.0%(0) 0.0%(0) 0.0%(0) 30.0%(3) 70.0%(7) 4.7
2. The solution makes it easy to obtain contextual data from multiple sensors. 0.0%(0) 0.0%(0) 0.0%(0) 40.0%(4) 60.0%(6) 4.6
3. The solution facilitates immediate action from the issuance of an alert or message. 0.0%(0) 0.0%(0) 30.0%(3) 30.0%(3) 40.0%(4) 4.1
4. I would use this solution in my work? 0.0%(0) 0.0%(0) 30.0%(3) 20.0%(2) 50.0%(5) 4.2

the answers in columns 2–6. The last column shows the average score of Appendix A. Supplementary material
all participants.
The answers of the participants showed that the approval rate was Supplementary data associated with this article can be found, in the
generally high for both the ease of use and the usefulness of the system. online version, at https://doi.org/10.1016/j.compag.2019.01.024.
However, there was some “indifferent” response in the usefulness ca-
tegory. Interpreted as a concern for the quality control of experiments References
developed in OSTL, which depends on the use of autonomic mechan-
isms, without human intervention for issuing alerts and quick response. by Altair, C., 2017. Carriots. < https://www.carriots.com/ > . (Retrieved May, 2017).
In this case, a strategy that can be adopted automation technologies in Brasil, 2009. Regras para análise de sementes. Ministério da Agricultura, Pecuária e
Abastecimento. Secretaria de Defesa Agropecuária, Brasília.
seed testing and intensify the validation and improvement of new sys- Cardozo, A., Yamin, A., Souza, R., Davet, P., Lopes, J., Geyer, C., 2016. Sensing and
tems. actuation in iot: an autonomous rule based approach. In: 13th IEEE International
Conference on Mobile Ad Hoc and Sensor Systems (MASS). IEEE, pp. 355–360.
Fielding, R.T., 2000. Architectural Styles and the Design of Network-based Software
Architectures. Ph.D. thesis. University of California, Irvine.
5. Conclusion
ISTA, 2016. Seed Testing International. < http://www.seedtest.org/en/seed-testing-
international-_content-1-1085.html > . (Retrieved March, 2016).
This article presents integrated hardware and software automated Knappmeyer, M., Kiani, S.L., Reetz, E.S., Baker, N., Tonjes, R., 2013. Survey of Context
system designed to use in continuous monitoring and recording op- Provisioning Middleware. IEEE Commun. Surveys Ttorials 15, 1492–1519. https://
doi.org/10.1109/SURV.2013.010413.00207.
erations in seed testing laboratories. The CoIoT is an architecture de- Kostelník, P., Sarnovský, M., Furdík, K., 2011. The semantic middleware for networked
veloped for the context awareness treatment of the devices in the embedded systems applied in the internet of things and services domain. Scalable
Internet of Things. The CoIoT offers middleware support to the SALApp Comput. 12, 307–315. https://doi.org/10.12694/scpe.v12i3.726.
LogMeIn, I., 2017. Xively. < https://xively.com/ > . (Retrieved February, 2017).
application developed for seed testing laboratories. Lopes, J., Souza, R., Geyer, C., Costa, C., Barbosa, J., Pernas, A., Yamin, A., 2014. A
CoIoT extends the EXEHDA Middleware with the potential to be middleware architecture for dynamic adaptation in ubiquitous computing. J. Univ.
used in context-aware applications of various natures in the perspective Comput. Sci. 20, 1327–1351. https://doi.org/10.3217/jucs-020-09-1327.
Perera, C., Zaslavsky, A., Christen, P., Georgakopoulos, D., 2014. Context aware com-
of IoT. The proposed CoIoT architecture is event-driven, rule-based, and puting for the internet of things: a survey. IEEE Commun. Surveys Tutorials 16,
manages the acquisition and processing of contextual information as 414–454. https://doi.org/10.1109/SURV.2013.042313.00197.. arXiv:1305.0982.
well as performance in the distributed physical environment. Pires, P.F., Cavalcante, E., Barros, T., Delicato, F.C., Batista, T., Costa, B., 2014. A plat-
form for integrating physical devices in the internet of things. In: 2014 12th IEEE
To evaluate the developed system used the model TAM that eval- International Conference on Embedded and Ubiquitous Computing, pp. 234–241.
uates the experiences of users regarding ease of use and usefulness. For https://doi.org/10.1109/EUC.2014.42.
ease of use the average was of 4.7, and for usefulness the average was of Tanenbaum, A.S., Steen, M.V., 2007. Distributed Systems: Principles and Paradigms, 2nd
ed. Prentice Hall.
4.4. The analysis of these results showed that the users approved the
Terfloth, K., 2009. A Rule-Based Programming Model for Wireless Sensor Networks.
system in the evaluated aspects. Ph.D. thesis. Freie Universität Berlin.
Future research should include: (i) monitoring other laboratory Tillmann, M.A.A., Menezes, N.L., 2012. Análise de Sementes. In: Sementes: Fundamentos
equipment and incorporate other types of sensors and actuators; and (ii) científicos e tecnológicos. Ed. Universitária/UFPel, Pelotas, pp. 138–198 (chapter 3).
Yoon, C., Kim, S., 2007. Convenience and TAM in a ubiquitous computing environment:
expand the use of CoIoT and SALApp in Embrapa covering other re- the case of wireless LAN. Electron. Commer. Res. Appl. 6, 102–112. https://doi.org/
search environments. 10.1016/j.elerap.2006.06.009.

132

You might also like