# Wireless Sensor Networks for Enabling Smart Production Lines in Industry 4.0
## 2 Methodology
### Closed-Loop Monitoring  
After the calibration of the coverage map, the network controller continuously monitors INT data and verifies that the coverage requirements are met, that is, the latency is smaller than threshold \(\text{L}_{\text{max}}\), the packet error rate is below threshold \(\text{PER}_{\text{max}}\), and the measured RSSI of all devices is above the threshold \(\text{RSSI}_{\text{min}}\) that is needed to obtain a certain MCS. The threshold \(\text{RSSI}_{\text{min}}\) depends on the throughput requirements. A PHY reconfiguration is triggered when the QoS requirements are not met. This monitoring loop is visualized as step 3 in Figure 2 and presented in Figure 4.  
Figure 3: Coverage map calibration algorithm: storing offset between measured received signal strength information (RSSI) and simulated received power (\(\text{P}_{\text{RX}}\)) for every client.  
For each client, we obtained the available QoS parameters. If the latency exceeded threshold Lmax, we calculated the received power at every location assuming that the AP to which the client is connected is not present. If clients that are connected to the constrained AP have the required QoS when connecting to another AP, for example, the throughput is guaranteed via another AP, they will reconnect to decrease the load on the constrained AP. We measure signal-to-noise ratio (SNR) and RSSI on the client devices so we can calculate the noise floor (NF). When the NF exceeds the threshold NFmax, we evaluate the available frequency channels for the AP and client devices and obtain the frequency occupation of the complete network. We then select the channel that is least used. If the measured RSSI is higher than the required threshold, an MCS can be used that enables a data rate higher than the required throughput. If the measured RSSI is higher than the threshold but the packet error rate exceeds threshold PERmax, another frequency is selected to minimize interference. If the measured RSSI of all clients connected to one AP is considerably higher than the minimum to receive power corresponding to the required throughput, the TX power of the AP can be lowered. If the RSSI of a client is lower than the threshold, for example, as the result of added machinery or an updated floor plan, the required throughput is not guaranteed and therefore the network has to be reconfigured. We added a virtual obstruction to the floor plan in the center between the client and AP locations with an attenuation equal to the difference between calibrated and measured RSSI, and then reconfigured the PHY parameters of the AP.  
The reconfiguration can consist of updated frequency settings, updated power settings, and an updated MCS or bandwidth mode, depending on the technologies that are used. For the network reconfiguration, the placement of APs is taken as a constraint to reconfigure the network without changing the AP locations, so that this reconfiguration can be done without human interaction.  
Whenever a reconfiguration is triggered for one specific AP, a separate process is started on the network controller that verifies whether other APs can also be reconfigured. Furthermore, we verify whether a lower MCS could be sufficient for all connected clients. If this is the case, the TX power is decreased. As this reconfiguration is a time-consuming task, it runs in a separate process and is re-initiated whenever a new reconfiguration is triggered.  
Figure 4: Monitoring algorithm: monitor packet error rate (PER), received signal strength information (RSSI), signal-to-noise ratio (SNR), and latency (L), and a PHY reconfiguration is triggered when QoS requirements are not met.