Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting up AP no longer sets default IP address #1918

Closed
zhiquanyeo opened this issue Dec 29, 2023 · 2 comments
Closed

Setting up AP no longer sets default IP address #1918

zhiquanyeo opened this issue Dec 29, 2023 · 2 comments

Comments

@zhiquanyeo
Copy link

In earlier versions of the Arduino Core, the following code would result in IP Address: 192.168.42.1 getting printed to Serial. However, with 3.6.2, I get IP Address: (IP unset) instead.

#include <WiFi.h>

void setup() {
  // put your setup code here, to run once:
  while (!Serial) {}

  Serial.begin(115200);

  Serial.println("Creating AP");
  WiFi.softAP("test-network", "test-password");
  delay(1000);

  Serial.print("IP Address: ");
  Serial.println(WiFi.softAPIP());
}

void loop() {
  // put your main code here, to run repeatedly:

}

To work around this, I had to add the following before the WiFi.softAP(...) call:

  // Workaround
  IPAddress ip {192, 168, 42, 1};
  IPAddress subnet {255, 255, 255, 0};
  WiFi.softAPConfig(ip, ip, subnet);

Was this an expected change?

@earlephilhower
Copy link
Owner

No, this was a regression. #1862 seems to wipe the AP config, need to investigate.

@earlephilhower
Copy link
Owner

Fixed with afbba68

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants