# Indoor Vehicles Geolocalization Using LoRaWAN
## 4 The Proposed Architecture
### The Geolocalization Algorithm
 \tag{9}\]  
where: \(A=(-2x_{g_{1}}+2x_{g_{2}})\), \(B=(-2y_{g_{1}}+2y_{g_{2}})\), \(C=d_{g_{1}}^{2}-d_{g_{2}}^{2}-x_{g_{1}}^{  
The hardware used for the experiments is shown in Figure 7. As a client, we used a Whisper Node by Wisen and an Adafruit Feather 32u4. As gateways, we used LoPys by Pycom. The networks server was provided by \"The Things Networks\". As indicated in the previous Section, the RSSI value for each gateway perceived by the client is used to determine an estimate of the distance. The value of airtime was not used because, while testing various devices, we discovered that the actual measurement of these data was not properly implemented. So the basic goal is to pass from the values of the RSSI to an estimation of the distance. This process has been widely studied in the literature and many models are available. Various studies are also in the literature specifically oriented to LoRa. In [20], the authors present the experimental performance evaluation of LoRaWAN over a real environment in Bangkok, Thailand. According to their results, the LoRaWAN range is only up to 2 km in an outdoor rural area and 55-100 m in an indoor urban environment. Clearly, a strong dependency on the properties of the antennas such as antenna gain, directional and antenna height above the surrounding  
Figure 5: Location for the localisation experiments, the underground car parks of the UPV. (**a**) north-south orientation; (**b**) east-west orientation. Figure 6: The map of the localisation experiments with the position of the gateways and of the client. landscape was pointed out. [PERSON] et al. [PERSON] et al. (2018) present a set of measurements evaluating the performance of LoRa in a high-density urban area like the Melbourne's central business district. Their results show that loss-free communication is assured only within a radius of approximately 200 m from the base station and total loss of transmission occurs at around 600 m. Having a precise measurement is highly difficult. For example, [PERSON] et al. [PERSON] et al. (2018) highlight that even temperature can have a significant impact on LoRa's communication performance, showing that an increase in temperature can be sufficient to transform a perfect LoRa link into an almost useless one. More general studies, mostly in external set-ups, can be found in [PERSON] et al. (2018); [PERSON] et al. (2018); [PERSON] et al. (2018). What we wanted to analyse is the stability of the read value of the RSSI, varying the distance and the spreading factor used. The value of the Spreading Factor (SF) determines how many chips are used to represent a symbol. The higher the spreading factor, the higher the coding gain. That is, it gives better  
Figure 7: The hardware used for the experiments. On top the two clients used (**a**) a Whisper Node by Wisen, (**b**) an Adafruit Feather 32u4, on bottom (**c,d**) two gateways based on a LoPy by Pycom. sensitivity at the expense of lower data rates. A low spreading factor requires more power to accomplish a satisfactory bit error rate. Since data rate was not a critical factor in our case since the client nodes only need to broadcast the associated tag id. Figure 8 shows how the RSSI varies as a function of the distance and of the used SF. Although the average values obtained were similar, the variance of the obtained values differed noticeably. Moreover, at 200 m, basically, the maximum distance that we could reach in our scenario, with SF12 the packet loss rate was basically 0, while with SF7, the packet loss rate was slightly higher than 50%. Figure 9 details this behaviour at 50 m with SF7 and SF12 using the cumulative distribution of the values obtained. Both cases have a normal distribution but with SF7 the standard deviation is \(\sigma_{7}=3.96\) while with SF12 the standard deviation is \(\sigma_{12}=2.11\). This more stable behaviour is also evidenced by the Q-Q plot in Figure 10.  
Given the above results, a fundamental step was the computation of the parameter \(n\) for Equation (3).