## 6 Field Test of the WSN Platform
### Long-Run Test of the WSN Platform
#### 6.3.1 Gateway Issues during the Long-Run Test  
Post-deployment checks missed a very important fault. The battery charging circuit of the GPRS modem of Gateway 2 failed during deployment and was not charging the battery. We discovered this too late, after we left the field, because we were monitoring the battery voltage (measured by the GPRS modem), and the potential _vs_. charge relationship, shown in Figure 11, has an extended, almost flat plateau that makes it difficult to determine changes in battery charge from voltage readings.  
The battery charger of the modem of Gateway 2 may have failed because of overheating during deployment due to a combination of the following three factors. First, Gateway 2 was the first deployed, thus it received more sun heat, which increased its internal temperature. Second, it received and forwarded to the server most of the false fire alerts generated by the sensor nodes, which additionally increased the temperature of the modem. Third, since the solar panels were well illuminated, they were charging the battery, thus increasing the temperature of the charging circuit even more.  
As Gateway 2's battery progressively discharged, we monitored the effectiveness of the built-in in-field redundancy. The GPRS modem does not work below 3.2 V, but the rest of the gateway (microcontroller and field radio) operates until the battery is completely discharged (lithium-ion batteries stop working around 2.7 V). When battery voltage dropped below the low threshold of the GPRS modem and it ceased to work, Gateway 2 continued to operate as a repeater, forwarding to its peer the messages received from the sensor nodes in its range. Gateway 1 aggregated them with its own messages and sent them all to the server, maintaining the redundant coverage of field nodes, as expected. When Gateway 2 eventually stopped working completely, Gateway 1 detected the new fault condition and notified the operators through an error message sent to the server.  
Another temperature-related issue was due to the limited range allowed for charging the lithium-ion batteries, 0-45 \({}^{\circ}\)C. Open nature temperatures can exceed this range, thus blocking battery recharging and, eventually, reducing its lifetime. These limits make lithium-ion rechargeable batteries less suited for open space environmental monitoring.  
During our field test, high daytime ambient temperature combined with heat from gateway direct sun exposure and heat released during GPRS communication and battery charging were often blocking battery charge during the central hours of hot days. Figure 12a shows how the internal gateway temperature met or exceeded 45 \({}^{\circ}\)C on most days over a two-week period. However, this did not significantly affect the operation of the gateway, since hot days are typically also very sunny, thus providing sufficient energy for recharging. Nevertheless, heat dissipation was not adequate for this gateway prototype. The gateway package should be adapted to the climate of the monitored field.  
Figure 12b shows how low temperature may break the synchronous serial communication between the microcontroller and the GPRS modem (approximately between Days 6-13 and 43-45 in the figure). However, since these failures correlate loosely with temperature, we could not rule out other causes, such as condensing humidity inside the gateway or inside the GPRS modem, until we reproduced the ambient conditions using a climatic chamber after the field test. The log collected locally on the affected microcontrollers indicated serial communication errors that were resolved by recalibrating the internal oscillator of the microcontroller from an accurate reference (e.g., a scaled-down frequency of the field radio crystal resonator).  
Figure 11: Lithium-ion battery voltage discharged by a gateway that contacts the server every 15 min to transfer 50 messages. It has an almost flat plateau, just below 3.8 V.