From d9e2e1d4821c9c5fe35afbd1198d13c038bfba0b Mon Sep 17 00:00:00 2001 From: ChiefZ Date: Sun, 1 Oct 2017 10:13:37 +0200 Subject: [PATCH] Show ip and mac after connect (#125) When not using advanced network config, the ip is optained via DHCP, so display it after the connection is established. Output was 0.0.0.0 in this case before. Also adding display of the mac for mac address filter config in the wifi-ap. --- OpenMQTTGateway.ino | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/OpenMQTTGateway.ino b/OpenMQTTGateway.ino index c93d561..eb6c1ee 100644 --- a/OpenMQTTGateway.ino +++ b/OpenMQTTGateway.ino @@ -201,13 +201,18 @@ void setup_wifi() { IPAddress dns_adress(Dns); WiFi.begin(wifi_ssid, wifi_password); //WiFi.config(ip_adress,gateway_adress,subnet_adress); //Uncomment this line if you want to use advanced network config - trc(F("OpenMQTTGateway ip: ")); - Serial.println(WiFi.localIP()); - + + trc(F("OpenMQTTGateway mac: ")); + Serial.println(WiFi.macAddress()); + while (WiFi.status() != WL_CONNECTED) { delay(500); trc(F(".")); } + + trc(F("OpenMQTTGateway ip: ")); + Serial.println(WiFi.localIP()); + trc(F("WiFi ok")); } #else