diff --git a/core/MyGatewayTransportEthernet.cpp b/core/MyGatewayTransportEthernet.cpp index 2278c94..fba3305 100644 --- a/core/MyGatewayTransportEthernet.cpp +++ b/core/MyGatewayTransportEthernet.cpp @@ -122,7 +122,10 @@ bool gatewayTransportInit(void) #if defined(MY_IP_ADDRESS) WiFi.config(_ethernetGatewayIP, _gatewayIp, _subnetIp); #endif /* End of MY_IP_ADDRESS */ - (void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD); +#ifndef MY_ESP8266_BSSID +#define MY_ESP8266_BSSID NULL +#endif + (void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD, 0, MY_ESP8266_BSSID); while (WiFi.status() != WL_CONNECTED) { wait(500); MY_SERIALDEVICE.print(F(".")); diff --git a/core/MyGatewayTransportMQTTClient.cpp b/core/MyGatewayTransportMQTTClient.cpp index 972cd59..f24705a 100644 --- a/core/MyGatewayTransportMQTTClient.cpp +++ b/core/MyGatewayTransportMQTTClient.cpp @@ -154,7 +154,10 @@ bool gatewayTransportInit(void) #if defined(MY_IP_ADDRESS) WiFi.config(_MQTT_clientIp, _gatewayIp, _subnetIp); #endif /* End of MY_IP_ADDRESS */ - (void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD); +#ifndef MY_ESP8266_BSSID +#define MY_ESP8266_BSSID NULL +#endif + (void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD, 0, MY_ESP8266_BSSID); #endif /* End of MY_GATEWAY_ESP8266 */ gatewayTransportConnect(); diff --git a/keywords.txt b/keywords.txt index 6be07b0..67468c9 100644 --- a/keywords.txt +++ b/keywords.txt @@ -206,5 +206,6 @@ MY_IP_SUBNET_ADDRESS LITERAL1 # ESP8266 MY_ESP8266_SSID LITERAL1 MY_ESP8266_PASSWORD LITERAL1 +MY_ESP8266_BSSID LITERAL1 MY_ESP8266_HOSTNAME LITERAL1 MY_ESP8266_SERIAL_MODE LITERAL1