1. An apparatus for updating firmware running on nodes in a wireless mesh network, the apparatus comprising: a code image DB for storing a code image running on each node in the mesh network, and version of the code image; and an update script generator for generating, if a code image running on a target node in the mesh network needs to be updated, a code update script with reference to the code images of the target node and its neighboring nodes stored in the code image DB, and performing update of the target node using the code update script.