# LaRaWAPS: A Wide-Area Positioning System Based on LoRa Mesh
## 1 Introduction
On this basis, a demonstrable LoRa communication-positioning sensing system is built through software and hardware design. To the best of our knowledge, this is the first system capable of simultaneously running LoRa Mesh networking communication and LoRa wireless positioning tasks. 2. For hardware design, a hardware abstraction layer is added for cost control or power optimization. Moreover, a LoRa Mesh protocol with low power consumption and high reliability is designed. In view of the lack of a LoRa Mesh protocol standard, we rebuild and simplify the LoRa Mesh protocol stack and improve the packet format. Compared with other wireless Mesh protocols, the route discovery and route maintenance process of the LoRa Mesh protocol designed in this paper is simpler and more energy-efficient. The protocol also introduces the mechanism of channel activity detection and packet Cyclic Redundancy Check (CRC) check to optimize packet congestion and improve communication reliability. 3. A routing algorithm based on local link state information of nodes is designed. Under the background of limited local routing state information of nodes, the influence of communication delay, communication reliability, and node load is considered jointly, and the routing algorithm in the protocol is designed to improve the networking efficiency. The experimental results show that the proposed routing algorithm can take into account both delay and communication quality effectively compared with other routing algorithms. A distance estimation algorithm based on multi-sample data of time of flight (TOF) and RSSI is designed. Aiming at the problem that the range accuracy of LoRa is easily affected by the NLOS path propagation of signals, based on the fusion of TOF and received signal strength indicator (RSSI) data obtained by multi-beat sampling, the line-of-sight channel, and non-line-of-sight channel are screened by clustering idea, and the line-of-sight (LOS) channel is found and the distance is estimated. The experimental results of distance measurement in outdoor scenes show that the average distance measurement error of this algorithm is about 6 m.
5. A position estimation algorithm is designed to minimize the posterior RSSI error. By calculating the posterior RSSI error of position estimation coordinates, an evaluation criterion of position estimation results is designed. Based on this criterion, a heuristic anchor point selection method is designed to reduce the interference of bad anchor points and improve the accuracy of the position solution. Experimental results in outdoor scenes show that the proposed algorithm can provide meter-level positioning accuracy when the regional anchor point density is high. 6. The optimal position of the anchor point is discussed. In order to solve the problem of lack of reference basis for anchor location, electromagnetic simulation is used to simulate the spatial signal distribution, and a heuristic anchor location selection algorithm is designed based on the spatial signal distribution and a priori knowledge to find the best anchor location with the best coverage effect.