Skip to content

Exception(28) getting WIFi.status() #6385

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

Open
6 tasks done
tonygps opened this issue Aug 5, 2019 · 0 comments
Open
6 tasks done

Exception(28) getting WIFi.status() #6385

tonygps opened this issue Aug 5, 2019 · 0 comments

Comments

@tonygps
Copy link

tonygps commented Aug 5, 2019

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • 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 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
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

1 participant