ElektorLabs / 191148-RemakeWeatherStation

RemakeWeatherStation
12 stars 4 forks source link

reconnect to wifi #4

Closed ginodecock closed 2 years ago

ginodecock commented 4 years ago

After being 2 days online and submitting readings to thingspeak every minute the ESP32 losses it's wifi connection. There is no IP adress on the display.

It seems the wifi connection is not restored automatically.

lab-mathias-claussen commented 4 years ago

Hi ginodecock,

we have to investigate this behaviour and if it is due to the IDF and some flags not set correctly or if we need to implement a different solution to get the station back online. Usually the ESP32 should restore the WiFi connecion automatically, but there may be still issues with it.

Best Regards ElektorLabs

ginodecock commented 4 years ago

Hi @lab-mathias-claussen,

I notice after a while there is a crash:

Rebooting... VEML6070 found @ 0x38 TSL2561 found @ 0x39 Starting auto detect Configure SDS011: failed Configure HPM115S0-XXX: failed Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed) Core 1 register dump: PC : 0x40196d50 PS : 0x00060034 A0 : 0x8008169c A1 : 0x3ffbe790
A2 : 0x3ffb95d0 A3 : 0x00000000 A4 : 0x80093741 A5 : 0x3ffb1ae0
A6 : 0x00000000 A7 : 0x3ffb1b1c A8 : 0x80088e5a A9 : 0x00000000
A10 : 0x3ffb95d0 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x3ffb1ac0
A14 : 0x00000000 A15 : 0x00000005 SAR : 0x00000011 EXCCAUSE: 0x00000007
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000
Core 1 was running in ISR context: EPC1 : 0x4009383c EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x40196d50

Backtrace: 0x40196d50:0x3ffbe790 0x40081699:0x3ffbe7b0 0x4008584d:0x3ffbe7d0 0x40093839:0x3ffb1b40 0x400940d1:0x3ffb1b60 0x400882c0:0x3ffb1b80 0x401818cf:0x3ffb1bf0 0x4011f8d3:0x3ffb1c20 0x4011fb23:0x3ffb1c50 0x40121097:0x3ffb1c80 0x40122c12:0x3ffb1cc0 0x4011f4c0:0x3ffb1d00 0x4011e1c0:0x3ffb1d30 0x4014de91:0x3ffb1d90 0x4000bcc5:0x3ffb1db0 0x401506e1:0x3ffb1dd0 0x400e785e:0x3ffb1df0 0x400e7ff6:0x3ffb1e70 0x40197066:0x3ffb1eb0 0x400e14e9:0x3ffb1ed0 0x400e16a9:0x3ffb1f60 0x400d2cfb:0x3ffb1f80 0x400f42ef:0x3ffb1fb0 0x40089c69:0x3ffb1fd0

Rebooting... VEML6070 found @ 0x38 TSL2561 found @ 0x39 Starting auto detect Configure SDS011: failed Configure HPM115S0-XXX: failed Guru Meditation Error: Core 1 panic'ed (Cache disabled but cached memory region accessed) Core 1 register dump: PC : 0x40196d50 PS : 0x00060034 A0 : 0x8008169c A1 : 0x3ffbe790
A2 : 0x3ffb95d0 A3 : 0x00000000 A4 : 0x80093741 A5 : 0x3ffb1a80
A6 : 0x00000000 A7 : 0x3ffb1abc A8 : 0x80088e5a A9 : 0x00000000
A10 : 0x3ffb95d0 A11 : 0x00000000 A12 : 0x00000000 A13 : 0x3ffb1a60
A14 : 0x00000000 A15 : 0x00000005 SAR : 0x0000001b EXCCAUSE: 0x00000007
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000
Core 1 was running in ISR context: EPC1 : 0x4009383c EPC2 : 0x00000000 EPC3 : 0x00000000 EPC4 : 0x40196d50

Backtrace: 0x40196d50:0x3ffbe790 0x40081699:0x3ffbe7b0 0x4008584d:0x3ffbe7d0 0x40093839:0x3ffb1ae0 0x400940d1:0x3ffb1b00 0x400882c0:0x3ffb1b20 0x401818cf:0x3ffb1b90 0x4011f8d3:0x3ffb1bc0 0x4011fb23:0x3ffb1bf0 0x40121097:0x3ffb1c20 0x40122c12:0x3ffb1c60 0x4011f4c0:0x3ffb1ca0 0x4011e1c0:0x3ffb1cd0 0x4014de91:0x3ffb1d30 0x4000bcc5:0x3ffb1d50 0x401506e1:0x3ffb1d70 0x400e7267:0x3ffb1d90 0x400e7603:0x3ffb1dc0 0x400e78de:0x3ffb1e00 0x400e7ff6:0x3ffb1e80 0x40197066:0x3ffb1ec0 0x400de36a:0x3ffb1ee0 0x400deb88:0x3ffb1f60 0x400d2d29:0x3ffb1f80 0x400f42ef:0x3ffb1fb0 0x40089c69:0x3ffb1fd0

Rebooting... VEML6070 found @ 0x38 TSL2561 found @ 0x39 Starting auto detect Configure SDS011: failed Configure HPM115S0-XXX: failed Filesize:249{"Mapping":[{"Enabled":true,"Channel":6},{"Enabled":true,"Channel":7},{"Enabled":true,"Channel":8},{"Enabled":true,"Channel":9},{"Enabled":false,"Channel":0},{"Enabled":false,"Channel":0},{"Enabled":false,"Channel":0},{"Enabled":false,"Channel":0}]} JSON:{"Mapping":[{"Enabled":true,"Channel":6},{"Enabled":true,"Channel":7},{"Enabled":true,"Channel":8},{"Enabled":true,"Channel":9},{"Enabled":false,"Channel":0},{"Enabled":false,"Channel":0},{"Enabled":false,"Channel":0},{"Enabled":false,"Channel":0}]} Read form File for Thingspeak Channel0 Mapped to Station Channel:6 Channel is Enabled Read form File for Thingspeak Channel1 Mapped to Station Channel:7 Channel is Enabled Read form File for Thingspeak Channel2 Mapped to Station Channel:8 Channel is Enabled Read form File for Thingspeak Channel3 Mapped to Station Channel:9 Channel is Enabled Read form File for Thingspeak Channel4 Mapped to Station Channel:0 Channel is Disabled Read form File for Thingspeak Channel5 Mapped to Station Channel:0 Channel is Disabled Read form File for Thingspeak Channel6 Mapped to Station Channel:0 Channel is Disabled Read form File for Thingspeak Channel7 Mapped to Station Channel:0 Channel is Disabled Initialize WiFi Starting Reconnect Connection Task

After this crash: A reconnect to wifi fails. A reconnect to the SDS011 sensor fails

lab-mathias-claussen commented 4 years ago

Hi ginodecock,

the crash seems to come from one ISR routine that calls code that is not loaded into RAM. The ESP32 is a bit ugly when it comes to ISR routines. For the SDS011 we can reproduce the issues and it seems that the sensor dislikes it when it is not initilized propper. Seemenly the driver will need an overhaul or replacement.

For WiFi we will look on how to improve the system when it comes to connection problems.

Regards

ElektorLabs