From 3c11f651af53e23c92160622d2b652deba85d548 Mon Sep 17 00:00:00 2001 From: David Conran Date: Fri, 11 May 2018 14:17:04 +1000 Subject: [PATCH] Ensure WiFi.localIP() is converted to a string when needed. (#455) Due to a potential compiler issue (e.g. Platformio vs. Arduino IDE) it seems that WiFi.localIP() wasn't being automatically associated with the string varient when used in a string context. Forcing the conversion should fix it in all cases. Fixes #452 Checked by @DiggiD --- examples/IRGCTCPServer/IRGCTCPServer.ino | 2 +- examples/IRMQTTServer/IRMQTTServer.ino | 2 +- examples/IRServer/IRServer.ino | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/IRGCTCPServer/IRGCTCPServer.ino b/examples/IRGCTCPServer/IRGCTCPServer.ino index cb328b268..0361091c0 100644 --- a/examples/IRGCTCPServer/IRGCTCPServer.ino +++ b/examples/IRGCTCPServer/IRGCTCPServer.ino @@ -111,7 +111,7 @@ void setup() { server.begin(); IPAddress myAddress = WiFi.localIP(); - Serial.println(myAddress); + Serial.println(myAddress.toString()); irsend.begin(); } diff --git a/examples/IRMQTTServer/IRMQTTServer.ino b/examples/IRMQTTServer/IRMQTTServer.ino index 9a7623d30..79785f558 100644 --- a/examples/IRMQTTServer/IRMQTTServer.ino +++ b/examples/IRMQTTServer/IRMQTTServer.ino @@ -804,7 +804,7 @@ void setup_wifi() { delay(5000); } - debug("WiFi connected. IP address: " + WiFi.localIP()); + debug("WiFi connected. IP address: " + WiFi.localIP().toString()); } void setup(void) { diff --git a/examples/IRServer/IRServer.ino b/examples/IRServer/IRServer.ino index 4d68bb171..87e0d2c14 100644 --- a/examples/IRServer/IRServer.ino +++ b/examples/IRServer/IRServer.ino @@ -102,7 +102,7 @@ void setup(void) { Serial.print("Connected to "); Serial.println(ssid); Serial.print("IP address: "); - Serial.println(WiFi.localIP()); + Serial.println(WiFi.localIP().toString()); if (mdns.begin("esp8266", WiFi.localIP())) { Serial.println("MDNS responder started");