Skip to content

Commit add9265

Browse files
committed
increase timeout
1 parent f728e35 commit add9265

4 files changed

Lines changed: 10 additions & 9 deletions

File tree

src/Ftp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "Sim800.h"
3232
#include "Result.h"
3333

34+
3435
class FTP : public SIM800
3536
{
3637

src/GPRS.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ Result openGPRSContext(SIM800 *sim800, const char *apn)
5252

5353
sim800->sendATTest();
5454

55-
while ((sim800->sendCmdAndWaitForResp_P(REGISTRATION_STATUS, CONNECTED, 5000) != TRUE &&
56-
sim800->sendCmdAndWaitForResp_P(REGISTRATION_STATUS, ROAMING, 5000) != TRUE) &&
55+
while ((sim800->sendCmdAndWaitForResp_P(REGISTRATION_STATUS, CONNECTED, 10000) != TRUE &&
56+
sim800->sendCmdAndWaitForResp_P(REGISTRATION_STATUS, ROAMING, 10000) != TRUE) &&
5757
attempts < MAX_ATTEMPTS)
5858
{
5959
sim800->sendCmdAndWaitForResp_P(READ_VOLTAGE, AT_OK, 2000);
@@ -67,7 +67,7 @@ Result openGPRSContext(SIM800 *sim800, const char *apn)
6767
}
6868
}
6969

70-
if (sim800->sendCmdAndWaitForResp_P(BEARER_PROFILE_GPRS, AT_OK, 10000) == FALSE)
70+
if (sim800->sendCmdAndWaitForResp_P(BEARER_PROFILE_GPRS, AT_OK, 12000) == FALSE)
7171
result = ERROR_BEARER_PROFILE_GPRS;
7272

7373
char httpApn[64];
@@ -77,10 +77,10 @@ Result openGPRSContext(SIM800 *sim800, const char *apn)
7777
if (sim800->sendCmdAndWaitForResp(httpApn, AT_OK_, 8000) == FALSE)
7878
result = ERROR_BEARER_PROFILE_APN;
7979

80-
while (sim800->sendCmdAndWaitForResp_P(QUERY_BEARER, BEARER_OPEN, 6000) == FALSE && attempts < MAX_ATTEMPTS)
80+
while (sim800->sendCmdAndWaitForResp_P(QUERY_BEARER, BEARER_OPEN, 8000) == FALSE && attempts < MAX_ATTEMPTS)
8181
{
8282
attempts++;
83-
if (sim800->sendCmdAndWaitForResp_P(OPEN_GPRS_CONTEXT, AT_OK, 6000) == FALSE)
83+
if (sim800->sendCmdAndWaitForResp_P(OPEN_GPRS_CONTEXT, AT_OK, 8000) == FALSE)
8484
{
8585
result = ERROR_OPEN_GPRS_CONTEXT;
8686
}

src/Http.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Result HTTP::connect(const char *apn)
5555
{
5656
Result result = openGPRSContext(this, apn);
5757

58-
if (sendCmdAndWaitForResp_P(HTTP_INIT, AT_OK, 5000) == FALSE)
58+
if (sendCmdAndWaitForResp_P(HTTP_INIT, AT_OK, 6000) == FALSE)
5959
result = ERROR_HTTP_INIT;
6060

6161
return result;
@@ -65,7 +65,7 @@ Result HTTP::disconnect()
6565
{
6666
Result result = closeGPRSContext(this);
6767

68-
if (sendCmdAndWaitForResp_P(HTTP_CLOSE, AT_OK, 4000) == FALSE)
68+
if (sendCmdAndWaitForResp_P(HTTP_CLOSE, AT_OK, 5000) == FALSE)
6969
result = ERROR_HTTP_CLOSE;
7070

7171
return result;
@@ -83,7 +83,7 @@ Result HTTP::post(const char *uri, const char *body, char *response)
8383
sprintf_P(buffer, HTTP_DATA, strlen(body), delayToDownload);
8484
strcpy_P(resp, DOWNLOAD);
8585

86-
sendCmdAndWaitForResp(buffer, resp, 4000);
86+
sendCmdAndWaitForResp(buffer, resp, 5000);
8787

8888
purgeSerial();
8989
sendCmd(body);

src/Sim800.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#define DEFAULT_TIMEOUT 5000
3838

3939
// Comment or uncomment this to debug the library
40-
//#define DEBUG true
40+
// #define DEBUG true
4141

4242
/** SIM800 class.
4343
* Used for SIM800 communication. attention that SIM800 module communicate with MCU in serial protocol

0 commit comments

Comments
 (0)