From 3af2e7779c3e3ea6f74bd00fa9d1dc7ff08bae4f Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 25 Mar 2019 18:08:36 +0100 Subject: [PATCH 01/20] add new CloudBlink example --- examples/MKRWIFI1010_Cloud_Blink.ino | 103 +++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 examples/MKRWIFI1010_Cloud_Blink.ino diff --git a/examples/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink.ino new file mode 100644 index 000000000..a75501c97 --- /dev/null +++ b/examples/MKRWIFI1010_Cloud_Blink.ino @@ -0,0 +1,103 @@ +#include +#include + +///////please enter your sensitive data in the Secret tab/arduino_secrets.h +char ssid[] = SECRET_WIFI_NAME; // your network SSID (name) +char pass[] = SECRET_PASSWORD; // your network password (use for WPA, or use as key for WEP) + +String cloudSerialBuffer=""; // the string used to compose network messages from the received characters + +ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD); + +void setup(){ + setDebugMessageLevel(3); + //Serial.begin(9600); + delay(1500); + ArduinoCloud.begin(ArduinoIoTPreferredConnection); + //CloudSerial.begin(9600); //Already done by ArduinoIotCloud.cpp (line 332) + CloudSerial.print("I'm ready for blinking!\n"); +} + +void loop(){ + ArduinoCloud.update(); + // check if there is something waiting to be read + if (CloudSerial.available()) { + char character = CloudSerial.read(); + cloudSerialBuffer += character; + // if a \n character has been received, there should be a complete command inside cloudSerialBuffer + if (character == '\n') { + handleString(); + } + } + else // if there is nothing to read, it could be that the last command didn't end with a '\n'. Check. + { + handleString(); + } + // Just to be able to simulate the board responses through the serial monitor + if (Serial.available()) { + CloudSerial.write(Serial.read()); + } +} +void handleString() { + // Don't proceed if the string is empty + if (cloudSerialBuffer.equals("")) return; + // Remove leading and trailing whitespaces + cloudSerialBuffer.trim(); + // Make it uppercase; + cloudSerialBuffer.toUpperCase(); + if (cloudSerialBuffer.equals("ON")) digitalWrite(LED_BUILTIN, HIGH); + else if (cloudSerialBuffer.equals("OFF")) digitalWrite(LED_BUILTIN, LOW); + sendString(cloudSerialBuffer); + // Reset cloudSerialBuffer + cloudSerialBuffer = ""; +} +// sendString sends a string to the Arduino Cloud. +void sendString(String stringToSend) { + // send the characters one at a time + char lastSentChar = 0; + for (int i = 0; i < stringToSend.length(); i++) { + lastSentChar = stringToSend.charAt(i); + CloudSerial.write(lastSentChar); + } + // if the last sent character wasn't a '\n' add it + if (lastSentChar != '\n') { + CloudSerial.write('\n'); + } +} + +/* +OLD | NEW +"WiFi shield not present" --> "WiFi Hardware not available\nMake sure you are using a WiFi enabled board/shield", 0 +"Starting Arduino Cloud..." --> +"Attempting to connect to WPA SSID: " --> "Connecting to \"%s\"", 2 +"Failed to connect to Wifi!" --> "Connection to \"%s\" failed", 0 +"You're connected to the network" --> "Connected to \"%s\"", 2 +"Attempting to connect to Arduino Cloud" --> "Connecting to Arduino IoT Cloud...", 0 +"Starting get time" --> "Acquiring Time from Network", 3 +"Failed to connect to Arduino Cloud!" --> "Cloud Error. Retrying...", 0 +"Successfully connected to Arduino Cloud :)" --> "Connected to Arduino IoT Cloud", 0 + + + + +*/ + +/* se tutto va bene + +[ 2566 ] WiFi.status(): 0 + +[ 2566 ] Current WiFi Firmware: 1.2.1 + +[ 2567 ] Connecting to "BCMI" + +[ 12642 ] Connected to "BCMI" + +[ 12642 ] Acquiring Time from Network +. +[ 12743 ] Network Time: 1550241011 + +[ 12938 ] Connecting to Arduino IoT Cloud... +Compile time: 1553472000 + +[ 15990 ] Connected to Arduino IoT Cloud +*/ \ No newline at end of file From 032a02441b0f1a410630e44f86413075620291d0 Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 25 Mar 2019 18:13:38 +0100 Subject: [PATCH 02/20] remove some comments --- examples/MKRWIFI1010_Cloud_Blink.ino | 42 +--------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/examples/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink.ino index a75501c97..9fd6c198f 100644 --- a/examples/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/MKRWIFI1010_Cloud_Blink.ino @@ -11,10 +11,8 @@ ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SEC void setup(){ setDebugMessageLevel(3); - //Serial.begin(9600); delay(1500); ArduinoCloud.begin(ArduinoIoTPreferredConnection); - //CloudSerial.begin(9600); //Already done by ArduinoIotCloud.cpp (line 332) CloudSerial.print("I'm ready for blinking!\n"); } @@ -62,42 +60,4 @@ void sendString(String stringToSend) { // if the last sent character wasn't a '\n' add it if (lastSentChar != '\n') { CloudSerial.write('\n'); - } -} - -/* -OLD | NEW -"WiFi shield not present" --> "WiFi Hardware not available\nMake sure you are using a WiFi enabled board/shield", 0 -"Starting Arduino Cloud..." --> -"Attempting to connect to WPA SSID: " --> "Connecting to \"%s\"", 2 -"Failed to connect to Wifi!" --> "Connection to \"%s\" failed", 0 -"You're connected to the network" --> "Connected to \"%s\"", 2 -"Attempting to connect to Arduino Cloud" --> "Connecting to Arduino IoT Cloud...", 0 -"Starting get time" --> "Acquiring Time from Network", 3 -"Failed to connect to Arduino Cloud!" --> "Cloud Error. Retrying...", 0 -"Successfully connected to Arduino Cloud :)" --> "Connected to Arduino IoT Cloud", 0 - - - - -*/ - -/* se tutto va bene - -[ 2566 ] WiFi.status(): 0 - -[ 2566 ] Current WiFi Firmware: 1.2.1 - -[ 2567 ] Connecting to "BCMI" - -[ 12642 ] Connected to "BCMI" - -[ 12642 ] Acquiring Time from Network -. -[ 12743 ] Network Time: 1550241011 - -[ 12938 ] Connecting to Arduino IoT Cloud... -Compile time: 1553472000 - -[ 15990 ] Connected to Arduino IoT Cloud -*/ \ No newline at end of file + } \ No newline at end of file From 0095a53ac2b95f8300fb0fde8812b6a089818324 Mon Sep 17 00:00:00 2001 From: umbynos Date: Wed, 3 Apr 2019 10:30:26 +0200 Subject: [PATCH 03/20] fix errors and improvements --- examples/MKRWIFI1010_Cloud_Blink.ino | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink.ino index 9fd6c198f..948599b18 100644 --- a/examples/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/MKRWIFI1010_Cloud_Blink.ino @@ -2,17 +2,19 @@ #include ///////please enter your sensitive data in the Secret tab/arduino_secrets.h -char ssid[] = SECRET_WIFI_NAME; // your network SSID (name) -char pass[] = SECRET_PASSWORD; // your network password (use for WPA, or use as key for WEP) - -String cloudSerialBuffer=""; // the string used to compose network messages from the received characters +char ssid[] = SECRET_WIFI_NAME; // your network SSID (name) +char pass[] = SECRET_PASSWORD; // your network password (use for WPA, or use as key for WEP) +String cloudSerialBuffer=""; // the string used to compose network messages from the received characters +// handles connection to the network ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD); void setup(){ - setDebugMessageLevel(3); - delay(1500); - ArduinoCloud.begin(ArduinoIoTPreferredConnection); + setDebugMessageLevel(3); // used to set a level of granularity in information output [0...4] + Serial.begin(9600); + while (!Serial); // waits for the serial to become available + ArduinoCloud.begin(ArduinoIoTPreferredConnection); // initialize a connection to the Arduino IoT Cloud + while(ArduinoCloud.connected()); // needed to wait for the inizialization of CloudSerial CloudSerial.print("I'm ready for blinking!\n"); } @@ -60,4 +62,5 @@ void sendString(String stringToSend) { // if the last sent character wasn't a '\n' add it if (lastSentChar != '\n') { CloudSerial.write('\n'); - } \ No newline at end of file + } +} \ No newline at end of file From 4e02f2cf4b1060810caa3f262d5ec743652fc128 Mon Sep 17 00:00:00 2001 From: umbynos Date: Wed, 3 Apr 2019 11:00:41 +0200 Subject: [PATCH 04/20] move example sketch in proper folder --- .../{ => MKRWIFI1010_Cloud_Blink}/MKRWIFI1010_Cloud_Blink.ino | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{ => MKRWIFI1010_Cloud_Blink}/MKRWIFI1010_Cloud_Blink.ino (100%) diff --git a/examples/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino similarity index 100% rename from examples/MKRWIFI1010_Cloud_Blink.ino rename to examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino From f0cfd2114096725041869fe6858e85c462f0887e Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 25 Mar 2019 18:08:36 +0100 Subject: [PATCH 05/20] add new CloudBlink example --- examples/MKRWIFI1010_Cloud_Blink.ino | 103 +++++++++++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 examples/MKRWIFI1010_Cloud_Blink.ino diff --git a/examples/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink.ino new file mode 100644 index 000000000..a75501c97 --- /dev/null +++ b/examples/MKRWIFI1010_Cloud_Blink.ino @@ -0,0 +1,103 @@ +#include +#include + +///////please enter your sensitive data in the Secret tab/arduino_secrets.h +char ssid[] = SECRET_WIFI_NAME; // your network SSID (name) +char pass[] = SECRET_PASSWORD; // your network password (use for WPA, or use as key for WEP) + +String cloudSerialBuffer=""; // the string used to compose network messages from the received characters + +ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD); + +void setup(){ + setDebugMessageLevel(3); + //Serial.begin(9600); + delay(1500); + ArduinoCloud.begin(ArduinoIoTPreferredConnection); + //CloudSerial.begin(9600); //Already done by ArduinoIotCloud.cpp (line 332) + CloudSerial.print("I'm ready for blinking!\n"); +} + +void loop(){ + ArduinoCloud.update(); + // check if there is something waiting to be read + if (CloudSerial.available()) { + char character = CloudSerial.read(); + cloudSerialBuffer += character; + // if a \n character has been received, there should be a complete command inside cloudSerialBuffer + if (character == '\n') { + handleString(); + } + } + else // if there is nothing to read, it could be that the last command didn't end with a '\n'. Check. + { + handleString(); + } + // Just to be able to simulate the board responses through the serial monitor + if (Serial.available()) { + CloudSerial.write(Serial.read()); + } +} +void handleString() { + // Don't proceed if the string is empty + if (cloudSerialBuffer.equals("")) return; + // Remove leading and trailing whitespaces + cloudSerialBuffer.trim(); + // Make it uppercase; + cloudSerialBuffer.toUpperCase(); + if (cloudSerialBuffer.equals("ON")) digitalWrite(LED_BUILTIN, HIGH); + else if (cloudSerialBuffer.equals("OFF")) digitalWrite(LED_BUILTIN, LOW); + sendString(cloudSerialBuffer); + // Reset cloudSerialBuffer + cloudSerialBuffer = ""; +} +// sendString sends a string to the Arduino Cloud. +void sendString(String stringToSend) { + // send the characters one at a time + char lastSentChar = 0; + for (int i = 0; i < stringToSend.length(); i++) { + lastSentChar = stringToSend.charAt(i); + CloudSerial.write(lastSentChar); + } + // if the last sent character wasn't a '\n' add it + if (lastSentChar != '\n') { + CloudSerial.write('\n'); + } +} + +/* +OLD | NEW +"WiFi shield not present" --> "WiFi Hardware not available\nMake sure you are using a WiFi enabled board/shield", 0 +"Starting Arduino Cloud..." --> +"Attempting to connect to WPA SSID: " --> "Connecting to \"%s\"", 2 +"Failed to connect to Wifi!" --> "Connection to \"%s\" failed", 0 +"You're connected to the network" --> "Connected to \"%s\"", 2 +"Attempting to connect to Arduino Cloud" --> "Connecting to Arduino IoT Cloud...", 0 +"Starting get time" --> "Acquiring Time from Network", 3 +"Failed to connect to Arduino Cloud!" --> "Cloud Error. Retrying...", 0 +"Successfully connected to Arduino Cloud :)" --> "Connected to Arduino IoT Cloud", 0 + + + + +*/ + +/* se tutto va bene + +[ 2566 ] WiFi.status(): 0 + +[ 2566 ] Current WiFi Firmware: 1.2.1 + +[ 2567 ] Connecting to "BCMI" + +[ 12642 ] Connected to "BCMI" + +[ 12642 ] Acquiring Time from Network +. +[ 12743 ] Network Time: 1550241011 + +[ 12938 ] Connecting to Arduino IoT Cloud... +Compile time: 1553472000 + +[ 15990 ] Connected to Arduino IoT Cloud +*/ \ No newline at end of file From 0c3369a1ee827c763e2fdd12073493dd80bd73ef Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 25 Mar 2019 18:13:38 +0100 Subject: [PATCH 06/20] remove some comments --- examples/MKRWIFI1010_Cloud_Blink.ino | 42 +--------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) diff --git a/examples/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink.ino index a75501c97..9fd6c198f 100644 --- a/examples/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/MKRWIFI1010_Cloud_Blink.ino @@ -11,10 +11,8 @@ ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SEC void setup(){ setDebugMessageLevel(3); - //Serial.begin(9600); delay(1500); ArduinoCloud.begin(ArduinoIoTPreferredConnection); - //CloudSerial.begin(9600); //Already done by ArduinoIotCloud.cpp (line 332) CloudSerial.print("I'm ready for blinking!\n"); } @@ -62,42 +60,4 @@ void sendString(String stringToSend) { // if the last sent character wasn't a '\n' add it if (lastSentChar != '\n') { CloudSerial.write('\n'); - } -} - -/* -OLD | NEW -"WiFi shield not present" --> "WiFi Hardware not available\nMake sure you are using a WiFi enabled board/shield", 0 -"Starting Arduino Cloud..." --> -"Attempting to connect to WPA SSID: " --> "Connecting to \"%s\"", 2 -"Failed to connect to Wifi!" --> "Connection to \"%s\" failed", 0 -"You're connected to the network" --> "Connected to \"%s\"", 2 -"Attempting to connect to Arduino Cloud" --> "Connecting to Arduino IoT Cloud...", 0 -"Starting get time" --> "Acquiring Time from Network", 3 -"Failed to connect to Arduino Cloud!" --> "Cloud Error. Retrying...", 0 -"Successfully connected to Arduino Cloud :)" --> "Connected to Arduino IoT Cloud", 0 - - - - -*/ - -/* se tutto va bene - -[ 2566 ] WiFi.status(): 0 - -[ 2566 ] Current WiFi Firmware: 1.2.1 - -[ 2567 ] Connecting to "BCMI" - -[ 12642 ] Connected to "BCMI" - -[ 12642 ] Acquiring Time from Network -. -[ 12743 ] Network Time: 1550241011 - -[ 12938 ] Connecting to Arduino IoT Cloud... -Compile time: 1553472000 - -[ 15990 ] Connected to Arduino IoT Cloud -*/ \ No newline at end of file + } \ No newline at end of file From c51fccc747d34e76652d8f4ef47d94731a09b147 Mon Sep 17 00:00:00 2001 From: umbynos Date: Wed, 3 Apr 2019 10:30:26 +0200 Subject: [PATCH 07/20] fix errors and improvements --- examples/MKRWIFI1010_Cloud_Blink.ino | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/examples/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink.ino index 9fd6c198f..948599b18 100644 --- a/examples/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/MKRWIFI1010_Cloud_Blink.ino @@ -2,17 +2,19 @@ #include ///////please enter your sensitive data in the Secret tab/arduino_secrets.h -char ssid[] = SECRET_WIFI_NAME; // your network SSID (name) -char pass[] = SECRET_PASSWORD; // your network password (use for WPA, or use as key for WEP) - -String cloudSerialBuffer=""; // the string used to compose network messages from the received characters +char ssid[] = SECRET_WIFI_NAME; // your network SSID (name) +char pass[] = SECRET_PASSWORD; // your network password (use for WPA, or use as key for WEP) +String cloudSerialBuffer=""; // the string used to compose network messages from the received characters +// handles connection to the network ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD); void setup(){ - setDebugMessageLevel(3); - delay(1500); - ArduinoCloud.begin(ArduinoIoTPreferredConnection); + setDebugMessageLevel(3); // used to set a level of granularity in information output [0...4] + Serial.begin(9600); + while (!Serial); // waits for the serial to become available + ArduinoCloud.begin(ArduinoIoTPreferredConnection); // initialize a connection to the Arduino IoT Cloud + while(ArduinoCloud.connected()); // needed to wait for the inizialization of CloudSerial CloudSerial.print("I'm ready for blinking!\n"); } @@ -60,4 +62,5 @@ void sendString(String stringToSend) { // if the last sent character wasn't a '\n' add it if (lastSentChar != '\n') { CloudSerial.write('\n'); - } \ No newline at end of file + } +} \ No newline at end of file From 70c9324aeb2635e5f3e5bfa7cdc0941ae0176772 Mon Sep 17 00:00:00 2001 From: umbynos Date: Wed, 3 Apr 2019 11:00:41 +0200 Subject: [PATCH 08/20] move example sketch in proper folder --- .../{ => MKRWIFI1010_Cloud_Blink}/MKRWIFI1010_Cloud_Blink.ino | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{ => MKRWIFI1010_Cloud_Blink}/MKRWIFI1010_Cloud_Blink.ino (100%) diff --git a/examples/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino similarity index 100% rename from examples/MKRWIFI1010_Cloud_Blink.ino rename to examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino From 2112403d48b65aea05cb49ed101f77bb1772f463 Mon Sep 17 00:00:00 2001 From: umbynos Date: Wed, 10 Apr 2019 13:03:26 +0200 Subject: [PATCH 09/20] apply code formatting according to examples_formatter.conf --- .../MKRWIFI1010_Cloud_Blink.ino | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino index 948599b18..9b07ec98d 100644 --- a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino @@ -5,20 +5,20 @@ char ssid[] = SECRET_WIFI_NAME; // your network SSID (name) char pass[] = SECRET_PASSWORD; // your network password (use for WPA, or use as key for WEP) -String cloudSerialBuffer=""; // the string used to compose network messages from the received characters +String cloudSerialBuffer = ""; // the string used to compose network messages from the received characters // handles connection to the network ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD); -void setup(){ +void setup() { setDebugMessageLevel(3); // used to set a level of granularity in information output [0...4] Serial.begin(9600); while (!Serial); // waits for the serial to become available ArduinoCloud.begin(ArduinoIoTPreferredConnection); // initialize a connection to the Arduino IoT Cloud - while(ArduinoCloud.connected()); // needed to wait for the inizialization of CloudSerial + while (ArduinoCloud.connected()); // needed to wait for the inizialization of CloudSerial CloudSerial.print("I'm ready for blinking!\n"); } -void loop(){ +void loop() { ArduinoCloud.update(); // check if there is something waiting to be read if (CloudSerial.available()) { @@ -28,9 +28,7 @@ void loop(){ if (character == '\n') { handleString(); } - } - else // if there is nothing to read, it could be that the last command didn't end with a '\n'. Check. - { + } else { // if there is nothing to read, it could be that the last command didn't end with a '\n'. Check. handleString(); } // Just to be able to simulate the board responses through the serial monitor @@ -40,13 +38,18 @@ void loop(){ } void handleString() { // Don't proceed if the string is empty - if (cloudSerialBuffer.equals("")) return; + if (cloudSerialBuffer.equals("")) { + return; + } // Remove leading and trailing whitespaces cloudSerialBuffer.trim(); // Make it uppercase; cloudSerialBuffer.toUpperCase(); - if (cloudSerialBuffer.equals("ON")) digitalWrite(LED_BUILTIN, HIGH); - else if (cloudSerialBuffer.equals("OFF")) digitalWrite(LED_BUILTIN, LOW); + if (cloudSerialBuffer.equals("ON")) { + digitalWrite(LED_BUILTIN, HIGH); + } else if (cloudSerialBuffer.equals("OFF")) { + digitalWrite(LED_BUILTIN, LOW); + } sendString(cloudSerialBuffer); // Reset cloudSerialBuffer cloudSerialBuffer = ""; From a4388b4e96e0d7af5058534f23e085b455e504da Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Wed, 10 Apr 2019 20:12:23 +0200 Subject: [PATCH 10/20] Update examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino Co-Authored-By: ubidefeo --- examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino index 9b07ec98d..0ef2a9847 100644 --- a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino @@ -16,6 +16,7 @@ void setup() { ArduinoCloud.begin(ArduinoIoTPreferredConnection); // initialize a connection to the Arduino IoT Cloud while (ArduinoCloud.connected()); // needed to wait for the inizialization of CloudSerial CloudSerial.print("I'm ready for blinking!\n"); + pinMode(LED_BUILTIN, OUTPUT); } void loop() { @@ -66,4 +67,4 @@ void sendString(String stringToSend) { if (lastSentChar != '\n') { CloudSerial.write('\n'); } -} \ No newline at end of file +} From 3f3a848f6abed9ed418f3398dbbaabe6f5f8de83 Mon Sep 17 00:00:00 2001 From: per1234 Date: Thu, 11 Apr 2019 06:21:24 +0200 Subject: [PATCH 11/20] Update examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino Co-Authored-By: lxrobotics --- examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino index 0ef2a9847..833618bda 100644 --- a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino @@ -14,7 +14,7 @@ void setup() { Serial.begin(9600); while (!Serial); // waits for the serial to become available ArduinoCloud.begin(ArduinoIoTPreferredConnection); // initialize a connection to the Arduino IoT Cloud - while (ArduinoCloud.connected()); // needed to wait for the inizialization of CloudSerial + while (ArduinoCloud.connected()); // needed to wait for the initialization of CloudSerial CloudSerial.print("I'm ready for blinking!\n"); pinMode(LED_BUILTIN, OUTPUT); } From 5eb39ab7adef9c06642d8d03839d347a829649b5 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 11 Apr 2019 06:23:32 +0200 Subject: [PATCH 12/20] Build 'MKRWIFI1010_Cloud_Blink.ino' with Travis --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 10e2cf9da..30549b75e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,5 +30,6 @@ install: script: - buildExampleSketch ArduinoIoTCloud_LED_switch - buildExampleSketch ArduinoIoTCloud_Travis_CI + - buildExampleSketch MKRWIFI1010_Cloud_Blink - buildExampleUtilitySketch Provisioning From ec30765f322b306081f4d9781d1bc3de7eb2164e Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 11 Apr 2019 06:25:42 +0200 Subject: [PATCH 13/20] MKRWIFI1010_Cloud_Blink is now compilable for both WIFI and GSM enabled boards --- .../MKRWIFI1010_Cloud_Blink.ino | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino index 833618bda..cb388ec1a 100644 --- a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino @@ -1,5 +1,13 @@ #include -#include +#include + +#if defined(BOARD_HAS_WIFI) + #include +#elif defined(BOARD_HAS_GSM) + #include +#else + #error "Arduino IoT Cloud currently only supports MKR1000, MKR WiFi 1010 and MKR GSM 1400" +#endif ///////please enter your sensitive data in the Secret tab/arduino_secrets.h char ssid[] = SECRET_WIFI_NAME; // your network SSID (name) @@ -7,7 +15,11 @@ char pass[] = SECRET_PASSWORD; // your network password (use for WPA, or use as String cloudSerialBuffer = ""; // the string used to compose network messages from the received characters // handles connection to the network -ConnectionManager *ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD); +#if defined(BOARD_HAS_WIFI) + ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD); +#elif defined(BOARD_HAS_GSM) + ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS); +#endif void setup() { setDebugMessageLevel(3); // used to set a level of granularity in information output [0...4] From 318fb5f0658630c980bfd976343eeaec551bb306 Mon Sep 17 00:00:00 2001 From: Alexander Entinger Date: Thu, 11 Apr 2019 06:30:35 +0200 Subject: [PATCH 14/20] Defining arduino secrets blank in case they are undefined and issue a warning - otherwise travis won't build --- .../MKRWIFI1010_Cloud_Blink.ino | 36 +++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino index cb388ec1a..41a5fae2f 100644 --- a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino @@ -9,9 +9,39 @@ #error "Arduino IoT Cloud currently only supports MKR1000, MKR WiFi 1010 and MKR GSM 1400" #endif -///////please enter your sensitive data in the Secret tab/arduino_secrets.h -char ssid[] = SECRET_WIFI_NAME; // your network SSID (name) -char pass[] = SECRET_PASSWORD; // your network password (use for WPA, or use as key for WEP) +#ifdef BOARD_HAS_WIFI + #ifndef SECRET_WIFI_NAME + #define SECRET_WIFI_NAME "" + #warning "You need to define SECRET_WIFI_NAME in tab/arduino_secrets.h" + #endif + + #ifndef SECRET_PASSWORD + #define SECRET_PASSWORD "" + #warning "You need to define SECRET_PASSWORD in tab/arduino_secrets.h" + #endif +#endif + +#ifdef BOARD_HAS_GSM + #ifndef SECRET_PIN + #define SECRET_PIN "" + #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" + #endif + + #ifndef SECRET_APN + #define SECRET_APN "" + #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" + #endif + + #ifndef SECRET_LOGIN + #define SECRET_LOGIN "" + #warning "You need to define SECRET_LOGIN in tab/arduino_secrets.h" + #endif + + #ifndef SECRET_PASS + #define SECRET_PASS "" + #warning "You need to define SECRET_PASS in tab/arduino_secrets.h" + #endif +#endif String cloudSerialBuffer = ""; // the string used to compose network messages from the received characters // handles connection to the network From c029e4604109de13aee1f549625a1079002c7b40 Mon Sep 17 00:00:00 2001 From: umbynos Date: Fri, 12 Apr 2019 17:18:18 +0200 Subject: [PATCH 15/20] split Cloud_Blink sketch, one for GSM and the other one for WiFi enabled boards (MKR1010 and MKR1000) --- .../GSM_Cloud_Blink.ino} | 55 ++++--------- .../WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino | 77 +++++++++++++++++++ 2 files changed, 92 insertions(+), 40 deletions(-) rename examples/{MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino => GSM_Cloud_Blink/GSM_Cloud_Blink.ino} (62%) create mode 100644 examples/WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino diff --git a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino b/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino similarity index 62% rename from examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino rename to examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino index 41a5fae2f..41d44dc88 100644 --- a/examples/MKRWIFI1010_Cloud_Blink/MKRWIFI1010_Cloud_Blink.ino +++ b/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino @@ -1,55 +1,30 @@ #include #include +#include -#if defined(BOARD_HAS_WIFI) - #include -#elif defined(BOARD_HAS_GSM) - #include -#else - #error "Arduino IoT Cloud currently only supports MKR1000, MKR WiFi 1010 and MKR GSM 1400" +#ifndef SECRET_PIN + #define SECRET_PIN "" + #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" #endif -#ifdef BOARD_HAS_WIFI - #ifndef SECRET_WIFI_NAME - #define SECRET_WIFI_NAME "" - #warning "You need to define SECRET_WIFI_NAME in tab/arduino_secrets.h" - #endif - - #ifndef SECRET_PASSWORD - #define SECRET_PASSWORD "" - #warning "You need to define SECRET_PASSWORD in tab/arduino_secrets.h" - #endif +#ifndef SECRET_APN + #define SECRET_APN "" + #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" #endif -#ifdef BOARD_HAS_GSM - #ifndef SECRET_PIN - #define SECRET_PIN "" - #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" - #endif - - #ifndef SECRET_APN - #define SECRET_APN "" - #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" - #endif - - #ifndef SECRET_LOGIN - #define SECRET_LOGIN "" - #warning "You need to define SECRET_LOGIN in tab/arduino_secrets.h" - #endif +#ifndef SECRET_LOGIN + #define SECRET_LOGIN "" + #warning "You need to define SECRET_LOGIN in tab/arduino_secrets.h" +#endif - #ifndef SECRET_PASS - #define SECRET_PASS "" - #warning "You need to define SECRET_PASS in tab/arduino_secrets.h" - #endif +#ifndef SECRET_PASS + #define SECRET_PASS "" + #warning "You need to define SECRET_PASS in tab/arduino_secrets.h" #endif String cloudSerialBuffer = ""; // the string used to compose network messages from the received characters // handles connection to the network -#if defined(BOARD_HAS_WIFI) - ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD); -#elif defined(BOARD_HAS_GSM) - ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS); -#endif +ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS); void setup() { setDebugMessageLevel(3); // used to set a level of granularity in information output [0...4] diff --git a/examples/WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino b/examples/WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino new file mode 100644 index 000000000..b8f9d4239 --- /dev/null +++ b/examples/WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino @@ -0,0 +1,77 @@ +#include +#include +#include + +#ifndef SECRET_WIFI_NAME + #define SECRET_WIFI_NAME "" + #warning "You need to define SECRET_WIFI_NAME in tab/arduino_secrets.h" +#endif + +#ifndef SECRET_PASSWORD + #define SECRET_PASSWORD "" + #warning "You need to define SECRET_PASSWORD in tab/arduino_secrets.h" +#endif + +String cloudSerialBuffer = ""; // the string used to compose network messages from the received characters +// handles connection to the network +ConnectionManager * ArduinoIoTPreferredConnection = new WiFiConnectionManager(SECRET_WIFI_NAME, SECRET_PASSWORD); + +void setup() { + setDebugMessageLevel(3); // used to set a level of granularity in information output [0...4] + Serial.begin(9600); + while (!Serial); // waits for the serial to become available + ArduinoCloud.begin(ArduinoIoTPreferredConnection); // initialize a connection to the Arduino IoT Cloud + while (ArduinoCloud.connected()); // needed to wait for the initialization of CloudSerial + CloudSerial.print("I'm ready for blinking!\n"); + pinMode(LED_BUILTIN, OUTPUT); +} + +void loop() { + ArduinoCloud.update(); + // check if there is something waiting to be read + if (CloudSerial.available()) { + char character = CloudSerial.read(); + cloudSerialBuffer += character; + // if a \n character has been received, there should be a complete command inside cloudSerialBuffer + if (character == '\n') { + handleString(); + } + } else { // if there is nothing to read, it could be that the last command didn't end with a '\n'. Check. + handleString(); + } + // Just to be able to simulate the board responses through the serial monitor + if (Serial.available()) { + CloudSerial.write(Serial.read()); + } +} +void handleString() { + // Don't proceed if the string is empty + if (cloudSerialBuffer.equals("")) { + return; + } + // Remove leading and trailing whitespaces + cloudSerialBuffer.trim(); + // Make it uppercase; + cloudSerialBuffer.toUpperCase(); + if (cloudSerialBuffer.equals("ON")) { + digitalWrite(LED_BUILTIN, HIGH); + } else if (cloudSerialBuffer.equals("OFF")) { + digitalWrite(LED_BUILTIN, LOW); + } + sendString(cloudSerialBuffer); + // Reset cloudSerialBuffer + cloudSerialBuffer = ""; +} +// sendString sends a string to the Arduino Cloud. +void sendString(String stringToSend) { + // send the characters one at a time + char lastSentChar = 0; + for (int i = 0; i < stringToSend.length(); i++) { + lastSentChar = stringToSend.charAt(i); + CloudSerial.write(lastSentChar); + } + // if the last sent character wasn't a '\n' add it + if (lastSentChar != '\n') { + CloudSerial.write('\n'); + } +} From 9197919b00a412fa318a2606812d466a250042eb Mon Sep 17 00:00:00 2001 From: Umberto Baldi <34278123+umbynos@users.noreply.github.com> Date: Fri, 12 Apr 2019 17:33:38 +0200 Subject: [PATCH 16/20] Update .travis.yml --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 30549b75e..aecaac8f1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,7 @@ install: script: - buildExampleSketch ArduinoIoTCloud_LED_switch - buildExampleSketch ArduinoIoTCloud_Travis_CI - - buildExampleSketch MKRWIFI1010_Cloud_Blink + - buildExampleSketch WiFi_Cloud_Blink + - buildExampleSketch GSM_Cloud_Blink - buildExampleUtilitySketch Provisioning From 3c087da66e7b10417b49ecb61a4d192a22debf78 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 15 Apr 2019 12:43:36 +0200 Subject: [PATCH 17/20] Update .travis.yml Co-Authored-By: lxrobotics --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index aecaac8f1..3237c7442 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,10 @@ install: script: - buildExampleSketch ArduinoIoTCloud_LED_switch - buildExampleSketch ArduinoIoTCloud_Travis_CI - - buildExampleSketch WiFi_Cloud_Blink + - | + if [ "$BOARD" == "arduino:samd:mkr1000" ] || [ "$BOARD" == "arduino:samd:mkrwifi1010" ]; + then buildExampleSketch WiFi_Cloud_Blink; + fi - buildExampleSketch GSM_Cloud_Blink - buildExampleUtilitySketch Provisioning From 833522f5413f0c8029157c41307fe205e07fe808 Mon Sep 17 00:00:00 2001 From: per1234 Date: Mon, 15 Apr 2019 12:43:45 +0200 Subject: [PATCH 18/20] Update .travis.yml Co-Authored-By: lxrobotics --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3237c7442..858ecb162 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,6 +34,9 @@ script: if [ "$BOARD" == "arduino:samd:mkr1000" ] || [ "$BOARD" == "arduino:samd:mkrwifi1010" ]; then buildExampleSketch WiFi_Cloud_Blink; fi - - buildExampleSketch GSM_Cloud_Blink + - | + if [ "$BOARD" == "arduino:samd:mkrgsm1400" ]; + then buildExampleSketch GSM_Cloud_Blink; + fi - buildExampleUtilitySketch Provisioning From bc39f7f21cd9fb31d55dca1dc8e3d7bf8ffe2609 Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 15 Apr 2019 15:01:04 +0200 Subject: [PATCH 19/20] fix a problem with CloudSerial not being initialized --- examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino | 50 +++++++++---------- .../WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino | 26 +++++----- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino b/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino index 41d44dc88..50d0b6b7a 100644 --- a/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino +++ b/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino @@ -3,55 +3,55 @@ #include #ifndef SECRET_PIN - #define SECRET_PIN "" - #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" +#define SECRET_PIN "" +#warning "You need to define SECRET_PIN in tab/arduino_secrets.h" #endif #ifndef SECRET_APN - #define SECRET_APN "" - #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" +#define SECRET_APN "" +#warning "You need to define SECRET_PIN in tab/arduino_secrets.h" #endif -#ifndef SECRET_LOGIN - #define SECRET_LOGIN "" - #warning "You need to define SECRET_LOGIN in tab/arduino_secrets.h" +#ifndef SECRET_USER_NAME +#define SECRET_USER_NAME "" +#warning "You need to define SECRET_USER_NAME in tab/arduino_secrets.h" #endif -#ifndef SECRET_PASS - #define SECRET_PASS "" - #warning "You need to define SECRET_PASS in tab/arduino_secrets.h" +#ifndef SECRET_PASSWORD +#define SECRET_PASSWORD "" +#warning "You need to define SECRET_PASSWORD in tab/arduino_secrets.h" #endif String cloudSerialBuffer = ""; // the string used to compose network messages from the received characters // handles connection to the network -ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager(SECRET_PIN, SECRET_APN, SECRET_LOGIN, SECRET_PASS); +ConnectionManager * ArduinoIoTPreferredConnection = new GSMConnectionManager(SECRET_PIN, SECRET_APN, SECRET_USER_NAME, SECRET_PASSWORD); void setup() { setDebugMessageLevel(3); // used to set a level of granularity in information output [0...4] Serial.begin(9600); while (!Serial); // waits for the serial to become available ArduinoCloud.begin(ArduinoIoTPreferredConnection); // initialize a connection to the Arduino IoT Cloud - while (ArduinoCloud.connected()); // needed to wait for the initialization of CloudSerial - CloudSerial.print("I'm ready for blinking!\n"); pinMode(LED_BUILTIN, OUTPUT); } void loop() { ArduinoCloud.update(); // check if there is something waiting to be read - if (CloudSerial.available()) { - char character = CloudSerial.read(); - cloudSerialBuffer += character; - // if a \n character has been received, there should be a complete command inside cloudSerialBuffer - if (character == '\n') { + if (ArduinoCloud.connected()) { + if (CloudSerial.available()) { + char character = CloudSerial.read(); + cloudSerialBuffer += character; + // if a \n character has been received, there should be a complete command inside cloudSerialBuffer + if (character == '\n') { + handleString(); + } + } else { // if there is nothing to read, it could be that the last command didn't end with a '\n'. Check. handleString(); } - } else { // if there is nothing to read, it could be that the last command didn't end with a '\n'. Check. - handleString(); - } - // Just to be able to simulate the board responses through the serial monitor - if (Serial.available()) { - CloudSerial.write(Serial.read()); + // Just to be able to simulate the board responses through the serial monitor + if (Serial.available()) { + CloudSerial.write(Serial.read()); + } } } void handleString() { @@ -84,4 +84,4 @@ void sendString(String stringToSend) { if (lastSentChar != '\n') { CloudSerial.write('\n'); } -} +} \ No newline at end of file diff --git a/examples/WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino b/examples/WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino index b8f9d4239..d73f62d2a 100644 --- a/examples/WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino +++ b/examples/WiFi_Cloud_Blink/WiFi_Cloud_Blink.ino @@ -21,27 +21,27 @@ void setup() { Serial.begin(9600); while (!Serial); // waits for the serial to become available ArduinoCloud.begin(ArduinoIoTPreferredConnection); // initialize a connection to the Arduino IoT Cloud - while (ArduinoCloud.connected()); // needed to wait for the initialization of CloudSerial - CloudSerial.print("I'm ready for blinking!\n"); pinMode(LED_BUILTIN, OUTPUT); } void loop() { ArduinoCloud.update(); // check if there is something waiting to be read - if (CloudSerial.available()) { - char character = CloudSerial.read(); - cloudSerialBuffer += character; - // if a \n character has been received, there should be a complete command inside cloudSerialBuffer - if (character == '\n') { + if (ArduinoCloud.connected()) { + if (CloudSerial.available()) { + char character = CloudSerial.read(); + cloudSerialBuffer += character; + // if a \n character has been received, there should be a complete command inside cloudSerialBuffer + if (character == '\n') { + handleString(); + } + } else { // if there is nothing to read, it could be that the last command didn't end with a '\n'. Check. handleString(); } - } else { // if there is nothing to read, it could be that the last command didn't end with a '\n'. Check. - handleString(); - } - // Just to be able to simulate the board responses through the serial monitor - if (Serial.available()) { - CloudSerial.write(Serial.read()); + // Just to be able to simulate the board responses through the serial monitor + if (Serial.available()) { + CloudSerial.write(Serial.read()); + } } } void handleString() { From fc08f1bf77b03ece333b72ede11c61c1bcfb2f01 Mon Sep 17 00:00:00 2001 From: umbynos Date: Mon, 15 Apr 2019 15:13:03 +0200 Subject: [PATCH 20/20] add code fortmatting for GSM_Cloud_Blink --- examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino b/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino index 50d0b6b7a..95fe61f54 100644 --- a/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino +++ b/examples/GSM_Cloud_Blink/GSM_Cloud_Blink.ino @@ -3,23 +3,23 @@ #include #ifndef SECRET_PIN -#define SECRET_PIN "" -#warning "You need to define SECRET_PIN in tab/arduino_secrets.h" + #define SECRET_PIN "" + #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" #endif #ifndef SECRET_APN -#define SECRET_APN "" -#warning "You need to define SECRET_PIN in tab/arduino_secrets.h" + #define SECRET_APN "" + #warning "You need to define SECRET_PIN in tab/arduino_secrets.h" #endif #ifndef SECRET_USER_NAME -#define SECRET_USER_NAME "" -#warning "You need to define SECRET_USER_NAME in tab/arduino_secrets.h" + #define SECRET_USER_NAME "" + #warning "You need to define SECRET_USER_NAME in tab/arduino_secrets.h" #endif #ifndef SECRET_PASSWORD -#define SECRET_PASSWORD "" -#warning "You need to define SECRET_PASSWORD in tab/arduino_secrets.h" + #define SECRET_PASSWORD "" + #warning "You need to define SECRET_PASSWORD in tab/arduino_secrets.h" #endif String cloudSerialBuffer = ""; // the string used to compose network messages from the received characters