This paper introduces an online approach based on a nonlinear state observer (NSO) to calibrate the roughness of each pipe within a water distribution network (WDN) or a sector thereof. The NSO is designed to obtain the estimations of pipes' friction factors, which are then used to estimate the roughness. The core of the NSO is a dynamic WDN model formulated through a structured set of ordinary differential equations derived from fundamental physical principles and taking advantage of both graph theory and rigid water column theory. By applying a coordinate transformation, the WDN model is represented as a fully connected network of damped nonlinear oscillators, with each oscillator formulated as a Liénard system. This representation allows for estimating the friction factors for each pipe using only flow rate information. The proposed approach facilitates a continuous calibration when hydrodynamic data are readily accessible, which is a capability that empowers engineers to enhance, concurrently or proactively, the day-to-day operations of water distribution networks, such as control or diagnose tasks, whenever data are available. The results of numerical simulations are presented to illustrate the practical utility of the proposed method.