<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>SpaceSheep: Satellite-aided E-shepherd System</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Raquel Rainho</string-name>
          <email>raquel.a.rainho@ua.pt</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Daniel Corujo</string-name>
          <email>dcorujo@ua.pt</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Pedro Gonçalves</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="editor">
          <string-name>Smart-agriculture, Internet-of-Things, Sensors, Satellite</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Instituto de Telecomunicações and Universidade de Aveiro</institution>
          ,
          <addr-line>Aveiro</addr-line>
          ,
          <country country="PT">Portugal</country>
        </aff>
      </contrib-group>
      <fpage>298</fpage>
      <lpage>303</lpage>
      <abstract>
        <p>The use of electronic means to help with tasks such as pastoralism is a way of intelligently optimizing the activity. As any autonomous system, it requires human intervention in case of failure, and therefore it needs an autonomous mechanism that draws the attention of the human operator whenever the system or the animals evolve to undesired conditions. The present work progresses an existing alarm system, used in the SheepIT gateway, which can monitor the behavior of animals and equipment, warning human supervisors of the occurrence of unwanted events and the need for intervention. Concretely, given the lack of coverage of Internet access in rural areas, the system was integrated with a satellite interface to guarantee communication and the timely delivery of alarm messages. The paper compares the overall networking performance of the satellite link, against a Wi-Fi laboratorial baseline.</p>
      </abstract>
      <kwd-group>
        <kwd>Keywords1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>The use of ICT Technologies for supporting livestock activities is a strategy that aims to increase
productivity and reduce their environmental impact. By allowing tasks to become automated, the cost
of labor and, consequently, of the final products, is reduced.</p>
      <p>
        As part of the SheepIT project [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], an autonomous system
was developed for the postural
conditioning of ovines used for grazing within a vineyard, without threatening the vines or the grapes.
Using smart collars and beacons, posture data was collected, and actuators allowed for conditioning
measures. Despite being automated, the system requires human supervision to guarantee animal and
crop safety: animals are often attacked and abducted, systems fail or lack maintenance, and often animal
behavior requires supervisory action.
      </p>
      <p>
        Tests under the scope of SheepIT [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] demonstrated the importance of liberating the shepherd, both
because the task of guarding animals implies enormous loneliness that renders the profession
unattractive, and because it allows the person to be involved in other agricultural tasks related to the
treatment of the vines, thus, reducing labor cost.
      </p>
      <p>
        To free the shepherd and allow him to carry out remote supervision, an application for monitoring
animals and equipment was developed, integrated with the SheepIT gateway. The application monitors
communications from the system's collars and the beacons, [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] sending alarms whenever supervision is
needed.
      </p>
      <p>The proper operation of an alarm system depends on fast communication so that it is possible to
trigger the necessary corrective measures, which in rural areas is not very easy due to the lack of radio
coverage of WLAN technologies, and sometimes even mobile networks. Presently, several technologies
for extended coverage or Machine-to-Machine (M2M) characteristics exist and are deployed, such as
NB-IoT, Sigfox, and others. However, such solutions are mostly deployed in or close to urban centers,
leaving rural areas with large coverage gaps or without access to all the characteristics needed by M2M</p>
      <p>
        2022 Copyright for this paper by its authors.
scenarios [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. As a way of mitigating the lack of coverage, while providing a performance link, the
system documented in this paper was extended with a satellite communications interface, increasing
the alarm generation capability.
      </p>
      <p>The paper continues in Section 2 with the description of the implemented system, followed by
Section 3 which evaluates its performance in terms of latency of communications and bandwidth
consumed. Section 4 concludes the paper and points out future work.</p>
    </sec>
    <sec id="sec-2">
      <title>2. The Architecture of the Electronic Sheepshead</title>
      <p>
        SheepIT was originally built providing a posture control mechanism that prevents the sheep from
eating the vine leaves and grapes, allowing them to be used for animal-based weeding. The mechanism
was implemented in a collar carried by the animals and integrated in a wireless sensors network (WSN)
that simultaneously monitors the behavior of the animals [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ] and localizes them [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The WSN includes
a set of fixed nodes, and a gateway that aggregates and filters the information, performs the localization
of animals within the infrastructure, and interconnects the WSN with a cloud-based alarm generation
system.
      </p>
      <p>
        While grazing, the animals are tempted to also eat the vine leaves located at a higher height, which
are important for the vineyard. The system, thus, monitors the height at which the animals are eating
leaves, checking for a configured threshold value. Once this maximum height is violated, the system is
activated, and it starts the conditioning process. The analysis over time of the animal behavior [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] shows
that the animal keeps trying to exceed the maximum height, and that the collar is the defense of plants
against animal attack.
      </p>
      <p>
        SheepIT’s main use case consists of animal grazing in Adriano Ramos Pinto vineyards, in the Douro
region, where the relief is especially rugged [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ], and where cellular communications have irregular
coverage, hindering communications between the WSN and cloud infrastructure, impairing the dispatch
of alarm messages. SheepIT infrastructure was built in order to monitor animal behavior, to transfer the
monitoring data to a system stored in the cloud, allowing for long-term data analysis via the web,
assisting in the determination of trends, or even prediction of behavior.
      </p>
      <p>The gateway integration (whose internal architecture is illustrated in Figure 1) with the cloud,
required that two tasks were carried out: first, optimizing the encoding of animal monitoring messages
in order to reduce the signallling volume and, second, integrating the satellite communications interface
for sending alarm messages.</p>
      <p>
        The communication between the gateway and the cloud application was initially implemented
through a RabbitMQ [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] producer API with the information encoded in JSON. To evaluate the best
solution for highly available and fault-tolerant message processing capability, we tested three different
information encoding APIs, namely Apache AVRO [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ], MessagePack [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and Protocol Buffers [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ].
      </p>
      <p>For our experimental network setup we used the EchoStar Mobile satellite network and the Hughes
4200 portable data terminal. The Hughes 4200 acts as a concentrator in the field to which the edge
computing device (collecting data from the SheepIT sensors) is connected to upload data in the SheepIT
cloud service. The use of satellite connectivity enables deployment of SheepIT technology in rural and
remote unconnected areas and guarantees 24/7 smart monitoring.</p>
      <p>The alarm system was implemented in the SheepIT gateway and it monitors the periodic
communications forwarded by fixed WSN beacons, reporting the data sensed by the collars. Those
periodic communications allow the detection of various events of interest related to animal behavior
and health, as well as other events that require prompt intervention by the herd supervisor.</p>
      <p>Alarms can be generated by the gateway or by the cloud system. Table 1 summarizes the types of
alarms generated by the system, the source, the context in which they are generated and size (bytes).</p>
      <p>One of the alarms generated by the system is the detection of the excess of infractions carried out
by an animal, since there are animals that do not accept to be conditioned, and therefore must be
removed from the vineyard.</p>
      <p>Network nodes need battery power to operate, and the system periodically monitors their charge,
and informs the system supervisor, especially about the collar battery charge, as these are the key
elements which guarantee that the animals do not threaten the vineyards. Moreover, the alarm system
triggers an alarm to the supervisor as soon as the battery charge drops below the minimum threshold
set.</p>
      <p>With consequences like those of battery drainage, two other events can happen: equipment failure
and inactivity. The first may be due to the equipment inoperability, in which case it leaves the animal
free to eat whatever it wants, threatening the plants; the second is related to a pattern of sensor-detected
accelerations, which are not very common in the normal behavior of the animals and denotes that the
equipment was abandoned on the ground, leaving the animal free as well.</p>
      <p>The last type of alarm generated locally by the gateway is the panic alarm. In particular, the gateway
continuously compares the accelerations measured by the collars with the baseline of the acceleration
values and for each of the animals present in the system. Thus, it detects herd disturbances, such as herd
interaction with strangers or other animals such as stray dogs.</p>
      <p>The cloud also monitors the herd data received and can generate alarms, for example, signaling a
potential illness due to a continuous decrease in animal activity. As the message is generated in the
cloud, it is not exchanged in the satellite/Wi-Fi links, and thus its size is irrelevant.</p>
    </sec>
    <sec id="sec-3">
      <title>3. System Evaluation</title>
      <p>The system was functionally validated and tested to characterize its performance in terms of volume
of traffic generated and in terms of latency. During the system tests, a gateway was implemented using
a Raspberry PI 3 Model B+, and the cloud application was hosted in a Ubuntu 20.04.4 LTS server
virtual machine enabled with 8GB RAM and 2 cores, hosted at the datacenter of the Instituto de
Telecomunicações.</p>
      <p>We started by testing the signaling volume produced by each of the interconnection APIs. For the
tests, a simple client of the gateway was used, simulating various amounts of each of the types of alarms,
using each of the encoding APIs, and the signaling volume of the alarm transport messages was
measured through a network sniffer.</p>
      <p>The results illustrated in Figure 2 showed greater efficiency of the MessagePack API, in the transport
of alarm messages.</p>
      <sec id="sec-3-1">
        <title>Average message size per alarm type (10 Collars | 10 Beacons)</title>
        <sec id="sec-3-1-1">
          <title>MessagePack</title>
        </sec>
        <sec id="sec-3-1-2">
          <title>Protocol Buffers Avro</title>
          <p>1,400
1,350
)
s
te1,300
y
B
(
e1,250
z
i
S1,200
1,150
24.0
20.0</p>
          <p>The latency of the system in the transport of alarms was also tested, both in the case of transport via
Wi-Fi and in the case of using the Satellite Link, and the results are illustrated in the plots of Figure 3.</p>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>WIFI Latency</title>
      </sec>
      <sec id="sec-3-3">
        <title>Satellite Latency</title>
        <p>1</p>
        <p>100
Number of alarms
1</p>
        <p>100
Number of alarms</p>
        <p>Results show a considerably higher latency time for the satellite case, with the difference increasing
along with the size of the messages. In the case of smaller messages, there is a difference in latency due
to the difference in the path taken by the two technologies. For larger messages the total latency value
reaches 1.5 seconds, a value much higher than the necessary in the Wi-Fi connection, that is due to the
bandwidth available in the case of the satellite connection.</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusions</title>
      <p>The alarmist component in an electronic grazing system like the one developed in the SheepIT
project is essential, to free the human supervisor for other tasks, or simply to free him from an arduous
and lonely task. Present work made possible to implement a system that monitors animals and network
devices, generating and sending a set of alarms, to guarantee the safety of animals and plants.</p>
      <p>Most vineyards are in rural areas, with very low population density, and therefore have poor cellular
coverage, making it difficult to connect to the Internet. In this context, we integrated the gateway with
a satellite interface, thus allowing a means of accessing the Internet, even in very difficult access places
such as the uneven slopes of the Douro region.</p>
      <p>The system was functionally validated to evaluate the communication latency as well as the volume
of signaling produced during its operation. Three information encoding APIs were tested and it was
verified that MessagePack allowed better performance.</p>
      <p>The results made it possible to verify that the values are perfectly acceptable and compatible with
the system alarm function. For future work, we will also consider a LoRaWAN-satellite integrated
environment supported with AI-assisted opportunistic transmission.</p>
    </sec>
    <sec id="sec-5">
      <title>Acknowledgements</title>
      <p>This work is funded by FCT/MCTES through national funds and when applicable co-funded EU
funds under the project UIDB/50008/2020-UIDP/50008/2020.</p>
      <p>We would like to express as well our thanks to EchoStar Mobile (https://www.echostarmobile.com/)
for allowing us access to their satellite terminal and mobile satellite data services.</p>
    </sec>
    <sec id="sec-6">
      <title>6. References</title>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>No</surname>
          </string-name>
          <article-title>́ brega</article-title>
          , P. Pedreiras, P. Gonç alves, “
          <article-title>SheepIT - An electronic shepherd for the vineyards</article-title>
          ,”
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>L.</given-names>
            <surname>No</surname>
          </string-name>
          <article-title>́brega</article-title>
          , P. Gonçalves, P. Pedreiras, and
          <string-name>
            <given-names>J.</given-names>
            <surname>Pereira</surname>
          </string-name>
          , “
          <article-title>An IoT -Based Solution for Intelligent Farming</article-title>
          ,” Sensors, vol.
          <volume>19</volume>
          , no.
          <issue>3</issue>
          , p.
          <fpage>603</fpage>
          ,
          <string-name>
            <surname>Jan</surname>
          </string-name>
          .
          <year>2019</year>
          , doi: 10.3390/s19030603.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>J.</given-names>
            <surname>Lorincz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Z.</given-names>
            <surname>Klarin</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Begusic</surname>
          </string-name>
          , “
          <article-title>Modeling and Analysis of Data and Coverage Energy Efficiency for Different Demographic Areas in 5G Networks,”</article-title>
          <source>IEEE Systems Journal</source>
          ,
          <year>2021</year>
          , doi: 10.1109/JSYST.
          <year>2021</year>
          .
          <volume>3074100</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>L.</given-names>
            <surname>No</surname>
          </string-name>
          <article-title>́ brega</article-title>
          , P. Gonç alves, M. Antunes, and
          <string-name>
            <given-names>D.</given-names>
            <surname>Corujo</surname>
          </string-name>
          , “
          <article-title>Assessing sheep behavior through lowpower microcontrollers in smart agriculture scenarios,” Computers and Electronics in Agriculture</article-title>
          , vol.
          <volume>173</volume>
          , p.
          <fpage>105444</fpage>
          ,
          <string-name>
            <surname>Jun</surname>
          </string-name>
          .
          <year>2020</year>
          , doi: https://doi.org/10.1016/j.compag.
          <year>2020</year>
          .
          <volume>105444</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>R.</given-names>
            <surname>Guedes</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Pedreiras</surname>
          </string-name>
          , L. Nó
          <issue>brega</issue>
          , and P. Gonçalves, “
          <article-title>Towards a low -cost localization system for small ruminants,” Computers and Electronics in Agriculture</article-title>
          , vol.
          <volume>185</volume>
          , p.
          <fpage>106172</fpage>
          ,
          <string-name>
            <surname>Jun</surname>
          </string-name>
          .
          <year>2021</year>
          , doi: 10.1016/j.compag.
          <year>2021</year>
          .
          <volume>106172</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>P.</given-names>
            <surname>Gonc</surname>
          </string-name>
          ̧alves, L. Nóbrega, A. Monteiro,
          <string-name>
            <given-names>P.</given-names>
            <surname>Pedreiras</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Rodrigues</surname>
          </string-name>
          , and
          <string-name>
            <given-names>F.</given-names>
            <surname>Esteves</surname>
          </string-name>
          , “
          <article-title>SheepIT, an E-Shepherd System for Weed Control in Vineyards: Experimental Results</article-title>
          and Lessons Learned,” Animals, vol.
          <volume>11</volume>
          , no.
          <issue>9</issue>
          , p.
          <fpage>2625</fpage>
          ,
          <string-name>
            <surname>Sep</surname>
          </string-name>
          .
          <year>2021</year>
          , doi: 10.3390/ani11092625.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>T.</given-names>
            <surname>Andresen</surname>
          </string-name>
          ,
          <string-name>
            <surname>F. B. de Aguiar</surname>
            , and
            <given-names>M. J.</given-names>
          </string-name>
          <string-name>
            <surname>Curado</surname>
          </string-name>
          , “The Alto Douro Wine Region greenway,
          <source>” Landscape and Urban Planning</source>
          , vol.
          <volume>68</volume>
          , no.
          <issue>2-3</issue>
          ,
          <year>2004</year>
          , doi: 10.1016/S0169-2046(
          <volume>03</volume>
          )
          <fpage>00156</fpage>
          -
          <lpage>7</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>M.</given-names>
            <surname>Rostanski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Grochla</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Seman</surname>
          </string-name>
          , “
          <article-title>Evaluation of highly available and fault-tolerant middleware clustered architectures using RabbitMQ,”</article-title>
          <source>in Computer Science and Information Systems (FedCSIS)</source>
          ,
          <source>2014 Federated Conference on, 2014</source>
          , pp.
          <fpage>879</fpage>
          -
          <lpage>884</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>D.</given-names>
            <surname>Vohra</surname>
          </string-name>
          , “Apache Avro,” Practical Hadoop Ecosystem, pp.
          <fpage>303</fpage>
          -
          <lpage>323</lpage>
          ,
          <year>2016</year>
          , doi: 10.1007/978-1-
          <fpage>4842</fpage>
          -2199-
          <issue>0</issue>
          _
          <fpage>7</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Travers</given-names>
            <surname>Ching</surname>
          </string-name>
          and
          <string-name>
            <given-names>D.</given-names>
            <surname>Eddelbuettel</surname>
          </string-name>
          , “
          <article-title>RcppMsgPack: MessagePack Headers and Interface Functions for R”</article-title>
          ,
          <source>Accessed: Mar. 21</source>
          ,
          <year>2022</year>
          . [Online]. Available: https://msgpack.org,
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>G.</given-names>
            <surname>Kaur and M. M. Fuad</surname>
          </string-name>
          , “
          <article-title>An evaluation of protocol buffer</article-title>
          ,”
          <source>Conference Proceedings - IEEE SOUTHEASTCON</source>
          , pp.
          <fpage>459</fpage>
          -
          <lpage>462</lpage>
          ,
          <year>2010</year>
          , doi: 10.1109/SECON.
          <year>2010</year>
          .
          <volume>5453828</volume>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>