Browse Source

Version 6.1.6 h

platenspeler 5 years ago
parent
commit
36040579fa
3 changed files with 14 additions and 9 deletions
  1. 9 4
      ESP-sc-gway/ESP-sc-gway.ino
  2. 3 3
      ESP-sc-gway/_WiFi.ino
  3. 2 2
      ESP-sc-gway/_sensor.ino

+ 9 - 4
ESP-sc-gway/ESP-sc-gway.ino

@@ -20,7 +20,7 @@
 //	https://github.com/Lora-net/packet_forwarder/blob/master/PROTOCOL.TXT
 //
 // Notes: 
-// - Once call gethostbyname() to get IP for services, after that only use IP
+// - Once call hostbyname() to get IP for services, after that only use IP
 //	 addresses (too many gethost name makes the ESP unstable)
 // - Only call yield() in main stream (not for background NTP sync). 
 //
@@ -254,17 +254,22 @@ void ICACHE_FLASH_ATTR ReleaseMutex(int *mutex);
 #endif
 
 // ----------------------------------------------------------------------------
-// DIE is not used actively in the source code anymore.
+// DIE is not used actively in the source code apart from resolveHost().
 // It is replaced by a Serial.print command so we know that we have a problem
 // somewhere.
 // There are at least 3 other ways to restart the ESP. Pick one if you want.
 // ----------------------------------------------------------------------------
-void die(const char *s)
+void die(String s)
 {
+#	if _MONITOR>=1
+	mPrint(s);
+#	endif
+
+#	if _DUSB>=1
 	Serial.println(s);
-#	if _DUSB>=1 || _MONITOR>=1
 	if (debug>=2) Serial.flush();
 #	endif //_DUSB _MONITOR
+
 	delay(50);
 	// system_restart();									// SDK function
 	// ESP.reset();				

+ 3 - 3
ESP-sc-gway/_WiFi.ino

@@ -391,9 +391,9 @@ IPAddress resolveHost(String svrName)
 #		else
 			char cc[svrName.length() +1 ];
 			strcpy(cc, svrName.c_str());
-			if (!WiFi.hostByName(cc, svrIP)) 		// Use DNS to get server IP once
+			if (!WiFi.hostByName(cc, svrIP)) 				// Use DNS to get server IP once
 			{
-				die("resolveHost:: ERROR hostByName");
+				die("resolveHost:: ERROR hostByName="+ String(cc));
 			};
 #		endif
 	}
@@ -403,7 +403,7 @@ IPAddress resolveHost(String svrName)
 		strcpy(cc, svrName.c_str());
 		if (!WiFi.hostByName(cc, svrIP)) // Use DNS to get server IP once
 		{
-			die("resolveHost:: ERROR hostByName");
+			die("resolveHost:: ERROR hostByName="+ String(cc));
 		};
 	}
 	return svrIP;

+ 2 - 2
ESP-sc-gway/_sensor.ino

@@ -77,7 +77,7 @@ static int LoRaSensors(uint8_t *buf) {
 
 #	if _MONITOR>=1
 	if (debug>=0) {
-		SmPrint("LoRaSensors:: ");
+		mPrint("LoRaSensors:: ");
 	}
 #	endif //_MONITOR
 
@@ -108,7 +108,7 @@ static int LoRaSensors(uint8_t *buf) {
 #if _GPS==1
 #	if _MONITOR>=1
 	if (debug>=1)
-		mPrint("GPS sensor"));
+		mPrint("GPS sensor");
 #	endif //_MONITOR
 
 #	if _DUSB>=1