We present the design and implementation of the Janus1 architecture for providing flexible and lightweight access to sensor network resources from Internet-type networks. Janus provides flexibility by focusing on functions of the sensor network rather the data that it contains. This allows us to perform service composition by dynamically combining functions together. In contrast to existing application-specific access techniques, Janus separates the access technique from the sensor network itself by inserting itself between the sensor network and the access network. This attribute allows for application-specific access techniques to be deployed dynamically without requiring the sensor network itself to be upgraded. Although Janus provides RPC-like semantics, unlike typical RPC systems, most of the functionality of Janus is present at the RPC client, which is located outside of the sensor network, in order to keep the RPC server inside the sensor network as lightweight as possible....