Locating sensor nodes in an ad hoc wireless sensor network (WSN) is a challenging task. In general, the network nodes are not synchronised and the internal delays within the nodes are unknown. Here, time-of-arrival (TOA)-based localisation is investigated when practical parameters such as clock time offset, clock frequency offset and system internal delay are all involved. The TOA measurements are made between each pair of nodes that are within radio range. First, an efficient frequency offset (FO) estimation algorithm is derived. Then, a two-stage localisation scheme is proposed. In the first stage, localisation starts from the nodes with the largest numbers of neighbouring anchors and priority is always given to nodes with more neighbouring anchors and/or localised nodes. In the second stage, the locations of all neighbouring nodes are exploited to improve location accuracy. Two iterative algorithms are developed: the Taylor series-based least squares (TS-LS) method and the sequential quadratic programming (SQP) optimisation method. During the localisation process, a number of measures are taken to ensure the reliability of each location estimate to avoid abnormal errors and reduce error propagation. The Cramer-Rao lower bound is also derived to benchmark the location accuracy.