Browse Source

Added isNetworkConnected for ESP8266

Also shorted time between checks in "isNetworkConnected" for all modems
v_master
SRGDamia1 7 years ago
parent
commit
f7bf8b1df2
16 changed files with 18 additions and 17 deletions
  1. +1
    -1
      TinyGsmClientA6.h
  2. +13
    -12
      TinyGsmClientESP8266.h
  3. +1
    -1
      TinyGsmClientM590.h
  4. +1
    -1
      TinyGsmClientSIM800.h
  5. +1
    -1
      TinyGsmClientU201.h
  6. +1
    -1
      TinyGsmClientXBee.h
  7. BIN
      extras/doc/Digi XBee LTEC1 Users Guide - 90001525.pdf
  8. BIN
      extras/doc/Digi XBee S6B Users Guide - 90002180.pdf
  9. BIN
      extras/doc/ESP8266 - Datasheet v4.3.pdf
  10. BIN
      extras/doc/ESP8266 - Low Power Solutions.pdf
  11. BIN
      extras/doc/SIM800 - AT Commands v1.10.pdf
  12. BIN
      extras/doc/SIM800 AT Commands v1.11.pdf
  13. BIN
      extras/doc/Telit_LE866_AT_Commands_Reference_Guide_r5.pdf
  14. BIN
      extras/doc/UBlox SARA-R4 AT Commands Manual (UBX-17003787).pdf
  15. BIN
      extras/doc/WNC M14A2A AT&T Commands Guide v1.7.pdf
  16. BIN
      extras/doc/u-blox-CEL_ATCommands_(UBX-13002752).pdf

+ 1
- 1
TinyGsmClientA6.h View File

@ -361,7 +361,7 @@ public:
if (isNetworkConnected()) {
return true;
}
delay(500);
delay(250);
}
return false;
}


+ 13
- 12
TinyGsmClientESP8266.h View File

@ -185,7 +185,7 @@ public:
if (!testAT()) {
return false;
}
sendAT(GF("E0"));
sendAT(GF("E0")); // Echo Off
if (waitResponse() != 1) {
return false;
}
@ -209,9 +209,7 @@ public:
}
void maintain() {
//while (stream.available()) {
waitResponse(10, NULL, NULL);
//}
}
bool factoryDefault() {
@ -270,13 +268,22 @@ public:
streamSkipUntil(','); // Skip BSSID/MAC address
streamSkipUntil(','); // Skip Chanel number
int res2 = stream.parseInt(); // Read RSSI
DBG(res2);
waitResponse();
return res2;
}
bool isNetworkConnected() {
return true; // TODO
sendAT(GF("+CIPSTATUS"));
int res1 = waitResponse(3000, GF("STATUS:"));
if (res1 == 1) {
int res2 = waitResponse(GFP(GSM_ERROR), GF("2"), GF("3"), GF("4"), GF("5"));
if (res2 == 2 || res2 == 3 || res2 == 4) return true;
}
// <stat> status of ESP8266 station interface
// 2 : ESP8266 station connected to an AP and has obtained IP
// 3 : ESP8266 station created a TCP or UDP transmission
// 4 : the TCP or UDP transmission of ESP8266 station disconnected (but AP is connected)
// 5 : ESP8266 station did NOT connect to an AP
}
bool waitForNetwork(unsigned long timeout = 60000L) {
@ -287,12 +294,7 @@ public:
int res2 = waitResponse(GFP(GSM_ERROR), GF("2"), GF("3"), GF("4"), GF("5"));
if (res2 == 2 || res2 == 3 || res2 == 4) return true;
}
// <stat> status of ESP8266 station interface
// 2 : ESP8266 station connected to an AP and has obtained IP
// 3 : ESP8266 station created a TCP or UDP transmission
// 4 : the TCP or UDP transmission of ESP8266 station disconnected (but AP is connected)
// 5 : ESP8266 station did NOT connect to an AP
delay(1000);
delay(250);
}
return false;
}
@ -332,7 +334,6 @@ public:
return "";
}
String res2 = stream.readStringUntil('"');
DBG(res2);
waitResponse();
return res2;
}


+ 1
- 1
TinyGsmClientM590.h View File

@ -367,7 +367,7 @@ public:
if (isNetworkConnected()) {
return true;
}
delay(500);
delay(250);
}
return false;
}


+ 1
- 1
TinyGsmClientSIM800.h View File

@ -432,7 +432,7 @@ public:
if (isNetworkConnected()) {
return true;
}
delay(500);
delay(250);
}
return false;
}


+ 1
- 1
TinyGsmClientU201.h View File

@ -372,7 +372,7 @@ public:
if (isNetworkConnected()) {
return true;
}
delay(500);
delay(250);
}
return false;
}


+ 1
- 1
TinyGsmClientXBee.h View File

@ -341,7 +341,7 @@ public:
if (res == GF("0")) {
return true;
}
delay(1000);
delay(250);
}
return false;
}


BIN
extras/doc/Digi XBee LTEC1 Users Guide - 90001525.pdf View File


BIN
extras/doc/Digi XBee S6B Users Guide - 90002180.pdf View File


BIN
extras/doc/ESP8266 - Datasheet v4.3.pdf View File


BIN
extras/doc/ESP8266 - Low Power Solutions.pdf View File


BIN
extras/doc/SIM800 - AT Commands v1.10.pdf View File


BIN
extras/doc/SIM800 AT Commands v1.11.pdf View File


BIN
extras/doc/Telit_LE866_AT_Commands_Reference_Guide_r5.pdf View File


BIN
extras/doc/UBlox SARA-R4 AT Commands Manual (UBX-17003787).pdf View File


BIN
extras/doc/WNC M14A2A AT&T Commands Guide v1.7.pdf View File


BIN
extras/doc/u-blox-CEL_ATCommands_(UBX-13002752).pdf View File


Loading…
Cancel
Save