From 310012af177a1f6cb2b39a95ec35c3fb6ed1f267 Mon Sep 17 00:00:00 2001 From: Volodymyr Shymanskyy Date: Sat, 4 Feb 2017 13:00:01 +0200 Subject: [PATCH] Update example --- examples/WebClient/WebClient.ino | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/WebClient/WebClient.ino b/examples/WebClient/WebClient.ino index 0c78f55..0e58bfa 100644 --- a/examples/WebClient/WebClient.ino +++ b/examples/WebClient/WebClient.ino @@ -35,6 +35,8 @@ TinyGsmClient client(modem); const char server[] = "cdn.rawgit.com"; const char resource[] = "/vshymanskyy/tinygsm/master/extras/logo.txt"; +int port = 80; + void setup() { // Set console baud rate Serial.begin(115200); @@ -46,7 +48,7 @@ void setup() { // Restart takes quite some time // To skip it, call init() instead of restart() - Serial.println("Initializing modem..."); + Serial.println(F("Initializing modem...")); modem.restart(); // Unlock your SIM card with a PIN @@ -54,7 +56,7 @@ void setup() { } void loop() { - Serial.print("Waiting for network..."); + Serial.print(F("Waiting for network...")); if (!modem.waitForNetwork()) { Serial.println(" fail"); delay(10000); @@ -62,7 +64,7 @@ void loop() { } Serial.println(" OK"); - Serial.print("Connecting to "); + Serial.print(F("Connecting to ")); Serial.print(apn); if (!modem.gprsConnect(apn, user, pass)) { Serial.println(" fail"); @@ -71,9 +73,9 @@ void loop() { } Serial.println(" OK"); - Serial.print("Connecting to "); + Serial.print(F("Connecting to ")); Serial.print(server); - if (!client.connect(server, 80)) { + if (!client.connect(server, port)) { Serial.println(" fail"); delay(10000); return;