# A Resilient LoRa-Based Solution to Support Pervasive Sensing
## 5 Results
### LoRa Tests
#### 5.2.1 Outdoor Test  
The first test was performed on a bike lane that went straight on for about 2.5 km. As Figure 3 shows, one device was placed, stationary and sending messages, on the white dot while another device was moving farther away and listening, stopping at the set distances indicated by the red dots. The same experiment was repeated multiple times; a higher spreading factor was used each time between the two nodes.  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Action** & **Power Consumption (mAh)** \\ \hline Idle (Wi-Fi on) & 100 \\ Idle (Wi-Fi off) & 40 \\ Listening for messages & 50 \\ Sending messages & 120 \\ Retrieving data from sensor & 80 \\ Regular sleep & 50 \\ Light sleep & 20 \\ Deep sleep & 10 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Power consumption during specific actions.  
Figure 3: LoRa outdoor test.  
During the test, the first node (white dot) sent messages in waves, one for each of the positions of the other node (red dots). The test recorded the packet delivery ratio (PDR) calculated by the following equation \(\frac{P_{rec}}{P_{sent}}\) where \(P_{rec}\) is the number of packets correctly received by the node on one of the red dots and \(P_{sent}\) is the number of total packets sent by the node on the white dot. We also recorded the signal-to-noise ratio (SNR) and received the signal strength indicator (RSSI). SNR is a pure value obtained by the formula \(\frac{P_{signal}}{P_{noise}}\), where \(P_{signal}\) is the power of the signal (meaningful input) and \(P_{noise}\) is the power of the background noise (meaningless or unwanted input). RSSI is expressed in decibels and indicates the power level being received by the antenna. We acknowledge the fact that RSSI values may not be as valuable for use cases that utilize different devices since the scale of values that can be obtained can vary between makers of wireless modems. However, they can still be helpful when compared with data obtained similarly. For RSSI, it is pretty much always true that a value closer to 0 indicates a stronger signal.  
Figure 4 shows how the PDR varied as a function of the spreading factor used by the nodes and the distance between them. It is clearly seen that using higher values of the spreading factor significantly increases the transmission range between the two devices. When employing the spreading factor 7, there was a drop in PDR just after the 300 m mark, whereas with the spreading factor 10, it came after 700 m. Instead, the spreading factor 12 was able to maintain a perfect packet delivery ratio (100%) until the nodes were 2 km apart.  
Figures 5 and 6 show how the SNR and RSSI varied as a function of distance. As one can expect, messages with higher SNR have significantly better PDR, since it means that the noise is much lower than the power of the signal. Similarly, messages with RSSI higher than \(-100\) have a high probability of being delivered correctly. To know what SNR and RSSI values non-delivered packets would have had, the values for the previous and subsequent messages were taken and averaged. So, for example, if a message was not received and the previous one had an RSSI of \(-108\), and the next one was \(-106\), the missing packet would be assigned an RSSI of \(-107\).