Exception(28) getting WIFi.status()
- Dominant language
- C++
- Stars
- 16.7k
- Forks
- 13.1k
- PR merge metrics
- No merged PRs in 30d
Description
### Basic Infos
- [x] This issue complies with the [issue POLICY doc](https://github.com/esp8266/Arduino/blob/master/POLICY.md).
- [x] I have read the documentation at [readthedocs](https://arduino-esp8266.readthedocs.io/en/latest) and the issue is not addressed there.
- [x] I have tested that the issue is present in current master branch (aka latest git).
- [x] I have searched the issue tracker for a similar issue.
- [x] If there is a stack dump, I have decoded it.
- [x] I have filled out all fields below.
#### Platform
- Hardware: [ESP8266 NodeMCU 1.0]
- Core Version: [2.4.2]
- Development Env: [Arduino IDE]
- Operating System: [Ubuntu]
### Settings in IDE
- Module: [Nodemcu 1.0]
- Flash Mode: [qio|dio|other]
- Flash Size: [4MB]
- lwip Variant: [v1.4 Higher Bandwidth]
- Reset Method: [ck|nodemcu]
- Flash Frequency: [40Mhz]
- CPU Frequency: [80Mhz]
- Upload Using: [SERIAL]
- Upload Speed: [115200] (serial upload only)
### Problem Description
Exception(28) intermitent, apparently caused by low quality connection, when connecting to WiFi. Seems like it has somethong to do with WiFi.status()
### [MCVE](https://stackoverflow.com/help/mcve) Sketch
relevant code:
bool connectWifiOk() {
// WiFi network parameters
const char* ssid2 = "choco2"; //fill in your wifi name
const char* password2 = "123qweasd";
const char* ssid = "fazenda"; //fill in your wifi name
const char* password = "";
const char* ssid3 = "vivowifi"; //fill in your wifi name
const char* password3 = "vivowifi";
//char* ssidFav = ""; //fill in your wifi name
//char* passwordFav = "";
bool flagWifi = false;
int counter = 0;
int counterLoop = 0;
Serial.println("connectWifiOk");
while (WiFi.status() != WL_CONNECTED && counter < 30) {
Serial.print("while loop ");
if (counterLoop >= 5) {
if (counterLoop == 5) {
WiFi.disconnect();
WiFi.begin(ssid2, password2);
} else {
if (counterLoop == 10) {
WiFi.disconnect();
WiFi.begin(ssid3, password3);
} else if (counterLoop == 15) {
counterLoop = -1;
}
}
} else if(!counterLoop) {
WiFi.disconnect();
WiFi.begin(ssid, password);
}
Serial.print(counterLoop);
Serial.print(" SSID() ");
Serial.print(WiFi.SSID());
delay(1800);
counter++;
counterLoop++;
Serial.print(" status ");
Serial.println(WiFi.status());
}
Serial.print("WiFi connection flag:");
flagWifi = (WiFi.status() == WL_CONNECTED);
Serial.println(flagWifi);
return flagWifi;
}
### Debug Messages
SERIAL OUTPUT
connectWifiOk
while loop 0 SSID() fazenda status 6
while loop 1 SSID() fazenda
Exception (28):
epc1=0x40205c46 epc2=0x00000000 epc3=0x00000000 excvaddr=0x0000002c depc=0x00000000
ctx: sys
sp: 3fffed30 end: 3fffffb0 offset: 01a0
Decoding stack results
0x40204e9c: ESP8266WiFiGenericClass::_eventCallback(void*) at /home/tony/.arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9-2/xtensa-lx106-elf/include/c++/4.8.2/bits/range_access.h line 48
0x40204fd0: ESP8266WiFiSTAClass::status() at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp line 498
0x40100579: realloc at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/umm_malloc/umm_malloc.c line 1499
0x4020969b: String::changeBuffer(unsigned int) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 156
0x40209101: Print::printNumber(unsigned long, unsigned char) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 260
0x4020969b: String::changeBuffer(unsigned int) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 156
0x402096e7: String::reserve(unsigned int) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 146
0x40209719: String::copy(char const*, unsigned int) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 175
0x40209766: String::String(char const*) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/WString.cpp line 36
0x40209101: Print::printNumber(unsigned long, unsigned char) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 260
0x40205194: ESP8266WiFiSTAClass::SSID() const at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp line 522
0x4020519c: ESP8266WiFiSTAClass::SSID() const at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp line 523
0x40204fa7: ESP8266WiFiSTAClass::disconnect(bool) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp line 311
0x40209101: Print::printNumber(unsigned long, unsigned char) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 260
0x40209d5c: esp_yield() at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_main.cpp line 91
0x40201c1b: delay at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_wiring.c line 51
0x40203d34: connectWifiOk() at /home/tony/Arduino/sketches/tempo1_vs13e_Master_NodeMCU_Rain_Wind/tempo1_vs13e_Master_NodeMCU_Rain_Wind.ino line 1355
0x40208fed: Print::write(char const*) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.h line 60
0x40209018: Print::println() at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 178
0x402040a8: uploadAgrigis(char const*) at /home/tony/Arduino/sketches/tempo1_vs13e_Master_NodeMCU_Rain_Wind/tempo1_vs13e_Master_NodeMCU_Rain_Wind.ino line 344
0x4010654a: millis at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/core_esp8266_wiring.c line 183
0x40208fed: Print::write(char const*) at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.h line 60
0x40209018: Print::println() at /home/tony/.arduino15/packages/esp8266/hardware/esp8266/2.4.2/cores/esp8266/Print.cpp line 178
0x40204abf: timeCheck() at /home/tony/Arduino/sketches/tempo1_vs13e_Master_NodeMCU_Rain_Wind/tempo1_vs13e_Master_NodeMCU_Rain_Wind.ino line 252
0x40203b0c: setup() at /home/tony/Arduino/sketches/tempo1_vs13e_Master_NodeMCU_Rain_Wind/tempo1_vs13e_Master_NodeMCU_Rain_Wind.ino line 183
0x40204c94: loop() at /home/tony/Arduino/sketches/tempo1_vs13e_Master_NodeMCU_Rain_Wind/tempo1_vs13e_Master_NodeMCU_Rain_Wind.ino line 187
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.