We provide a joint scheme for rate control, scheduling, routing, and power control protocol for wireless sensor networks based on compressive sensing. Using a network utility maximization formulation, we present cross-layer optimization solutions using Lagrangian multipliers in the transport, network, media access control, and physical layers. Inspired by compressive sensing, we focus on the construction of utility functions based on the constraints of the link capacity, rate, routing, and power to decrease the computational cost, accelerate the convergence rate, and degrade the error ratio. The optimization solutions are developed by solving the optimization model of network utility maximization. We prove the effectiveness by the theory analysis at the stability of the transmission rate and error ratio. Finally, simulation results demonstrate the performance in terms of stability of the error ratio of compressive sensing, energy consumption, and transmission delay in wireless sensor networks.