-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
ESP32 does not accept Static IP #1262
Comments
I seem to have the same issue. If I use the sample program it will not connect. |
I have tested both methods.
The output I get is this
If I use DHCP by removing this line
Then it connects without any problem.
|
OK I found this. #1081 TThe error is still there. If I remove
and just add a delay of 15 seconds then all works fine. |
OK so this is the fix. comment out the if
|
Thanks JacoFourie. Could please simplify your correct changes? Thanks |
Go to the file in the libraries folder of the Arduino-Core files My home path is
and comment out the if as shown.
|
@JacoFourie can confirm that this did the trick for me as well. In my case running Atom with platform.io, |
thank you so much for your answers. |
@sreenumalae I am posting the part you need for a static IP
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs. Thank you for your contributions. |
This stale issue has been automatically closed. Thank you for your contributions. |
Hardware:
Board: ESP32 Dev Module
Core Installation/update date: Latest
IDE name: Platform.io
Flash Frequency: 40Mhz
Upload Speed: 115200?
#include <Arduino.h>
#include <WiFi.h>
#include <WiFiMulti.h>
void setup() {
Serial.begin(115200);
delay(1000);
WiFi.mode(WIFI_AP);
WiFi.softAP("ADSL1", "AbbasMeamarbashi2017***");
Serial.println("Wait 100 ms for AP_START...");
delay(300);
WiFi.onEvent(wifi_event);
for(int rrr=0;rrr<20;rrr++)
{
Serial.println("Set softAPConfig");
IPAddress Ip(192, 168, 1, 11);
IPAddress NMask(255, 255, 255, 0);
WiFi.softAPConfig(Ip, Ip, NMask);
IPAddress myIP = WiFi.softAPIP();
Serial.print("AP IP address: ");
Serial.println(myIP);
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
delay(1000);
}
void loop()
{
}
The text was updated successfully, but these errors were encountered: