## 5 Experiments  
### Empirical Validation: LoRaWAN Testbed  
To evaluate LoRaWAN performance in a real campus, the testbed described in Section 3.3 was deployed in the Campus of Elvi\(\tilde{\text{n}}\)a. A measurement campaign was designed and carried out to validate the chosen hardware and the simulation results provided by the 3D Ray-Launching algorithm. The performed tests consisted on transmitting packets from the LoRaWAN node to the gateway from different spots throughout the campus using acknowledgment messages. Figure 6 shows such spots (in yellow) together with the LoRaWAN gateway location (in red) for one of the two parts of the evaluated campus. The transmitter was placed near a window inside a building, at a height of 3.5 m from the street ground level. In contrast, all the measurement spots were located outdoors, at a height of 0.5 m. For every of the previously mentioned spots, the Received Signal Strength Indicator (RSSI)  
Figure 4: Simulated scenarios of the smart campus. (**a**) Red scenario; (**b**) Green scenario. Figure 5: Aerial view of the Campus of Elvi\(\tilde{\text{n}}\)a, with the areas delimited for smart campus applications (Source: ©2019 Google). and Signal-to-Noise Ratio (SNR) values were recorded both at the LoRaWAN gateway and at the device that acted as a node. A Debian Virtual machine was connected to the LoRaWAN-server WebSocket endpoint. Nodes were connected through an USB port and programmed to send a 6-byte payload ten times. The firmware of the LoRaWAN node uses the USB port to create a serial interface and write the SNR and RSSI of the received acknowledgment. With this setup, the LoRaWAN node was moved to different spots and at each of them the RSSI and SNR values of the gateway and the node were recorded for a total of ten packages per location. To test for possible interference in the used Industrial, Scientific and Medical (ISM) sub-band, a USRP B210 [112] with the same 0 dBi antenna used by the LoRaWAN gateway was connected to a laptop that acted both as data-logger and spectrum analyzer (such a measurement setup is shown in Figure 3). As an example, the result of one of the analysis during the empirical measurements is shown in Figure 7, when the system was configured to monitor a central frequency of 868.3 MHz with a sampling rate of 1 MHz. Figure 6: Empirical measurement points in the Green Scenario (Source: ©2019 Google). Figure 7: State of the radio spectrum during the performed empirical measurements. After the measurement campaign within the campus, Radio Frequency (RF) power level estimations for the whole volume of the scenario were obtained with the aid of the 3D Ray-Launching simulation tool. The transmitter element was placed at the same position of the real LoRaWAN gateway (the red dot in Figure 6) and, using the simulation parameters shown in Table 3, a simulation was launched. The comparison between the measured RF power values and the simulation estimations is depicted in Figure 8. As can be seen in the Figure, the obtained estimations follow the tendency of the measured values, obtaining a mean error of 0.53 dB with a standard deviation of 3.39 dB (taking into account the 19 measurement points of Figure 6). The standard deviation is higher than the usual values provided by the 3D Ray-Launching. This effect could be due to size of the scenario (and the chosen simulation parameters such as cuboid size and launched ray resolution), since it is the largest scenario simulated so far by the developed 3D Ray-Launching tool. In addition, it must be noted the fact that measurements were based on RSSI values provided by the motes, which inherently add a received RF power level error. Nonetheless, the simulation results are accurate, and the simulation tool is validated satisfactorily. Regarding the results, it is worth noting the low RF power levels measured in several points of the scenario. The RF power level in many of these points is lower than \(-100\) dBm, which is the typical ZigBee sensitivity.