Achieving robustness through caching and retransmissions in IEEE 802.15.4-based WSNs