Browse Source

Correct non-ssl connection

v_master
Sara Damiano 6 years ago
parent
commit
2e03cdeaba
11 changed files with 15 additions and 14 deletions
  1. +5
    -4
      examples/WebClient/WebClient.ino
  2. +1
    -1
      src/TinyGsmClientBG96.h
  3. +1
    -1
      src/TinyGsmClientESP8266.h
  4. +1
    -1
      src/TinyGsmClientM95.h
  5. +1
    -1
      src/TinyGsmClientMC60.h
  6. +1
    -1
      src/TinyGsmClientSIM7000.h
  7. +1
    -1
      src/TinyGsmClientSIM800.h
  8. +1
    -1
      src/TinyGsmClientSaraR4.h
  9. +1
    -1
      src/TinyGsmClientSequansMonarch.h
  10. +1
    -1
      src/TinyGsmClientUBLOX.h
  11. +1
    -1
      src/TinyGsmClientXBee.h

+ 5
- 4
examples/WebClient/WebClient.ino View File

@ -138,7 +138,7 @@ void loop() {
#endif #endif
SerialMon.print("Waiting for network..."); SerialMon.print("Waiting for network...");
if (!modem.waitForNetwork()) {
if (!modem.waitForNetwork(240000L)) {
SerialMon.println(" fail"); SerialMon.println(" fail");
delay(10000); delay(10000);
return; return;
@ -146,12 +146,12 @@ void loop() {
SerialMon.println(" OK"); SerialMon.println(" OK");
if (modem.isNetworkConnected()) { if (modem.isNetworkConnected()) {
SerialMon.print("Network connected");
SerialMon.println("Network connected");
} }
#if TINY_GSM_USE_GPRS #if TINY_GSM_USE_GPRS
SerialMon.print(F("Connecting to ")); SerialMon.print(F("Connecting to "));
SerialMon.print(apn);
SerialMon.println(apn);
if (!modem.gprsConnect(apn, gprsUser, gprsPass)) { if (!modem.gprsConnect(apn, gprsUser, gprsPass)) {
SerialMon.println(" fail"); SerialMon.println(" fail");
delay(10000); delay(10000);
@ -161,7 +161,7 @@ void loop() {
#endif #endif
SerialMon.print("Connecting to "); SerialMon.print("Connecting to ");
SerialMon.print(server);
SerialMon.println(server);
if (!client.connect(server, port)) { if (!client.connect(server, port)) {
SerialMon.println(" fail"); SerialMon.println(" fail");
delay(10000); delay(10000);
@ -170,6 +170,7 @@ void loop() {
SerialMon.println(" OK"); SerialMon.println(" OK");
// Make a HTTP GET request: // Make a HTTP GET request:
SerialMon.println("Performing HTTP GET request...");
client.print(String("GET ") + resource + " HTTP/1.0\r\n"); client.print(String("GET ") + resource + " HTTP/1.0\r\n");
client.print(String("Host: ") + server + "\r\n"); client.print(String("Host: ") + server + "\r\n");
client.print("Connection: close\r\n\r\n"); client.print("Connection: close\r\n\r\n");


+ 1
- 1
src/TinyGsmClientBG96.h View File

@ -75,7 +75,7 @@ public:
stop(); stop();
TINY_GSM_YIELD(); TINY_GSM_YIELD();
rx.clear(); rx.clear();
sock_connected = at->modemConnect(host, port, mux, timeout_s);
sock_connected = at->modemConnect(host, port, mux, false, timeout_s);
return sock_connected; return sock_connected;
} }


+ 1
- 1
src/TinyGsmClientESP8266.h View File

@ -72,7 +72,7 @@ public:
stop(); stop();
TINY_GSM_YIELD(); TINY_GSM_YIELD();
rx.clear(); rx.clear();
sock_connected = at->modemConnect(host, port, mux, timeout_s);
sock_connected = at->modemConnect(host, port, mux, false, timeout_s);
return sock_connected; return sock_connected;
} }


+ 1
- 1
src/TinyGsmClientM95.h View File

@ -75,7 +75,7 @@ public:
stop(); stop();
TINY_GSM_YIELD(); TINY_GSM_YIELD();
rx.clear(); rx.clear();
sock_connected = at->modemConnect(host, port, mux, timeout_s);
sock_connected = at->modemConnect(host, port, mux, false, timeout_s);
return sock_connected; return sock_connected;
} }


+ 1
- 1
src/TinyGsmClientMC60.h View File

@ -79,7 +79,7 @@ public:
stop(); stop();
TINY_GSM_YIELD(); TINY_GSM_YIELD();
rx.clear(); rx.clear();
sock_connected = at->modemConnect(host, port, mux, timeout_s);
sock_connected = at->modemConnect(host, port, mux, false, timeout_s);
return sock_connected; return sock_connected;
} }


+ 1
- 1
src/TinyGsmClientSIM7000.h View File

@ -80,7 +80,7 @@ public:
stop(); stop();
TINY_GSM_YIELD(); TINY_GSM_YIELD();
rx.clear(); rx.clear();
sock_connected = at->modemConnect(host, port, mux, timeout_s);
sock_connected = at->modemConnect(host, port, mux, false, timeout_s);
return sock_connected; return sock_connected;
} }


+ 1
- 1
src/TinyGsmClientSIM800.h View File

@ -81,7 +81,7 @@ public:
stop(); stop();
TINY_GSM_YIELD(); TINY_GSM_YIELD();
rx.clear(); rx.clear();
sock_connected = at->modemConnect(host, port, mux, timeout_s);
sock_connected = at->modemConnect(host, port, mux, false, timeout_s);
return sock_connected; return sock_connected;
} }


+ 1
- 1
src/TinyGsmClientSaraR4.h View File

@ -94,7 +94,7 @@ public:
rx.clear(); rx.clear();
uint8_t oldMux = mux; uint8_t oldMux = mux;
sock_connected = at->modemConnect(host, port, &mux, timeout_s);
sock_connected = at->modemConnect(host, port, &mux, false, timeout_s);
if (mux != oldMux) { if (mux != oldMux) {
DBG("WARNING: Mux number changed from", oldMux, "to", mux); DBG("WARNING: Mux number changed from", oldMux, "to", mux);
at->sockets[oldMux] = NULL; at->sockets[oldMux] = NULL;


+ 1
- 1
src/TinyGsmClientSequansMonarch.h View File

@ -87,7 +87,7 @@ public:
if (sock_connected) stop(); if (sock_connected) stop();
TINY_GSM_YIELD(); TINY_GSM_YIELD();
rx.clear(); rx.clear();
sock_connected = at->modemConnect(host, port, mux, timeout_s);
sock_connected = at->modemConnect(host, port, mux, false, timeout_s);
return sock_connected; return sock_connected;
} }


+ 1
- 1
src/TinyGsmClientUBLOX.h View File

@ -78,7 +78,7 @@ public:
rx.clear(); rx.clear();
uint8_t oldMux = mux; uint8_t oldMux = mux;
sock_connected = at->modemConnect(host, port, &mux, timeout_s);
sock_connected = at->modemConnect(host, port, &mux, false, timeout_s);
if (mux != oldMux) { if (mux != oldMux) {
DBG("WARNING: Mux number changed from", oldMux, "to", mux); DBG("WARNING: Mux number changed from", oldMux, "to", mux);
at->sockets[oldMux] = NULL; at->sockets[oldMux] = NULL;


+ 1
- 1
src/TinyGsmClientXBee.h View File

@ -99,7 +99,7 @@ public:
virtual int connect(const char *host, uint16_t port, int timeout_s) { virtual int connect(const char *host, uint16_t port, int timeout_s) {
// NOTE: Not caling stop() or yeild() here // NOTE: Not caling stop() or yeild() here
at->streamClear(); // Empty anything in the buffer before starting at->streamClear(); // Empty anything in the buffer before starting
sock_connected = at->modemConnect(host, port, mux, timeout_s);
sock_connected = at->modemConnect(host, port, mux, false, timeout_s);
return sock_connected; return sock_connected;
} }
virtual int connect(const char *host, uint16_t port) { virtual int connect(const char *host, uint16_t port) {


Loading…
Cancel
Save