An opportunistic reconfiguration strategy for environmentally powered devices