   EEPROM.write(3, *((uint8_t *)&cnt + 3));
 }
 
+static void handle_led() {
+  unsigned long now = millis();
+
+  if (now - g_last_led_ms >= g_led_interval) {
+    // save the last time you blinked the LED
+    g_last_led_ms = now;
+
+    // if the LED is off turn it on and vice-versa:
+    if (g_led_state == LOW) {
+      g_led_state = HIGH;
+    } else {
+      g_led_state = LOW;
+    }
+
+    if (g_led_interval = 50) {
+      g_led_fast += 1;
+      if (g_led_fast >= 10) {
+        g_led_interval = 1000;
+      }
+    }
+    digitalWrite(LED_PIN, g_led_state);
+  }
+}
+
 void setup() {
   // put your setup code here, to run once:
   Serial.begin(9600);
   Serial.println("setup...");
+
+  pinMode(LED_PIN, OUTPUT);
+  digitalWrite(LED_PIN, g_led_state);
+  g_last_led_ms = millis();
 
   init_reset_cnt();
   g_status = STATUS_INIT_GPRS;

      check_need_report();
      handle_report();
      check_network();
      break;
    default:
      Serial.println("unknown status: " + g_status);

}

void extMessageReceived(EXTED_CMD cmd, int status, String payload, unsigned int length) {
//  Serial.println("ext msg: " + String(cmd) + ", " + payload);
}

static void init_reset_cnt() {
  uint32_t cnt = 0;
  *((uint8_t *)&cnt + 0) = EEPROM.read(0);
  *((uint8_t *)&cnt + 1) = EEPROM.read(1);
