## 5 Experiments
### Cross-Interference Evaluation  
In a system where two different technologies share a common radio spectrum but that are not synchronized to avoid collisions, it is interesting to determine how well the system performs in real scenarios with and without cross-interference. However, please note that, for the sake of brevity, this article is not aimed at presenting a deep analysis of all the possible cross-interference scenarios, but at showing several relevant cases in order to determine the major factors that influence such a cross-interference in the proposed HAS. Specifically, it has been measured ZigBee's success delivery rate for 100 packets with and without WiFi transmissions on channel 1 (centered at 2412 MHz, which overlaps with IEEE 802.15.4 channels 11 to 14).  
Table 9 shows ZigBee's packet delivery success rates for several scenarios where WiFi cross-interference existed at different degrees. Two main scenarios where distinguished: one at a relatively short distance (less than 2 m) and another one at a medium distance (approximately 10 m). In such  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**System** & **Scenario** & **Response Time** \\ \hline ZiWi-Fog & Turn on a light when low luminosity is detected & 20 ms \\ ZiWi-Fog & Switch on a relay & 18 ms \\ ZiWi-Fog & Switch off a relay & 16 ms \\ ZiWi-Cloud & Detect and notify alert through Telegram & 2.735 s \\ \hline ZiWi-Cloud & Turn on a light when low luminosity is detected through IFTTT & 51.388 s \\ \hline
[19]-ZigBee & Switch on/off relay & 2 s \\ \hline
[19]-GSM & Switch on/off relay & 25 s \\ \hline
[25] & Read sensor value & 0.5 s \\ \hline
[25] & Act on actuator & 0.5 s \\ \hline
[41] & Detect and react to a shortcut & 1233.19 \(\upmu\)s \\
[43] & Collect sensor values and react depending on them & 32.9 ms \\ \hline \hline \end{tabular}
\end{table}
Table 8: Response time comparison of ZiWi with other state-of-the-art systems.  
scenarios, the WiFi network was first disabled physically to isolate the ZigBee network (there were also no other WiFi networks on channel 1), and then it was enabled. Two situations were distinguished after enabling WiFi transmissions: one where the WiFi network operated in a non-overlapping channel, and another one where it made use of the IEEE 802.11 channel 1.  
The values shown in Table 9 indicate first that the collisions associated with cross-interference influence the number of received packets, the number the transmission errors, and the number of packets lost during the tests. Thus, as it could be predicted, the higher the cross-interference, the lower the packet delivery success rate. Moreover, it is interesting to point out that the mere enabling of the WiFi, although working in a non-overlapping channel, influences ZigBee communications performance due to the transmission power that is leaked to neighboring channels.  
In addition, it is worth mentioning that the results presented in Table 9 were obtained with the typical traffic in a WiFi home automation network, which is light in comparison to, for instance, a WiFi network where P2P communications are carried out. In fact, during the experiments it was clearly observed that ZigBee's packet delivery success rate plummeted as the amount of WiFi traffic rose, until reaching a point when ZigBee communications became completely jammed. Nevertheless, note that such a scenario is not usual, but the results indicate that the operating frequency has to be carefully planned in order to maximize the packet delivery success rate. For such a purpose, fog computing can be extremely helpful, since the fog layer can coordinate home gateways with the objective of synchronizing the transmission frequencies of the different neighboring devices to reduce collisions.