| Algorithm 2. Pseudo code at the sensor node for resubmission of unsuccessfully transmitted packets |
| 1: Call the required libraries, waspXBee, waspSensorPro |
| 2: While (time < 13 min and Stack is not empty) do |
| 3: Read message from the Stack (SD card) |
| 4: Send the message to the gateway |
| 5: If no acknowledgement received or timeout then |
| 6: Go to line 3 |
| 7: Else |
| 8: Remove message from Stack |
| 9: End if |
| 10: End while |