Skip to main content
deleted 147 characters in body; edited title
Source Link
ocrdu
  • 1.8k
  • 3
  • 12
  • 24

http post HTTP POST maximum speed at command sim com a7672SIMCom A7672

I'm trying to build a device for my startup IoT-related, using a7672s, here code :an A7672S.

mySerial.println("AT+HTTPINIT");
  checkresponse("OK\r\n");
  mySerial.println("AT+HTTPPARA=\"URL\",\"http://" + host + resources + "\"");
  checkresponse("OK\r\n");
  mySerial.println("AT+HTTPPARA=\"CONTENT\",\"application/json\"");
  checkresponse("OK\r\n");
  String st = "AT+HTTPDATA=";
  int pdl = postdata.length();
  st += String(pdl);
  st += ",15000";
  mySerial.println(st);
  checkresponse("DOWNLOAD");
  mySerial.println(postdata);
  checkresponse("OK\r\n");
  mySerial.println("AT+HTTPACTION=1");
  checkresponse("+HTTPACTION: 1,200");
  if (BuildINString2.indexOf("+HTTPACTION: 1,200") != -1) 
  { Serial.println("POST DONE");}
  else
  { Serial.print("ERROR POST: "); 
    Serial.println(BuildINString2);
  }
  mySerial.println("AT+HTTPTERM");
  checkresponse("OK\r\n");

// In the check function, we pass Here is the check variable to check different possible responses of sim like ok, error, etccode:

void checkresponse( String check ){  
  int start = millis();
  BuildINString2="";
  while(true){
    if(mySerial.available()>0){
      inData =mySerial.read();
      BuildINString2 = BuildINString2 + char(inData);    
      }
    if (BuildINString2.indexOf(check)!=-1)  
       { delay(100); return; }
    if (millis()-start>3000)  
       { delay(100); Serial.println("SIM TIMEOUT"); return; }
    }
}
mySerial.println("AT+HTTPINIT";
checkresponse("OK\r\n");

mySerial.println("AT+HTTPPARA=\"URL\",\"http://" + host + resources + "\"");
checkresponse("OK\r\n");
  
mySerial.println("AT+HTTPPARA=\"CONTENT\",\"application/json\"");
checkresponse("OK\r\n");

String st = "AT+HTTPDATA=";
int pdl = postdata.length();
st += String(pdl);
st += ",15000";
mySerial.println(st);
checkresponse("DOWNLOAD");

mySerial.println(postdata);
checkresponse("OK\r\n");

mySerial.println("AT+HTTPACTION=1");
checkresponse("+HTTPACTION: 1,200");

if (BuildINString2.indexOf("+HTTPACTION: 1,200") != -1) {
  Serial.println("POST DONE");
} else
  Serial.print("ERROR POST: "); 
  Serial.println(BuildINString2);
}

mySerial.println("AT+HTTPTERM");
checkresponse("OK\r\n");
    
// In the check function, we pass the check variable to check different possible responses of sim like ok, error, etc
    
void checkresponse(String check) {  
  int start = millis();
  BuildINString2="";
  while (true) {
    if (mySerial.available() > 0) {
      inData =mySerial.read();
      BuildINString2 = BuildINString2 + char(inData);    
    }

    if (BuildINString2.indexOf(check)! = -1) {
      delay(100);
      return;
    }

    if (millis()-start > 3000) { 
      delay(100);   
      Serial.println("SIM TIMEOUT");
      return;
    }
  }
}

How can we speed up the postPOST time? becozBecause in my last module sim7600(SIM7600), I used CHTTPACTION, that which was postedPOSTing in less than 500 millisecondsms, but inon the A7672s, it's taking more than 1 second,s.

canCan someone confirm possible issues or any other method of makingfor the fast posting of data? also

Also, in this httpHTTP method, is HTTPTERM is required for every postPOST or change in URL point or when it's required? http

http post maximum speed at command sim com a7672

I'm trying to build a device for my startup IoT-related, using a7672s, here code :

mySerial.println("AT+HTTPINIT");
  checkresponse("OK\r\n");
  mySerial.println("AT+HTTPPARA=\"URL\",\"http://" + host + resources + "\"");
  checkresponse("OK\r\n");
  mySerial.println("AT+HTTPPARA=\"CONTENT\",\"application/json\"");
  checkresponse("OK\r\n");
  String st = "AT+HTTPDATA=";
  int pdl = postdata.length();
  st += String(pdl);
  st += ",15000";
  mySerial.println(st);
  checkresponse("DOWNLOAD");
  mySerial.println(postdata);
  checkresponse("OK\r\n");
  mySerial.println("AT+HTTPACTION=1");
  checkresponse("+HTTPACTION: 1,200");
  if (BuildINString2.indexOf("+HTTPACTION: 1,200") != -1) 
  { Serial.println("POST DONE");}
  else
  { Serial.print("ERROR POST: "); 
    Serial.println(BuildINString2);
  }
  mySerial.println("AT+HTTPTERM");
  checkresponse("OK\r\n");

// In the check function, we pass the check variable to check different possible responses of sim like ok, error, etc

void checkresponse( String check ){  
  int start = millis();
  BuildINString2="";
  while(true){
    if(mySerial.available()>0){
      inData =mySerial.read();
      BuildINString2 = BuildINString2 + char(inData);    
      }
    if (BuildINString2.indexOf(check)!=-1)  
       { delay(100); return; }
    if (millis()-start>3000)  
       { delay(100); Serial.println("SIM TIMEOUT"); return; }
    }
}

How can we speed up the post time? becoz in my last module sim7600, I used CHTTPACTION, that was posted in less than 500 milliseconds but in A7672s, it's taking more than 1 second,

can someone confirm possible issues or any other method of making the fast posting of data? also in this http method, is HTTPTERM is required for every post or change in URL point or when it's required? http

HTTP POST maximum speed at command SIMCom A7672

I'm trying to build a device for my startup IoT-related, using an A7672S.

Here is the code:

mySerial.println("AT+HTTPINIT";
checkresponse("OK\r\n");

mySerial.println("AT+HTTPPARA=\"URL\",\"http://" + host + resources + "\"");
checkresponse("OK\r\n");
  
mySerial.println("AT+HTTPPARA=\"CONTENT\",\"application/json\"");
checkresponse("OK\r\n");

String st = "AT+HTTPDATA=";
int pdl = postdata.length();
st += String(pdl);
st += ",15000";
mySerial.println(st);
checkresponse("DOWNLOAD");

mySerial.println(postdata);
checkresponse("OK\r\n");

mySerial.println("AT+HTTPACTION=1");
checkresponse("+HTTPACTION: 1,200");

if (BuildINString2.indexOf("+HTTPACTION: 1,200") != -1) {
  Serial.println("POST DONE");
} else
  Serial.print("ERROR POST: "); 
  Serial.println(BuildINString2);
}

mySerial.println("AT+HTTPTERM");
checkresponse("OK\r\n");
    
// In the check function, we pass the check variable to check different possible responses of sim like ok, error, etc
    
void checkresponse(String check) {  
  int start = millis();
  BuildINString2="";
  while (true) {
    if (mySerial.available() > 0) {
      inData =mySerial.read();
      BuildINString2 = BuildINString2 + char(inData);    
    }

    if (BuildINString2.indexOf(check)! = -1) {
      delay(100);
      return;
    }

    if (millis()-start > 3000) { 
      delay(100);   
      Serial.println("SIM TIMEOUT");
      return;
    }
  }
}

How can we speed up the POST time? Because in my last module (SIM7600), I used CHTTPACTION which was POSTing in less than 500 ms, but on the A7672s, it's taking more than 1 s.

Can someone confirm possible issues or any other method for the fast posting of data?

Also, in this HTTP method, is HTTPTERM required for every POST or change in URL point or when it's required?

Source Link

http post maximum speed at command sim com a7672

I'm trying to build a device for my startup IoT-related, using a7672s, here code :

mySerial.println("AT+HTTPINIT");
  checkresponse("OK\r\n");
  mySerial.println("AT+HTTPPARA=\"URL\",\"http://" + host + resources + "\"");
  checkresponse("OK\r\n");
  mySerial.println("AT+HTTPPARA=\"CONTENT\",\"application/json\"");
  checkresponse("OK\r\n");
  String st = "AT+HTTPDATA=";
  int pdl = postdata.length();
  st += String(pdl);
  st += ",15000";
  mySerial.println(st);
  checkresponse("DOWNLOAD");
  mySerial.println(postdata);
  checkresponse("OK\r\n");
  mySerial.println("AT+HTTPACTION=1");
  checkresponse("+HTTPACTION: 1,200");
  if (BuildINString2.indexOf("+HTTPACTION: 1,200") != -1) 
  { Serial.println("POST DONE");}
  else
  { Serial.print("ERROR POST: "); 
    Serial.println(BuildINString2);
  }
  mySerial.println("AT+HTTPTERM");
  checkresponse("OK\r\n");

// In the check function, we pass the check variable to check different possible responses of sim like ok, error, etc

void checkresponse( String check ){  
  int start = millis();
  BuildINString2="";
  while(true){
    if(mySerial.available()>0){
      inData =mySerial.read();
      BuildINString2 = BuildINString2 + char(inData);    
      }
    if (BuildINString2.indexOf(check)!=-1)  
       { delay(100); return; }
    if (millis()-start>3000)  
       { delay(100); Serial.println("SIM TIMEOUT"); return; }
    }
}

How can we speed up the post time? becoz in my last module sim7600, I used CHTTPACTION, that was posted in less than 500 milliseconds but in A7672s, it's taking more than 1 second,

can someone confirm possible issues or any other method of making the fast posting of data? also in this http method, is HTTPTERM is required for every post or change in URL point or when it's required? http