1 Introduction
Lowpower widearea networks (LPWANs) are an emerging wireless platform that aims to sustain powerconstrained end devices (e.g., those based on batteries or energy harvesting) to operate for years while communicating at low data rates to gateways several kilometers away. LPWAN technologies will largely increase the degree of connectivity of Internet of Things (IoT) and enable deep penetration of IoT objects into the urban territories. Fig. 1 illustrates the comparisons among various wireless technologies in terms of radio power consumption and communication ranges. From the figure, LPWANs (e.g., LoRaWAN [2], Sigfox [4], WeightlessP [5], and NBIoT [3]) form an important pole in the spectrum of radio power consumption versus communication range.
Given LPWAN signals’ capability of propagating over long distances and penetrating civil infrastructures, exploiting LPWAN signals for localizing IoT objects over long distances and/or in indoor environments has attracted increasing research interests. In this paper, we discuss the opportunities and challenges of LoRabased localization. LoRa is a physical layer technique that uses a Chirp Spread Spectrum (CSS) modulation, whereas LoRaWAN is an open data link layer specification based on LoRa. Our focus of studying LoRa for localization is due to its use of licensefree ISM band (e.g., EU868 MHz and US916 MHz), low cost (US$15 per unit [6]), and scalability to support many IoT objects. Compared with other wirelessbased solutions, the LoRabased localization will offer the following advantages:

If an infrastructurebased localization approach is considered, the LoRa infrastructures will be much simpler than other wireless infrastructures. Existing approaches based on shortrange radios, e.g., WiFi, Bluetooth, and ultrawideband (UWB), often require dense deployment of access points (APs) and beacon nodes, leading to high installation and maintenance costs. In contrast, due to LoRa’s longrange communication capability, a small number of LoRa gateways can cover a geographic area (e.g., a campus) or a civil construction (e.g., a building) and act as anchors to support the localization of LoRa end devices. Thus, the deployment of the infrastructure will not incur significant overhead.

Due to LoRa’s low power consumption and good scalability, the LoRabased localization solutions can be applied to massive objects (e.g., goods in a warehouse). Highpower radios (e.g., WiFi and cellular) are illsuited for such scenarios, since they will drain the battery energy quickly. The RFID and NFC solutions, which rely on the reader’s scanning, cannot achieve realtime object localization.
Despite the above desirable features of LoRabased localization, we also face the following key technical challenges:

We aim to develop solutions that use customized gateways to localize offtheshelf LoRa end devices without any hardware customization and retrofitting. As most commercial LoRa end devices do not provide access to the LoRa physical layer, it is challenging and even impossible to obtain lowlevel information that is often critical to localization.

After penetrating barriers, the LoRa signals often go below the noise floor. Although the LoRa’s CSS modulation is designed to deal with significant signal attenuation, the localization approaches based on received signal strength (RSS) and RSS indicator (RSSI) will be vulnerable to low signaltonoise ratios (SNRs). Thus, the RSSbased approaches are illsuited for LoRabased localization.

As the CSSmodulated LoRa signal is a narrowband signal, it cannot be very sharp in the time domain. Its smooth timedomain waveform will make accurately timing the arrivals of the LoRa signals at the gateway difficult, rendering the timeofarrival (TOA) approaches futile.

To pursue using phase information of the LoRa signal for localization, the frequency variation of CSS makes the estimation of signal phase challenging. In addition, the lowcost LoRa end devices often have considerable frequency biases, especially when deployed in the environments with timevarying conditions (e.g., varying ambient temperature and humidity). The multipath propagation of the LoRa signal may also affect negatively the estimation of the signal phase.
This paper will discuss in detail the challenges faced by a few possible solutions of localizing LoRa end devices. We also provide a formulation of the phasebased approach, which we believe is the most promising solution. The preliminary analysis on the phasebased approach suggests several technical challenges that we need to address in our future work.
2 Related Work
Using LPWAN radios such as LoRa to implement localization has received increasing research interest. Existing studies on LoRabased localization can be broadly divided into two classes of timedifferenceofarrivals (TDOA)based and RSSIbased approaches.
2.1 TDOABased Approaches
TDOA determines the position of a certain device by the differences among the time instants that the same signal arrives at multiple gateways. Fargas et al. [11] used timestamps provided by the LoRa gateways to implement a TDOA system. Carvalho et al. [9] evaluated the feasibility of implementing mobile sensing and tracking applications using LoRa radios. Podevijn et al. [16] also implemented a TDOA system based on the timestamps extracted from the LoRa gateways to evaluate the tracking performance of a LoRa network. The approaches developed in the above three studies have poor localization performance. This is mainly because that current LoRa hardware implementation and the software stack have a timestamp resolution of one microsecond () only. As radio signals travel about 300 meters in free space over a time duration of , the timing resolution of current offtheshelf LoRa products is not sufficient for implementing accurate localization [10]. Although there are several signal processing approaches [8, 17]
such as Kalman filter to improve the robustness against random noises, the timestamp resolution is still the determining factor for the localization performance of TDOA systems.
Rajalakshmi et al. [15] designed a multiband backscatter device based on CSS modulation for threedimensional localization. The backscatter device is in subcentimeter form factor and only consumes power. The projected lifetime of the device is up to ten years on button cell batteries. The above study achieves meterlevel localization accuracy with highly customized LoRa devices. In contrast, we aim to develop localization approaches for offtheshelf LoRa devices.
2.2 RSSIBased Approaches
Another research thread has focused on RSSIbased localization. Different from TDOA, in an RSSIbased ranging algorithm, a node uses RSSI measurements to estimate its distance from the signal source by using a known signal propagation model that characterizes the relationship between RSSI and distance. Lam et al. [13] described an RSSIbased LoRa localization algorithm in noisy outdoor environments. Accounting for the possible errors in the RSSI measurements, their approach selects the best distance estimate among all estimates. Furthermore, they tried to exclude noisy nodes and select the nodes experiencing lower levels of noises for localization [14]
. Machine learning approaches have been studied recently. Aernouts et al.
[7] proposed to apply kNearestNeighbor (kNN) algorithm on the collected RSSI measurements to estimate the object location. Zhe et al. [12] modeled the RSSI in both indoor and outdoor environments using Gaussian process and then applied maximum likelihood estimation (MLE) to develop a localization approach.2.3 Summary
The existing TDOAbased and RSSIbased approaches have several limitations. Most TDOA approaches based on commodity LoRa devices can only achieve subkilometer accuracy. Such accuracy is insufficient for a range of applications, such as unmanned aerial vehicle (UAV) tracking and navigation. Several TDOA approaches require pretrained models and/or highly customized devices, leading to overhead and high cost in deploying these approaches. The RSSIbased approaches are susceptible to strong signal attenuation and cannot achieve threedimensional localization well due to the multipath effect.
3 LoRa Primer
LoRa is a physical layer technique that uses a Chirp Spread Spectrum (CSS) modulation and operates in subGHz ISM bands (e.g., in Europe). In LoRa’s CSS, a chirp is a finitetime signal with timevarying instantaneous frequency that swaps the whole bandwidth of the communication channel in a linear manner. Given a certain central frequency, denoted by , an up chirp’s instantaneous frequency increases from to , whereas a down chirp’s instantaneous frequency decreases from to . The time duration of a chirp is determined by the spreading factor and bandwidth, which are denoted by and , respectively. Specifically, the chirp time is given by
(1) 
For the EU868 frequency band, there are six spreading factors, ranging from to . For example, with , , and initial phase , an up chirp’s spectrogram is shown in Fig. 2. Fig. 3 presents the inphase (I) and quadrature (Q) data of this chirp in the time domain.
The LoRaWAN specification defines three classes of end devices, ClassA, B, and C. ClassA devices are the most energy efficient because each communication session must be initialized by an end device rather than the gateway. Therefore, the end devices can follow their own communication schedules with low duty cycles. After an uplink initiated by an end device, there are two optional downlink windows for the gateway to transmit a frame to the end device. A ClassB device will synchronize its internal clock using beacons emitted by the gateway. During the synchronization process, the gateway can schedule the data transmissions and synchronization interval with the end devices. Thus, each ClassB device will use the allocated time slots to transmit uplink frames. ClassC devices will listen to the gateway continuously, which is powerconsuming. All offtheshelf LoRa end devices support the ClassA specification. ClassA operation, though energy efficient, may have a chance of frame collision if two end devices using the same spreading factor transmit at the same time. However, since the duty cycle is generally low, the frame collisions are of low probability. ClassB and C are free of frame collisions.
We aim to develop an approach that localizes an end device based on its uplink transmissions. The approach will be applicable to all three classes, assuming there are no frame collisions.
4 Approaches to LoRaBased Localization and Challenges
Various techniques have been developed for localization using radio signals. In this section, we discuss the challenges of implementing several main techniques for LoRabased localization.
4.1 RSSIBased Approach
RSSIbased approach builds a pathloss model according to the measured RSSIs at different distances from the signal source. With the model, the distance between the transmitter and the receiver can be estimated. For a static environment, the RSSIbased localization approach can achieve accuracy of hundreds of meters and down to tens of meters. However, radio channels are often subjected to various stochastic and unpredictable factors, especially in the indoor environments. It is generally hard to build an effective pathloss model when the signal travels through walls and floors constructed with diverse materials. Moreover, after penetrating the walls and floors, the LoRa signal strength may go below the noise floor, leading to large errors of the RSSIbased approach.
According to the datasheet of Semtech SX1276, which is a major commodity LoRa chip on the current market, the RSSI reading is an average value of multiple instantaneous RSSIs. This average RSSI is saved in a register that can be read at any time. We conduct an experiment to show the variation of this average RSSI over time. We set up two nodes as the transmitter and the receiver respectively in an office. Each node consists of an Arduino UNO and an SX1276based inAir9b LoRa chip. The distance between the transmitter and the receiver is about . Both of them use and . The transmitter randomly chooses a transmitting interval within 2 to 3 seconds. Fig. 4 shows the average RSSI readings of the receiver over 10 minutes. We can see that the RSSI fluctuates even when both nodes stay still. Such fluctuations challenge the design of the RSSIbased localization approaches.
4.2 TDOABased Approach
A TDOAbased localization system has multiple base stations with known locations. We also assume that the clocks of the base stations are tightly synchronized. A transmitter transmits a signal that will be captured by all base stations. For each two base stations, the difference between their signal arrival times can be measured. Now, our discussion focuses on two base stations. With the product of the signal propagation speed and the time difference as the real axis, we can get a hyperbola. The location of the transmitter is at the intersection point of the hyperbolas. Thus, the accuracy of timestamping the signal’s arrival time is critical to TDOAbased localization approach.
There are mainly three existing approaches to extract the timestamp of an incoming LoRa signal, including reading the timestamp provided by the LoRaWAN gateway, estimating the arrival time in the spectrogram domain and estimating the arrival time in the time domain. All three approaches achieve microsecond level timestamping accuracy only, which is insufficient for meterlevel ranging and localization. To achieve meterlevel ranging and localization, nanosecond timestamping accuracy will be needed. We now discuss the details of the three possible timestamping methods for LoRa.

Timestamp given by LoRaWAN gateway: When a gateway receives a LoRa frame, it will forward it to the LoRaWAN software server with a timestamp. The timestamp is the value of the gateway’s internal time counter at the time instant when the LoRa frame was received. However, most commodity LoRaWAN gateways provide time counters with microsecond granularity only [1]. Thus, the frame arrival timestamping will have microsecondlevel accuracy only.

Spectrogram domain timestamping: As the up chirp exhibits a clear timefrequency pattern as shown in Fig. 2, a possible approach to locating the signal arrival time is to analyze the spectrogram of the received and data. However, the spectrogram inevitably has reduced time resolution. For instance, the time resolution of the spectrogram in Fig. 2 is , which is beyond the nsaccurate timestamping. Note that the data chirps are decoded by analyzing their spectrograms, because the up and down chirps can be easily differentiated. Differently, preamble onset time estimation imposes more challenges than data decoding.
Figure 5: and data of an up chirp under different settings. Note that is the difference between the initial phases of the carrier signals generated by the transmitter and the receiver. 
Time domain timestamping: Matched filter has been widely adopted for signal arrival time detection. The matched filter requires that the phase of an incoming signal is known to achieve the best detection accuracy. However, as LoRa adopts CSS modulation, the frequency will change with time, it is difficult for a receiver to lock the phase of an incoming signal. Fig. 5 shows the ideal and traces of two up chirps when the difference between the initial phases of the carrier signals at the transmitter and the receiver (denoted by ) are and , respectively. We can see that the waveform shapes highly depend on the . Since the is generally unknown and hard to estimate for CSS signals, it is difficult to define a template shape for the matched filter to work.
4.3 PhaseBased Approach
In this section, we will provide a detailed analysis on a possible phasebased approach to LoRa localization.
4.3.1 Modeling of LoRa Chirp Signal Propagation
As mentioned earlier, a chirp is a finitetime bandpass signal with timevarying frequency. Let and denote the instantaneous amplitude and frequency of the chirp signal at the time instant . We formulate the chirp signal emitted by the transmitter from time as , where is the LoRa transmitter’s initial phase at . The is usually unknown. As the signal emission starts from time , we can make and when . Now we derive the expression of the chirp signal at a position that is meters from the transmitter. Our analysis ignores the multipath effect and barriers. The signal at the position, denoted by , can be expressed by
where denotes the attenuation coefficient, denotes the signal propagation velocity. Note that before the signal front arrives at the position (i.e., ), the signal .
4.3.2 Modeling of LoRa Chirp Signal Reception and a Differential Phase Sampling Technique
This section models the reception of the LoRa chirp by a gateway implemented by a softwaredefined radio (SDR). The SDR generates two unitamplitude orthogonal carriers and , where is a specified frequency and is the initial phase of the two selfgenerated carriers at . The is usually unknown. Assume the gateway is meters from the LoRa transmitter. The SDR will mix the received signal with the selfgenerated carriers, yielding and . The and can be further derived as Eq. (2) and Eq. (3), respectively. The SDR will apply two internal lowpass filters to remove the highfrequency components in Eq. (2) and Eq. (3). Thus, after the lowpass filtering, the and components yielded by the SDR, denoted by and , are given by , , where and . From the above analysis, the instantaneous phase can be computed by where . The rectifies the multivalued inverse tangent function to an unlimited value domain and ensures that is a continuous function of . Note that under a differential phase sampling (DPS) scheme that will be discussed shortly, the value of can be easily determined.
We now discuss the DPS scheme. Let denote the sampling rate of the SDR’s analogtodigital converter (ADC). Denote by a sequence of instantaneous phases computed by the sampled and values. We define the DPS sequence starting from time with its th element given by
(4) 
The bounds of are analyzed as follows. The LoRa chirp’s instantaneous frequency . Thus, from Eq. (4), we have .
Proposition 1
is a sufficient condition for computing the sequence unambiguously based on the and traces.
We consider computing a element based on two consecutive values and , i.e., . With , the range of is . Denote and , where is known and is to be determined. Since , if or , will be out of its range . Thus, there is only three possible cases: i) , ii) , and iii) . It can be easily verified that there is a case satisfying and other two cases must not satisfy . The satisfying case determines the value of . Therefore, the elements of can be determined sequentially without ambiguity.
For the EU868 frequency band, . The sampling rate of SDR’s ADC (e.g., ) is much higher than . Thus, the condition can be satisfied.
4.3.3 Distance Difference Estimation and End Device Localization
The phasebased approach measures the differences among the phases of the gateways’ received signals to estimate the differences among the distances between the end device and the gateways. We assume that the clocks of the gateways are tightly synchronized. Note that the clock synchronization between the end device and the gateway is not required. Denote by and the distances from the end device to the gateways and , respectively. Our following analysis focuses on the estimation of . This approach can be applied to estimate other distance differences, which are then together used by multilateration to localize the end device. The DPS sequence on gateway is , where . Denote by the antiderivative of . The DPS sequence on gateway can be expressed as . As the variable in this time sequence is , we can denote the sequence as , where . The DPS sequence on gateway can be written as . Thus, . It means that is a timeshifted version of , where the time shift is . Therefore, we can compute the crosscorrelation of the two time sequences to estimate time shift. Assuming to be the peak position of crosscorrelation, we have . The approximation is because has to be an integer. Thus, the distance difference can be estimated as .
4.3.4 Challenges Faced by PhaseBased Approach
First, the approach needs a high sampling rate to improve the localization accuracy. The resolution of the distance difference estimation is . It means that if we use ADC, the resolution is about . If we use ADC, the resolution is about . Future research shall investigate whether upsampling can improve the resolution.
Second, the and traces generally contain noises. After longdistance propagation and barrier penetration, the high noise levels may significantly affect computing using . DPS scheme robust to noises is to be developed.
Third, our analysis assumes that the end device and the gateways can generate accurate carrier frequency. The frequency bias of the SDR and the end device in generating the carrier signals may affect the localization performance. To measure the impact of temperature change on frequency bias, we conduct a test over 24 hours. We put a transmitter in the corridor of a multistory building that air condition cannot reach and a receiver in a homothermal indoor environment. Fig. 6 shows that the estimated frequency bias changes with temperature. The red circle dot line represents the temperature measured by a temperature sensor in the outdoor environment. The blue square dot line represents the estimation error. Future research shall investigate how the frequency biases affect the distance difference estimation and develop mitigation approaches.
Finally, the clock synchronization errors among the gateways may effect the accuracy of the phasebased approach. If there exists an unknown synchronization error between the gateways and , the estimated distance difference . Thus, the resolution is . If we use ADC and aim to maintain the resolution at about , we need to synchronize the clocks of the gateways within error. Nanosecondlevel clock synchronization is often challenging on commodity platforms.
5 Conclusion and Future Work
This paper discusses the technical challenges faced by several commonly used techniques in implementing LoRabased localization. The RSSIbased and TDOAbased approaches do not seem promising due to basic limitations of the LoRa signal (e.g., significant signal attenuation after barrier penetration and smooth timedomain signal waveform) and current commodity LoRa hardware (e.g., lowresolution internal time counter). Our analysis shows that the phasebased approach is more promising but also pinpoint several relevant challenges. Our future work is to implement and evaluate the phasebased approach.
6 Acknowledgments
This research is supported by an NTU Startup Grant.
References
 [1] Basic communication protocol between lora gateway and server. http://bit.ly/2H304ht.
 [2] Lora alliance. https://loraalliance.org/.
 [3] Narrowband internet of things (nbiot). http://bit.ly/2RwH9Q8.
 [4] Sigfox. https://www.sigfox.com/.
 [5] Weightless. http://www.weightless.org/.
 [6] Wireless sx1276 lora module. http://bit.ly/2s3NJiz.
 [7] M. Aernouts, R. Berkvens, K. Van Vlaenderen, and M. Weyn. Sigfox and lorawan datasets for fingerprint localization in large urban and rural areas. Data, 3(2):13, 2018.
 [8] W. Bakkali, M. Kieffer, M. Lalam, and T. Lestable. Kalman filterbased localization for internet of things lorawan™ end points. In Personal, Indoor, and Mobile Radio Communications (PIMRC), 2017 IEEE 28th Annual International Symposium on, pages 1–6. IEEE, 2017.
 [9] D. F. Carvalho, A. Depari, P. Ferrari, A. Flammini, S. Rinaldi, and E. Sisinni. On the feasibility of mobile sensing and tracking applications based on lpwan. In Sensors Applications Symposium (SAS), 2018 IEEE, pages 1–6. IEEE, 2018.
 [10] A. Dongare, C. Hesling, K. Bhatia, A. Balanuta, R. L. Pereira, B. Iannucci, and A. Rowe. Openchirp: A lowpower widearea networking architecture. In Pervasive Computing and Communications Workshops (PerCom Workshops), 2017 IEEE International Conference on, pages 569–574. IEEE, 2017.
 [11] B. C. Fargas and M. N. Petersen. Gpsfree geolocation using lora in lowpower wans. In Global Internet of Things Summit (GIoTS), 2017, pages 1–6. IEEE, 2017.
 [12] Z. He, Y. Li, L. Pei, and K. O’Keefe. Enhanced gaussian process based localization using a low power wide area network. IEEE Communications Letters, 2018.
 [13] K.H. Lam, C.C. Cheung, and W.C. Lee. Lorabased localization systems for noisy outdoor environment. In Wireless and Mobile Computing, Networking and Communications (WiMob),, pages 278–284. IEEE, 2017.
 [14] K.H. Lam, C.C. Cheung, and W.C. Lee. New rssibased lora localization algorithms for very noisy outdoor environment. In 2018 IEEE 42nd Annual Computer Software and Applications Conference (COMPSAC), pages 794–799. IEEE, 2018.
 [15] R. Nandakumar, V. Iyer, and S. Gollakota. 3d localization for subcentimeter sized devices. In Proceedings of the 16th ACM Conference on Embedded Networked Sensor Systems, pages 108–119. ACM, 2018.
 [16] N. Podevijn, D. Plets, J. Trogh, L. Martens, P. Suanet, K. Hendrikse, and W. Joseph. Tdoabased outdoor positioning with tracking algorithm in a public lora network. Wireless Communications and Mobile Computing, 2018, 2018.
 [17] F. Wolf, C. Villien, S. de Rivaz, F. Dehmas, and J.P. Cances. Improved multichannel ranging precision bound for narrowband lpwan in multipath scenarios. In Wireless Communications and Networking Conference (WCNC), 2018 IEEE, pages 1–6. IEEE, 2018.
Comments
There are no comments yet.