diff --git a/core/MyGatewayTransportEthernet.cpp b/core/MyGatewayTransportEthernet.cpp index fb148687d..e2347840f 100644 --- a/core/MyGatewayTransportEthernet.cpp +++ b/core/MyGatewayTransportEthernet.cpp @@ -48,7 +48,7 @@ extern MyMessage _msgTmp; #endif #if defined(MY_GATEWAY_ESP8266) || defined(MY_GATEWAY_ESP32) -#if !defined(MY_WIFI_SSID) +#if !defined(MY_WIFI_SSID) && !defined(MY_EXTERNAL_WIFIMANAGER_USED) #error ESP8266/ESP32 gateway: MY_WIFI_SSID not defined! #endif #endif @@ -171,12 +171,14 @@ bool gatewayTransportInit(void) #ifdef MY_IP_ADDRESS WiFi.config(_ethernetGatewayIP, _gatewayIp, _subnetIp); #endif +#if !defined(MY_EXTERNAL_WIFIMANAGER_USED) (void)WiFi.begin(MY_WIFI_SSID, MY_WIFI_PASSWORD, 0, MY_WIFI_BSSID); while (WiFi.status() != WL_CONNECTED) { delay(1000); GATEWAY_DEBUG(PSTR("GWT:TIN:CONNECTING...\n")); } GATEWAY_DEBUG(PSTR("GWT:TIN:IP: %s\n"), WiFi.localIP().toString().c_str()); +#endif #elif defined(MY_GATEWAY_LINUX) // Nothing to do here #else diff --git a/core/MyGatewayTransportMQTTClient.cpp b/core/MyGatewayTransportMQTTClient.cpp index dbf9cc1bc..9a19c1b5a 100644 --- a/core/MyGatewayTransportMQTTClient.cpp +++ b/core/MyGatewayTransportMQTTClient.cpp @@ -85,7 +85,7 @@ #endif #if defined(MY_GATEWAY_ESP8266) || defined(MY_GATEWAY_ESP8266_SECURE) || defined(MY_GATEWAY_ESP32) -#if !defined(MY_WIFI_SSID) +#if !defined(MY_WIFI_SSID) && !defined(MY_EXTERNAL_WIFIMANAGER_USED) #error ESP8266/ESP32 MQTT gateway: MY_WIFI_SSID not defined! #endif #endif @@ -219,7 +219,10 @@ bool reconnectMQTT(void) GATEWAY_DEBUG(PSTR("!GWT:RMQ:FAIL\n")); #if defined(MY_GATEWAY_ESP8266_SECURE) char sslErr[256]; - int errID = _MQTT_ethClient.getLastSSLError(sslErr, sizeof(sslErr)); +#if defined(MY_DEBUG_VERBOSE_GATEWAY) + int errID = +#endif + _MQTT_ethClient.getLastSSLError(sslErr, sizeof(sslErr)); GATEWAY_DEBUG(PSTR("!GWT:RMQ:(%d) %s\n"), errID, sslErr); #endif return false; @@ -323,8 +326,10 @@ bool gatewayTransportInit(void) #if defined(MY_IP_ADDRESS) WiFi.config(_MQTT_clientIp, _gatewayIp, _subnetIp); #endif /* End of MY_IP_ADDRESS */ +#if !defined(MY_EXTERNAL_WIFIMANAGER_USED) (void)WiFi.begin(MY_WIFI_SSID, MY_WIFI_PASSWORD, 0, MY_WIFI_BSSID); #endif +#endif #if defined(MY_GATEWAY_ESP8266_SECURE) // Certificate Authorities are stored in the X509 list diff --git a/keywords.txt b/keywords.txt index 0889219f1..ad9b1a1bb 100755 --- a/keywords.txt +++ b/keywords.txt @@ -47,6 +47,7 @@ MY_SLEEP_NOT_POSSIBLE LITERAL1 MY_SPLASH_SCREEN_DISABLED LITERAL1 MY_WAKE_UP_BY_TIMER LITERAL1 MY_SLEEP_HANDLER LITERAL1 +MY_EXTERNAL_WIFIMANAGER_USED LITERAL1 # transport AUTO LITERAL1