   Serial.println("get_ip_port");
   get_ip_port(url, ip, &port);
   Serial.println("mqtt begin");
-  g_mqtt_client.begin("182.92.180.87", 1883, g_net_client);
+  g_mqtt_client.begin(ip, 1883, g_net_client);
 
   Serial.println("mqtt connect");
   while (!g_mqtt_client.connect(g_client_id, g_username, g_password)) {
     Serial.println(".");
     LGPRS.attachGPRS(g_gprs_apn, g_gprs_username, g_gprs_password);
+    delay(200);
   }
 
   Serial.println("yunba ok");

#include "SPI.h"
#include <ArduinoJson.h>
#include <LGPRS.h>
#include <LGPRSClient.h>
#include <LGPS.h>
#include <MQTTClient.h>

typedef enum {
  STATUS_INVALID,
  STATUS_INIT_GPRS,
  STATUS_INIT_YUNBA,
  STATUS_IDLE
} STATUS;

STATUS g_status = STATUS_INVALID;

  //  delay(10000);
  Serial.println("setup...");

  pinMode(PIN_MOTOR, OUTPUT);
  stop_motor();
  pinMode(PIN_LOCK_STATUS, INPUT);
  pinMode(PIN_LOCK_STEP, INPUT);
  pinMode(PIN_BUZZER, OUTPUT);
  digitalWrite(PIN_BUZZER, LOW);

  g_status = STATUS_INIT_GPRS;
}

void loop() {
  // put your main code here, to run repeatedly:
  //  Serial.println("loop...");
  switch (g_status) {
    case STATUS_INIT_GPRS:
      init_gprs();
