Obtaining IP Address
Posted: Thu Mar 24, 2016 10:14 am
I'm trying to find a way to get the IP address of the server that I'm connected to. I need this in order to use an esp-link program to read data via MQTT.
Headers included in my code
ESP8266WIFI.h
PubSubClient.h
I also create a WiFiClient object.
From what I've looked at in their source code, WiFiClient has a function built in called remoteIP that seems like it may do what I need. Then there is the getIP function in ESP8266WiFi.h; however, I don't know if this just gets the local IP address of the device, the wifi access point, or the server.
Which of these is the best way to get me where I'm trying to go, or is there a better, easier way to do this?
Headers included in my code
ESP8266WIFI.h
PubSubClient.h
I also create a WiFiClient object.
From what I've looked at in their source code, WiFiClient has a function built in called remoteIP that seems like it may do what I need. Then there is the getIP function in ESP8266WiFi.h; however, I don't know if this just gets the local IP address of the device, the wifi access point, or the server.
Which of these is the best way to get me where I'm trying to go, or is there a better, easier way to do this?