mirror of
				https://github.com/KevinMidboe/TinyGSM.git
				synced 2025-10-29 18:00:18 +00:00 
			
		
		
		
	Success is less confusing than ok
This commit is contained in:
		| @@ -141,7 +141,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
| #if TINY_GSM_TEST_GPRS && defined TINY_GSM_MODEM_XBEE | ||||
|   | ||||
| @@ -140,7 +140,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
| #if TINY_GSM_USE_GPRS && defined TINY_GSM_MODEM_XBEE | ||||
| @@ -154,7 +154,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   if (modem.isNetworkConnected()) { | ||||
|     SerialMon.println("Network connected"); | ||||
| @@ -168,7 +168,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
|   SerialMon.print(F("Connecting to ")); | ||||
| @@ -178,7 +178,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   // Make a HTTP GET request: | ||||
|   client.print(String("GET ") + resource + " HTTP/1.0\r\n"); | ||||
|   | ||||
| @@ -142,7 +142,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
| #if TINY_GSM_USE_GPRS && defined TINY_GSM_MODEM_XBEE | ||||
| @@ -156,7 +156,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   if (modem.isNetworkConnected()) { | ||||
|     SerialMon.println("Network connected"); | ||||
| @@ -170,7 +170,7 @@ void loop() { | ||||
|       delay(10000); | ||||
|       return; | ||||
|     } | ||||
|     SerialMon.println(" OK"); | ||||
|     SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
|   SerialMon.print(F("Performing HTTP GET request... ")); | ||||
|   | ||||
| @@ -142,7 +142,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
| #if TINY_GSM_USE_GPRS && defined TINY_GSM_MODEM_XBEE | ||||
| @@ -156,7 +156,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   if (modem.isNetworkConnected()) { | ||||
|     SerialMon.println("Network connected"); | ||||
| @@ -170,7 +170,7 @@ void loop() { | ||||
|       delay(10000); | ||||
|       return; | ||||
|     } | ||||
|     SerialMon.println(" OK"); | ||||
|     SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
|   SerialMon.print(F("Performing HTTPS GET request... ")); | ||||
|   | ||||
| @@ -167,7 +167,7 @@ void setup() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   if (modem.isNetworkConnected()) { | ||||
|     SerialMon.println("Network connected"); | ||||
| @@ -181,7 +181,7 @@ void setup() { | ||||
|       delay(10000); | ||||
|       return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|     SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
|   // MQTT Broker setup | ||||
| @@ -203,7 +203,7 @@ boolean mqttConnect() { | ||||
|     SerialMon.println(" fail"); | ||||
|     return false; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|   mqtt.publish(topicInit, "GsmClientTest started"); | ||||
|   mqtt.subscribe(topicLed); | ||||
|   return mqtt.connected(); | ||||
|   | ||||
| @@ -60,17 +60,6 @@ | ||||
| // Uncomment this if you want to use SSL | ||||
| //#define USE_SSL | ||||
|  | ||||
| // Set serial for debug console (to the Serial Monitor, default speed 115200) | ||||
| #define SerialMon Serial | ||||
|  | ||||
| // Set serial for AT commands (to the module) | ||||
| // Use Hardware Serial on Mega, Leonardo, Micro | ||||
| #define SerialAT Serial1 | ||||
|  | ||||
| // or Software Serial on Uno, Nano | ||||
| //#include <SoftwareSerial.h> | ||||
| //SoftwareSerial SerialAT(2, 3); // RX, TX | ||||
|  | ||||
| #define TINY_GSM_USE_GPRS true | ||||
| #define TINY_GSM_USE_WIFI false | ||||
|  | ||||
| @@ -152,7 +141,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
| #if TINY_GSM_USE_GPRS && defined TINY_GSM_MODEM_XBEE | ||||
| @@ -166,7 +155,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   if (modem.isNetworkConnected()) { | ||||
|     SerialMon.println("Network connected"); | ||||
| @@ -180,7 +169,7 @@ void loop() { | ||||
|       delay(10000); | ||||
|       return; | ||||
|     } | ||||
|     SerialMon.println(" OK"); | ||||
|     SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
|   SerialMon.print("Connecting to "); | ||||
| @@ -190,7 +179,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   // Make a HTTP GET request: | ||||
|   SerialMon.println("Performing HTTP GET request..."); | ||||
|   | ||||
| @@ -83,7 +83,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   SerialMon.print(F("Connecting to ")); | ||||
|   SerialMon.print(apn); | ||||
| @@ -92,7 +92,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   SerialMon.print(F("Connecting to ")); | ||||
|   SerialMon.print(server); | ||||
| @@ -101,7 +101,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   // Make a HTTP GET request: | ||||
|   client.print(String("GET ") + resource + " HTTP/1.0\r\n"); | ||||
| @@ -132,4 +132,3 @@ void loop() { | ||||
|     delay(1000); | ||||
|   } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -96,7 +96,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   SerialMon.print(F("Connecting to ")); | ||||
|   SerialMon.print(apn); | ||||
| @@ -105,7 +105,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
|  | ||||
|   SerialMon.print(F("Performing HTTP GET request... ")); | ||||
|   int err = http.get(resource); | ||||
| @@ -157,4 +157,3 @@ void loop() { | ||||
|     delay(1000); | ||||
|   } | ||||
| } | ||||
|  | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -10,8 +10,7 @@ | ||||
|  **************************************************************/ | ||||
|  | ||||
| // Select your modem: | ||||
| #define TINY_GSM_MODEM_SIM800 | ||||
| // #define TINY_GSM_MODEM_SIM900 | ||||
| // #define TINY_GSM_MODEM_SIM800 | ||||
| // #define TINY_GSM_MODEM_SIM808 | ||||
| // #define TINY_GSM_MODEM_SIM868 | ||||
| // #define TINY_GSM_MODEM_SIM900 | ||||
| @@ -155,7 +154,7 @@ void loop() { | ||||
|     delay(10000); | ||||
|     return; | ||||
|   } | ||||
|   SerialMon.println(" OK"); | ||||
|   SerialMon.println(" success"); | ||||
| #endif | ||||
|  | ||||
| #if TINY_GSM_USE_GPRS && defined TINY_GSM_MODEM_XBEE | ||||
|   | ||||
		Reference in New Issue
	
	Block a user