This paper describes an update mechanism for large wireless ad-hoc sensor networks (WASNs). In wireless sensor networks, the nodes may have to be reprogrammed, especially for design-implement-test iterations. Manually reprogramming is a very cumbersome work, and may be infeasible if nodes of the network are unreachable. Therefore, a wireless update mechanism is needed. Exchanging the running application on a node by transmitting the complete program image is not efficient for small changes in the code. It consumes a lot of bandwidth and time. The proposed framework, Adaptive SmartMote, defines and supports control JOBs that allow computation, behaviors. The goal of this paper is to use programmable packet to update sensor behaviors. To reduce the code transferred and power consumption, we propose a group management architecture. This architecture helps reduce power consumption and increase node number that control by Leader Node in WASNs. The proposed update protocol has been implemented on the Tmote-based Octopus II sensor node, which is named SmartMote, which runs TinyOS , a component-based operating system for highly constraint embedded platform.