Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By pipi61
#55171 Hi!
in PASV command change
dataIp = WiFi.localIP();
to
if (WiFi.getMode() == WIFI_AP) //enum WiFiMode { WIFI_OFF = 0, WIFI_STA = 1, WIFI_AP = 2, WIFI_AP_STA = 3 };
{
dataIp = WiFi.softAPIP();
}

if (WiFi.getMode() == WIFI_STA) //enum WiFiMode { WIFI_OFF = 0, WIFI_STA = 1, WIFI_AP = 2, WIFI_AP_STA = 3 };
{
dataIp = WiFi.localIP();
}

if (WiFi.getMode() == WIFI_AP_STA) //enum WiFiMode { WIFI_OFF = 0, WIFI_STA = 1, WIFI_AP = 2, WIFI_AP_STA = 3 };
{
dataIp = WiFi.softAPIP();
}
some client use this ipaddress
Thank You
User avatar
By NailBuster
#55177 someone suggested just to change it to the following to work for all modes...I haven't tested yet but they say it works.

dataIp = client.localIP(); /// <<< use the clients local IP()