Allow User to manage ESP8266 Wifi if need
If MY_ESP8266_SSID is not defined, the WIFI part is managed by the user. If MY_ESP8266_SSID is defined, wifi is managed by Mysensor libraries.
This commit is contained in:
@@ -100,18 +100,20 @@ typedef struct
|
|||||||
bool gatewayTransportInit() {
|
bool gatewayTransportInit() {
|
||||||
_w5100_spi_en(true);
|
_w5100_spi_en(true);
|
||||||
#if defined(MY_GATEWAY_ESP8266)
|
#if defined(MY_GATEWAY_ESP8266)
|
||||||
(void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD);
|
#if defined(MY_ESP8266_SSID)
|
||||||
#ifdef MY_IP_ADDRESS
|
(void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD);
|
||||||
WiFi.config(_ethernetGatewayIP, gateway, subnet);
|
#ifdef MY_IP_ADDRESS
|
||||||
|
WiFi.config(_ethernetGatewayIP, gateway, subnet);
|
||||||
|
#endif
|
||||||
|
while (WiFi.status() != WL_CONNECTED)
|
||||||
|
{
|
||||||
|
delay(500);
|
||||||
|
MY_SERIALDEVICE.print(".");
|
||||||
|
yield();
|
||||||
|
}
|
||||||
|
MY_SERIALDEVICE.print(F("IP: "));
|
||||||
|
MY_SERIALDEVICE.println(WiFi.localIP());
|
||||||
#endif
|
#endif
|
||||||
while (WiFi.status() != WL_CONNECTED)
|
|
||||||
{
|
|
||||||
delay(500);
|
|
||||||
MY_SERIALDEVICE.print(".");
|
|
||||||
yield();
|
|
||||||
}
|
|
||||||
MY_SERIALDEVICE.print(F("IP: "));
|
|
||||||
MY_SERIALDEVICE.println(WiFi.localIP());
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#ifdef MY_IP_ADDRESS
|
#ifdef MY_IP_ADDRESS
|
||||||
|
|||||||
Reference in New Issue
Block a user