Flexible frame structure to reduce energy consumption in wireless sensor network for monitoring agriculture