sparkfun / SparkFun_RTK_Everywhere_Firmware

Centimeter precision GPS/GNSS using L1/L2/L5 signals broadcast over Bluetooth, WiFi, and Ethernet.
http://docs.sparkfun.com/SparkFun_RTK_Everywhere_Firmware/
Other
17 stars 11 forks source link

[release_candidate on EVK] Configure via Ethernet is broken #494

Open PaulZC opened 3 weeks ago

PaulZC commented 3 weeks ago

I'm seeing a crash when Configure via Ethernet mode is started:

image

Guru Meditation Error: Core  1 panic'ed (Double exception).

Core  1 register dump:
PC      : 0x4009b54a  PS      : 0x00040636  A0      : 0x800edfa7  A1      : 0x3ffd09c0
A2      : 0x00000001  A3      : 0x3ffc69f8  A4      : 0x3ffc58c4  A5      : 0x0000000a
A6      : 0x0000000a  A7      : 0x00000006  A8      : 0x40080080  A9      : 0x3ffd0aa0
A10     : 0x00060836  A11     : 0x00040026  A12     : 0x3ffc58c4  A13     : 0x00060023
A14     : 0xb33fffff  A15     : 0xb33fffff  SAR     : 0x00000020  EXCCAUSE: 0x00000002
EXCVADDR: 0xffffffe0  LBEG    : 0x40095241  LEND    : 0x40095251  LCOUNT  : 0xfffffffd

Backtrace: 0x4009b547:0x3ffd09c0 0x400edfa4:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 0x4009b547:0x3ffd0a60 0x4009b547:0x3ffd0a80 0x4009b547:0x3ffd0aa0 0x4008007d:0x3ffd09c0 0x400edf98:0x3ffd09e0 0x4009b547:0x3ffd0a00 0x4009b547:0x3ffd0a20 0x4009b547:0x3ffd0a40 |<-CONTINUES

ELF file SHA256: ff21f8b9968dd820
PaulZC commented 3 weeks ago

@nseidle @LeeLeahy2 :

Before I dive into trying to fix this, is it time to remove the dedicated Configure-Via-Ethernet mode? We had to add that back in the day when the AsyncWebServer needed exclusive access to Ethernet (SPI and Interrupts) to function without crashing. But with the new core and proper support for the W5500, is it time to remove the dedicated mode?

PaulZC commented 3 weeks ago

OK. Issue found... We have bad code here:

https://github.com/sparkfun/SparkFun_RTK_Everywhere_Firmware/blob/4ce85f32f42975648255732faa12e4b2366a811d/Firmware/RTK_Everywhere/Network.ino#L792

index has gone out of scope when networkMulticastDNSStart(index) is called. I guess the intent was networkMulticastDNSStart(startIndex)?

PaulZC commented 3 weeks ago

Humm. I've tried adding that fix. The crash has gone, but now both Configure-Via-Ethernet and Web Config / WiFi Config are misbehaving... This may be beyond my pay grade...

PaulZC commented 3 weeks ago

Starting from today's release_candidate: Replace line 792 in Network.ino with: networkMulticastDNSStart(startIndex) Compile and upload Disconnect Ethernet Remove the cellular SIM Factory reset Firmware has no WiFi SSIDs EVK is in Rover mode Wait for Starting Cellular Wait more to allow the SIM check to fail Put the firmware into WiFi Config mode Connect my PC to to RTK Config Open 192.168.4.1. It loads... So far so good. Wait a bit. Then boom:

STATE_WIFI_CONFIG_NOT_STARTED --> STATE_WIFI_CONFIG, 2024-10-31 08:18:30.493
notFound: Client:192.168.4.2 /connecttest.txt
notFound: Client:192.168.4.2 /connecttest.txt
notFound: Client:192.168.4.2 /src/bootstrap.min.js.map
notFound: Client:192.168.4.2 /src/bootstrap.bundle.min.js.map
notFound: Client:192.168.4.2 /src/bootstrap.min.css.map
Error: Please enter at least one SSID before using WiFi
E (243596) wifi:NAN WiFi stop
httpd_ws_recv_frame failed to get frame len with -1
WiFi Off
Guru Meditation Error: Core  1 panic'ed (StoreProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400ea197  PS      : 0x00060430  A0      : 0x800fd5b9  A1      : 0x3ffd2640
A2      : 0x00000000  A3      : 0x00000000  A4      : 0x00000000  A5      : 0x00000000
A6      : 0x3ffc87ac  A7      : 0x3ffd269c  A8      : 0x80137bf8  A9      : 0x3ffd2680
A10     : 0x0003a139  A11     : 0x00000000  A12     : 0x0000a139  A13     : 0x00003ec0
A14     : 0x00000000  A15     : 0x00000000  SAR     : 0x0000000a  EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000000  LBEG    : 0x4008544d  LEND    : 0x40085455  LCOUNT  : 0x00000027

Backtrace: 0x400ea194:0x3ffd2640 0x400fd5b6:0x3ffd26c0 0x40105acd:0x3ffd2740 0x4013a340:0x3ffd2760

ELF file SHA256: dddbcb80d0bca83b

Rebooting...
ets Jul 29 2019 12:21:46

I think the critical bit is the SSID check. When the SSID check finds no SSIDs, it has a hissy fit and turns WiFi off. Except WiFi is running in AP mode, and the PC is connected. And it goes boom.

Yeah. I think it is this code. It doesn't respect that WiFi may be running in AP mode - where it doesn't need SSIDs.

PaulZC commented 3 weeks ago

Ah. And this probably explains the badness I'm seeing on Configure via Ethernet too. Because wifiStop calls stopWebServer here.