subnetMask() & gatewayIP() return 0.0.0.0 in AP mode
Posted: Tue Jun 30, 2015 8:50 am
Hi,
In the code I declare:
IPAddress local_ip(192,168,3,1);
IPAddress gateway(255,255,255,0);
IPAddress subnet(192,168,3,1);
and in setup() I call:
WiFi.softAPConfig(local_ip, gateway, subnet);
then
WiFi.mode(WIFI_AP);
and
WiFi.softAP(AP_NameChar, WiFiAPPSK);
at last:
Serial.print("AP IP address: ");
Serial.println(WiFi.softAPIP());
Serial.print("AP subnet mask: ");
Serial.println(WiFi.subnetMask());
Serial.print("AP gateway: ");
Serial.println(WiFi.gatewayIP());
In the serial window I get:
AP IP address: 192.168.3.1
AP subnet mask: 0.0.0.0
AP gateway: 0.0.0.0
When checking the result with ipconfig in cmd after connecting to the created AP I get:
IP Address. . . . . . . . . . . . : 192.168.3.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Judging by the results IP Address and subnet mask are written correctly with WiFi.softAPConfig() function. Is there something wrong with the read functions? I'm probably missing something obvious...
The IP Address write and read works OK.
In the code I declare:
IPAddress local_ip(192,168,3,1);
IPAddress gateway(255,255,255,0);
IPAddress subnet(192,168,3,1);
and in setup() I call:
WiFi.softAPConfig(local_ip, gateway, subnet);
then
WiFi.mode(WIFI_AP);
and
WiFi.softAP(AP_NameChar, WiFiAPPSK);
at last:
Serial.print("AP IP address: ");
Serial.println(WiFi.softAPIP());
Serial.print("AP subnet mask: ");
Serial.println(WiFi.subnetMask());
Serial.print("AP gateway: ");
Serial.println(WiFi.gatewayIP());
In the serial window I get:
AP IP address: 192.168.3.1
AP subnet mask: 0.0.0.0
AP gateway: 0.0.0.0
When checking the result with ipconfig in cmd after connecting to the created AP I get:
IP Address. . . . . . . . . . . . : 192.168.3.2
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
Judging by the results IP Address and subnet mask are written correctly with WiFi.softAPConfig() function. Is there something wrong with the read functions? I'm probably missing something obvious...
The IP Address write and read works OK.