## 5 Offline Trail Positioning System  
The improvement of the tourist experience in places where no Internet connection is available is a very important way to increase the interest in those places. The proposal presented in this paper describes an IoT system whose main objective is to improve the quality of rural tourism. As previously mentioned, this kind of tourism has increased greatly during the last few years. For a hiking tourist, to know when he/she is going in the correct way on a trail that could have many different routes or paths is crucial both for his/her safety and to have a good experience on the trail. Traditionally, hiking tourist can find different signals that indicate the trail difficulty level and the different directions, placed in logs and vertical signs (see Figure 9). These types of signs are often deteriorated due to climatic conditions or vandalism (see Figure 10). To solve the orientation problem on this kind of trail where there is no Internet connection, a proposal based on FatBeacons is herein described. As a starting hypothesis, this paper assumes that rural areas are modeled as a graph where several zones (corresponding to POIs) are represented by vertices connected by edges (corresponding to roads or sidewalks). The main goal of the algorithm presented in this paper is to prevent users from getting lost. The use of a graph-based approach is due to the fact that often, tourists prefer to visit several points near an area and not to go directly from Point A to Point B. Each user has to choose a final destination point when starting the path, i.e., when the previous points are all null. Then, the user can move along the different trails until he/she finds the exit (or destination point). If he/she finds a destination point different from the selected one, the algorithm will indicate that the user is on the wrong path. The main advantage of this algorithm is that it reduces the probability of getting lost by preventing the user from going through wrong points. The developed application has two different parts: a web-view showing the information about the POI associated with the found FatBeacon and a positioning system. Both modules interact with each other and together work as an individual system. The positioning system is based on the use of JavaScript Object Notation (JSON) information stored in each FatBeacon. This information is transmitted by the FatBeacon, together with the HTML content of the POI information. Then, these data are processed by the developed application to divide all data into two parts: the HTML content that is rendered by the web-view and the JSON data that are used to show useful information about the route to the user. For the correct operation of the system, every FatBeacon stores a list of FatBeacons that should have been previously found or that correspond to destinations that will be found later. These destinations depend on the current FatBeacon and the immediately previous one. The use of the previous FatBeacon is only useful to distinguish whether a tourist is going in a direction or the opposite on trials that could be crossed in both directions. To know the original destination of the tourist, when the application detects the first FatBeacon, the tourist is questioned about which is his/her destination among the possible ones. The response to this question  
Figure 8: Trail path over the coverage map. is stored in the application to compare with the next FatBeacons in order to know whether the tourist is on her/his route or not. Every time a FatBeacon is detected, the application automatically checks whether his/her destination is between the possible destinations of the found FatBeacon or not. When the tourist destination is not among the possible ones, a sound message is sent to the application indicating to the user that he/she is on the wrong track. Otherwise, when the tourist destination is among the possible ones, a sound message is sent informing that he/she is on the correct track.