     Serial.print("Size: ");
     Serial.println(strlen(buffer));
 
+    if (!fona_enabled) {
+      fona_enabled = enable_fona();
+    }
+
     // Send message
-    if (!fona.sendSMS(destination, buffer)) {
+    for (i = 0; i < NUM_RETRIES; i++) {
+      if (fona.sendSMS(destination, buffer)) {
+        break;
+      }
+      delay(1000);
+    }
+    if (i >= NUM_RETRIES) {
       Serial.println(F("SMS failed"));
     } else {
       Serial.println(F("SMS sent!"));
     }
 
-    if (!send_http_post(http_post_url, id, buffer)) {
+    for (i = 0; i < NUM_RETRIES; i++) {
+      if (send_http_post(http_post_url, id, buffer)) {
+        break;
+      }
+      delay(1000);
+    }
+    if (i >= NUM_RETRIES) {
       Serial.println(F("HTTP POST Failed"));
     } else {
       Serial.println(F("HTTP POST Sent!"));

}

void loop() {
  if (time_elapsed >= SEND_INTERVAL) {
    time_elapsed = 0;
    // Get readings from weather shield.
    calc_sensors();

    // Enable fona
    enable_fona();
    // Get time.
    fona.getTime(buffer+1, 25);



#include "FreqCount.h"

// Interval between consecutive data sends (in seconds)
#define SEND_INTERVAL 60
#define NUM_RETRIES 5

// Defines to enable or disable sensors
#define HUMIDITY_SENSOR 0
