# Real-Time Extensive Livestock Monitoring Using LPWAN Smart Wearable and Infrastructure
## 4 Discussion  
The wearable and infrastructure introduced in this work has proved to be a valuable and flexible tool, as it allows for both field deployment and laboratory research. The main purpose in these field application scenarios is providing animals GNSS localization for both audit tracking and finding the cattle. Field tests shows communication links ranging up to 12 km with direct line of sight, allowing coverage of large areas with minimal infrastructure. Theoretically, a single receiver would serve an area of 452 km\({}^{2}\). This allows for LoRaWAN setups that are both cheaper and more convenient than deploying cellular repeaters for low data rate needs such as position reports. Even if the requirements include motion reports with accelerometer data, the system proves reliable and still achieves long range, at the expense of extra battery life and bandwidth usage. This motion data could be used for health monitoring and developing future activity recognition algorithms. If any of the animals become lost outside the infrastructure's line of sight, the system may operate without infrastructure, with just an offline gateway and a mobile device. The system is capable of indicating the location of the animals in a self-hosted application that may operate in environments without internet access. This makes tracking the animal possible where a fixed infrastructure or the nonexistent cellular coverage would fail to locate it. Figure 12: Continuous movement streaming using FSK in farm (100 m range). Figure 13: Burst movement streaming using LoRaWAN (DR5) in mountains (12 km range). In addition, our system allows registering periodic bursts of raw movement data without affecting normal operation nor violating LoRaWAN regulatory constraints. Registering complete motion data is possible in controlled environments (such as indoor barns) where we use a faster data rate along with FSK modulation, so duty cycles are not compromised. It should be noted that full motion data streaming is applicable only for monitoring a reduced number of devices, as the band may be saturated despite complying with the use restrictions. Animals belonging to the same group are expected to behave similarly so this should not pose a problem. Using the proposed VQ compression model, motion data can be sampled at high frequency and we can adjust compressor parameters to fit the required data rate within the limits imposed by LoRaWAN. Larger window sizes with shorter number of centroids will lead to lowest data rates, but PSNR figures will be affected also, thus configurations that use most of the available data rate and maximize the number of centroids without overfitting should be preferred. Considering size of compression model, its implementation is highly dependent on both static and dynamic memory available in the embedded device. We can use internal memory for small codebooks (e.g., three axes at 10 Hz with 1 s window needs 15.36 KB for a 256 centroid codebook) or use the external FLASH memory to store the larger codebooks. All these features are fulfilled with low energy consumption figures that ensure operation of the wearable throughout the whole season (even years if no raw movement data is required) when animals are outdoors. Even in the most demanding scenario with GNSS sampling and raw data sending over LoRaWAN (4 months) or FSK (8 months) the system serves as valuable cattle monitoring infrastructure. Together with regulatory compliance, this enables utilization of the system in real applications. We can extract conclusions at different levels comparing our system with other approaches in the literature. * Communications: Use of LoRa allows long range point to point communications with reduced energy consumption and medium data bandwidth (up to 5.5 kbps). We have achieved a maximum of 12 km in mountain environment with enough link budget.