Exception when connecting to WiFi
Closed this issue · 7 comments
After flashing Watchy I instantly get this exception:
E (5953) wifi:wifi deinit internal: wifi not stop
E (5954) wifi_init: Failed to deinit Wi-Fi driver (0x3003)
Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.
Core 0 register dump:
PC : 0x40154415 PS : 0x00060430 A0 : 0x80156eac A1 : 0x3ffd4110
A2 : 0x3ffd6c40 A3 : 0x3ffd41a0 A4 : 0x00000000 A5 : 0x00000000
A6 : 0x3ffd6cb8 A7 : 0x00000000 A8 : 0x00000000 A9 : 0x3ffc9f74
A10 : 0x3ffbfe04 A11 : 0x0000008c A12 : 0x0000008c A13 : 0x3ffd6e36
A14 : 0x0000001f A15 : 0x00000008 SAR : 0x00000010 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000050 LBEG : 0x4008aab0 LEND : 0x4008aabb LCOUNT : 0x00000000
Backtrace: 0x40154412:0x3ffd4110 0x40156ea9:0x3ffd4190 0x40192f0d:0x3ffd4280 0x40192fb5:0x3ffd42d0 0x40194dd5:0x3ffd42f0 0x40191c00:0x3ffd4310
#0 0x40154412:0x3ffd4110 in scan_parse_beacon at ??:?
#1 0x40156ea9:0x3ffd4190 in sta_recv_mgmt at ??:?
#2 0x40192f0d:0x3ffd4280 in sta_input at ??:?
#3 0x40192fb5:0x3ffd42d0 in sta_rx_cb at ??:?
#4 0x40194dd5:0x3ffd42f0 in ppRxPkt at ??:?
#5 0x40191c00:0x3ffd4310 in ppTask at ??:?
ELF file SHA256: 08ec203f1d926278
Rebooting...
[ 6075][E][WiFiGeneric.cpp:1272] mode(): Could not set mode! 12308
[ 6075][E][WiFiSTA.cpp:299] begin(): STA enable failed!
When syncing time through the menu, the time does not sync and following error show up when monitoring:
[ 2336][E][WiFiGeneric.cpp:1272] mode(): Could not set mode! 12308
[ 2337][E][WiFiSTA.cpp:299] begin(): STA enable failed!
Other times I get the same exception as above.
Connecting to Watchy using "Watchy Connect" works, I also set up my local WiFi.
Using the newest Code from the Main branch. I did not test previous version, but can do so if necessary.
What ESP32 version are you using, this was tested with 2.0.14 and works fine, 3.x might cause issues.
Are you referring to this line in the platform.ini?
platform_packages = framework-arduinoespressif32 @ 3.20014.231204
If so, I left it on the default value which is, I believe 2.0.14.
I reverted the platformio.ini back to where it was, try compiling it now with that one.
There are a bunch of new error with the older version:
In file included from .pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:1:
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.h:64:22: warning: attribute ignored in declaration of 'struct GSRDrifting' [-Wattributes]
RTC_DATA_ATTR struct GSRDrifting final {
^~~~~~~~~~~
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.h:64:22: note: attribute for 'struct GSRDrifting' must follow the 'struct' keyword
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.h:73:22: warning: attribute ignored in declaration of 'struct GSRDrift' [-Wattributes]
RTC_DATA_ATTR struct GSRDrift final {
^~~~~~~~
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.h:73:22: note: attribute for 'struct GSRDrift' must follow the 'struct' keyword
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp: In member function 'void SmallRTC::setDateTime(String)':
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:120:5: error: 'settimeofday' was not declared in this scope
settimeofday(&tv,0);
^~~~~~~~~~~~
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:120:5: note: suggested alternative: '_gettimeofday_r'
settimeofday(&tv,0);
^~~~~~~~~~~~
_gettimeofday_r
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp: In member function 'void SmallRTC::read(tmElements_t&, bool)':
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:155:5: error: 'gettimeofday' was not declared in this scope
gettimeofday(&tv,0);
^~~~~~~~~~~~
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:155:5: note: suggested alternative: '_gettimeofday_r'
gettimeofday(&tv,0);
^~~~~~~~~~~~
_gettimeofday_r
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:169:9: error: 'settimeofday' was not declared in this scope
settimeofday(&tv,0);
^~~~~~~~~~~~
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:169:9: note: suggested alternative: '_gettimeofday_r'
settimeofday(&tv,0);
^~~~~~~~~~~~
_gettimeofday_r
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:183:9: error: 'settimeofday' was not declared in this scope
settimeofday(&tv,0);
^~~~~~~~~~~~
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:183:9: note: suggested alternative: '_gettimeofday_r'
settimeofday(&tv,0);
^~~~~~~~~~~~
_gettimeofday_r
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp: In member function 'void SmallRTC::set(tmElements_t, bool, bool)':
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:201:9: error: 'settimeofday' was not declared in this scope
settimeofday(&tv,0);
^~~~~~~~~~~~
.pio/libdeps/watchy/SmallRTC/src/SmallRTC.cpp:201:9: note: suggested alternative: '_gettimeofday_r'
settimeofday(&tv,0);
^~~~~~~~~~~~
_gettimeofday_r
Compiling .pio\build\watchy\lib2ad\BLE\BLEEddystoneURL.cpp.o
*** [.pio\build\watchy\lib7f2\SmallRTC\SmallRTC.cpp.o] Error 1
You've got an alternate time.h in your PlatformIO setup, you need to find it and tell PlatformIO not to use it.
When you find it, can you put a note here as to what you told it to ignore?
You are correct, it is using the wrong time.h file.
It works for me to hard code the absolute path to the correct one in SmallRTC.h like this:
#include <C:\Users\[username]\.platformio\packages\toolchain-xtensa-esp32\xtensa-esp32-elf\include\sys\time.h>
This resolves the WiFi issue, but brings a new one (the time.h issue).
Anyway, thank you for your help. Much appreciated.
https://community.platformio.org/t/exclude-specific-libraries-from-building/851
This has a question about multiple environments and libraries named the same. Might help, but thanks for telling me.