Closed LusterWong closed 3 years ago
I have tried not to use WiFi.softAPConfig (localIP, gateway, subnet), everything will be normal, the device can connect to softAP and have normal IP allocation
Are you sure your gateway is at 192.168.1.0? This is not usually possible on consumer grade equipment.
I'm able to confirm this crash with this snippet (192.168.1.1). I notice that the crash doesn't happen the first time a device is connected to an ssid, but the second. Changing the ssid gets a one shot successful connect -- probably the dhcp lease is attempting to be renewed rather than requested.
#include <WiFi.h>
#include <WebServer.h>
#include <DNSServer.h>
IPAddress ip(192, 168, 1, 1);
void setup() {
delay(3000);
WiFi.disconnect();
WiFi.mode(WIFI_OFF);
WiFi.mode(WIFI_AP);
WiFi.softAPConfig(ip, ip, IPAddress(255, 255, 255, 0));
WiFi.softAP("test");
}
void loop() { }
Are you sure your gateway is at 192.168.1.0? This is not usually possible on consumer grade equipment.
Tried replacing with: IPAddress localIP(192,168,1,23); IPAddress gateway(192,168,1,1); IPAddress subnet(255,255,255,0);
No abnormality occurs, but the serial port prompts: dhcps: send_offer>>udp_sendto result 0 Guru Meditation Error: Core 0 panic'ed (InstrFetchProhibited) at pc=00000000. Setting bp and returning..
Then stuck, no ‘IDLE’ output
I'm able to confirm this crash with this snippet (192.168.1.1). I notice that the crash doesn't happen the first time a device is connected to an ssid, but the second. Changing the ssid gets a one shot successful connect -- probably the dhcp lease is attempting to be renewed rather than requested.
#include <WiFi.h> #include <WebServer.h> #include <DNSServer.h> IPAddress ip(192, 168, 1, 1); void setup() { delay(3000); WiFi.disconnect(); WiFi.mode(WIFI_OFF); WiFi.mode(WIFI_AP); WiFi.softAPConfig(ip, ip, IPAddress(255, 255, 255, 0)); WiFi.softAP("test"); } void loop() { }
This is a very normal usage, I hope the official can help parse
this is an issue in the underlying IDF libraries. All I can offer is to try the 4.0 branch or esp32s2 branch, which tracks IDF master.
this is an issue in the underlying IDF libraries. All I can offer is to try the 4.0 branch or esp32s2 branch, which tracks IDF master.
Thanks. I do n’t understand IDF, so I use arduion framework. I remember that I tried this last year and it didn't have this problem. At that time, IDF was still v3.xx version. Later, it was suspended because of my work, and I recently reopened the ESP32 test.
Weird... From my experience, the crash doesn't happen when the DCORE_DEBUG_LEVEL is set to level 5. But does when it is set to level 0 or 1.
DCORE_DEBUG_LEVEL
How to change DCORE_DEBUG_LEVEL with eclipse ?
This is the same as
https://github.com/espressif/arduino-esp32/issues/2025
ESP8266 has similar https://github.com/homieiot/homie-esp8266/issues/588 https://github.com/homieiot/homie-esp8266/issues/637
The 'fix' for me is a two second delay between WiFi.mode(WIFI_AP) and WiFi.softAPConfig() as described in 2025
It's a little strange to do that. How did you find out?
Thank you very much. I'll try it
mshoe007 notifications@github.com 于2020年7月6日周一 上午2:18写道:
This is the same as
2025 https://github.com/espressif/arduino-esp32/issues/2025
ESP8266 has similar homieiot/homie-esp8266#588 https://github.com/homieiot/homie-esp8266/issues/588 homieiot/homie-esp8266#637 https://github.com/homieiot/homie-esp8266/issues/637
The 'fix' for me is a two second delay between WiFi.mode(WIFI_AP) and WiFi.softAPConfig() as described in 2025
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/espressif/arduino-esp32/issues/3906#issuecomment-653921323, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANQVD2ONZTUKU5GBSRU265LR2C7VTANCNFSM4MHPEAGA .
I'm able to confirm this crash with this snippet (192.168.1.1). I notice that the crash doesn't happen the first time a device is connected to an ssid, but the second. Changing the ssid gets a one shot successful connect -- probably the dhcp lease is attempting to be renewed rather than requested.
@robacarp , it seems like you are right! Reconnecting to previously used SoftAP name -> ESP restart. So I've added random suffix to SoftAP's name and the problem gone.
[STALE_SET] 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.
[STALE_DEL] This stale issue has been automatically closed. Thank you for your contributions.
Why has this been closed. It's still an issue. Please reopen
This is still an issue, I read a comment that putting the "Core Debug Level" to 5 solves the problem. It worked for me but should be still be fixed. I prefer run at level 0.
The solution is a 100ms (or greater) delay after WiFi.softAP() before WiFi.softAPConfig() is invoked. The reason is that the WiFi stack isn't ready for WiFi.softAPConfig() until SYSTEM_EVENT_AP_START has been delivered. One could write more complex code to wait for SYSTEM_EVENT_AP_START, or instead just go with the 100msec delay: delay(100);
const char* Apssid = "Esp32";
const char* Appassword = "3tawi-GP"; IPAddress ip(192, 168, 1, 141); IPAddress gateway(192, 168, 1, 1); IPAddress subnet(255, 255, 255, 0);
void setup() { Serial.begin(115200); WiFi.softAPConfig(ip, gateway, subnet); WiFi.softAP(Apssid, Appassword); delay(3000); String textip = " IP Address: http://"; textip += WiFi.softAPIP().toString().c_str(); Serial.println(""); Serial.print(textip); }
void loop() { }
result : IP Address: http://192.168.1.141
In setup:
WiFi.onEvent(WiFiEvent);
Then this gets called on an event. Make whatever calls you need from the relevant event
void WiFiEvent(WiFiEvent_t event){
switch(event) {
case SYSTEM_EVENT_AP_START:
break;
case SYSTEM_EVENT_STA_START:
break;
case SYSTEM_EVENT_STA_CONNECTED:
break;
case SYSTEM_EVENT_AP_STA_GOT_IP6:
break;
case SYSTEM_EVENT_STA_GOT_IP:
break;
case SYSTEM_EVENT_STA_DISCONNECTED:
break;
default:
break;
}
}
Sir I am new developer now we are create a ESP8266 as server and serial port receive data and send data successfully. but I have a issue now I am change my Wi-Fi SOFTAP credentials(like SSID, PASWORD) by receive in serial monitor, so please suggest any code ?
Hardware:
Board: ESP32 Core Installation version: 1.0.3 IDE name: Arduino IDE/Eclipse Flash Frequency: 40Mhz PSRAM enabled: no Upload Speed: 115200 Computer OS: Windows 7
Description:
The program just enabled softAP and set the IP address, gateway, mask, everything started normally, the serial port output "IDLE."
When the device(PC or mobile) is connected, the serial port outputs: dhcps: send_offer >> udp_sendto result 0 And it prompts Guru Meditation Error: Core 0 panic'ed (InstrFetchProhibited). Exception was unhandled.
It is not clear how to solve it, I will only use simple arduino without in-depth understanding of the core of idf, what is the problem? How to solve?
Thanks.
Sketch: (leave the backquotes for code formatting)
Debug Messages:
Exception Decoder