Skip to content

WiFi.config does not work #143

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

Closed
hcs-svn opened this issue Jan 23, 2017 · 2 comments
Closed

WiFi.config does not work #143

hcs-svn opened this issue Jan 23, 2017 · 2 comments

Comments

@hcs-svn
Copy link

hcs-svn commented Jan 23, 2017

#include <Arduino.h>
#include <WiFi.h>
#include <esp_system.h>

void setup(void) {
  Serial.begin(57600);
  delay(10);
  Serial.println();

  Serial.println(esp_get_idf_version());

  WiFi.mode(wifi_mode_t::WIFI_MODE_STA);
  WiFi.config(IPAddress(192, 168, 31, 212), IPAddress(192, 168, 31, 1), IPAddress(255, 255, 255, 0));
  WiFi.begin("top", "secret");

  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
   Serial.println();
   
   Serial.println("IP address: " + WiFi.localIP().toString());
}

Result of this code is:

v1.0-477-g0865819
...........
IP address: 192.168.31.108

Looks a if it would use always DHCP, should be 192.168.31.212 and not 192.168.31.108

Is it a bug or do I something wrong?

@me-no-dev
Copy link
Member

It's a bug! thanks for reporting this :)

@brycebot
Copy link

The following issue is present for me when using WiFi.config.
IPAddress chipIP = (192,168,10,22); WiFi.config(chipIP,WiFi.gatewayIP(),WiFi.subnetMask());
Result of code is:

IP Address: 22.0.0.0

Seems like every number I put in the last parameter of IPAddress is assigned as the first number of the new IP address, all other parameters are discarded.

blue-2357 pushed a commit to blue-2357/arduino-esp32 that referenced this issue Jul 17, 2024
brentru added a commit to adafruit/arduino-esp32 that referenced this issue Oct 22, 2024
darkxst pushed a commit to darkxst/arduino-esp32 that referenced this issue Dec 5, 2024
Co-authored-by: Me No Dev <me-no-dev@users.noreply.github.com>
dash0820 added a commit to dash0820/arduino-esp32-stripped that referenced this issue Mar 10, 2025
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

3 participants