# A Networked Sensor System for the Analysis of Plot-Scale Hydrology
## 2 Materials and Methods
### Note Application  
The more application was developed in TinyOS 2.1.2 [36] with an adoption of the newly developed routing protocol CTP + EER [38]. TinyOS is the most widely used WSN operating system and is found in 60% of WSN deployments [48; 49]. Owing to its popularity, TinyOS has a larger community, better documentation, and well-tested drivers and protocols compared to other WSN operating system alternatives [48].  
CTP + EER is an efficient and balanced routing protocol that extends CTP [37]. CTP is the de facto standard collection routing protocol in TinyOS, in which each mode finds the best route to the sink (i.e., base station). Unfortunately, with this protocol, network data traffic tends to concentrate on a few specific modes that provide the best routes within the network. Thus, these modes experience heavy congestion and deplete their batteries faster than their neighbors. In contrast, CTP + EER, while maintaining the best primary route within the network, also allows modes to select suboptimal routes from a parent set; therefore, it can reduce the data traffic at the busiest motes and provide better overall energy efficiency and balance. CTP + EER has been evaluated though analytical modeling, simulations, and testbed experiments. Compared with CTP, CPT + EER achieves better packet reception ratio, load balance, and energy efficiency. Please see [38] (and the references herein) for more details.  
The wireless motes form a multi-hop collection network operating in asynchronous low-power listening (LPL) [50]. The logical architecture of the application is presented in Figure 4. Each node uses CTP + EER to deliver two types of packets: data packets (DataSenderC) and summary packets (SumSenderC). Data packets are periodically sampled at a base interval of 30 min (DataTimerC). Randomness is added to each mote to avoid bursty network traffic (RandTimerC). Summary packets enable efficient network diagnosis (NetStatsC) and are generated every two hours (SumTimerC), which includes the network statistics such as retransmission, dropped packets, and information about the routing control traffic.  
The mote application was adjusted based on the sensor types attached to each individual mote. There are two types of nodes: relay nodes and sensor nodes. Relay nodes have no external sensors and are used at advantageous locations to improve communication throughout the network (e.g., hanging in trees as shown in Figure 3a). Sensor nodes are nodes with external environmental sensors (e.g., SM, WP, soil temperature or sap flow). Sensor nodes also participate in network routing and packet forwarding in data collection. Relay nodes only have temperature and humidity sensors (Sht11C, Sensirion, Zurich, Switzerland) [51]. Sensor nodes have analog sensors attached that utilize the ADC channels. In addition, some sensor nodes with TelosB motes also have a digital sensor that communicates through the UART0 serial port (Msp430 Uart0C).  
To facilitate the reprogramming of motes that are deployed in difficult-to-access enclosures, an over-the-air mobile mote-reprogramming tool was utilized such that direct access to the mote hardware was not necessary. While many over-the-air programming approaches have been proposed for WSNs, none of them apply to heterogeneous and low power WSNs [52; 53]. Our novel mobile mote reprogramming tool, MobileDeluge [52] (see Section 3.5.4), was developed to overcome this limitation.  
Figure 4: Mote application architecture.