sparkfun / SparkFun_RTK_Firmware

Centimeter precision GPS/GNSS using L1/L2 signals broadcast over Bluetooth SPP (using the ESP32) in an easy to use enclosure.
https://docs.sparkfun.com/SparkFun_RTK_Firmware/
Other
82 stars 47 forks source link

Fatal error: configure via WiFi AP while running PVT server #749

Closed DavidBerschauer closed 4 months ago

DavidBerschauer commented 10 months ago

Subject of the issue

When switching to AP config mode while the PVT server is running and not connected to any WiFi, a fatal error occurs and a hard reset is required.

Your workbench

Steps to reproduce

  1. Enable the PVT server via serial or AP configuration
  2. Let it restart and attempt to connect to a network
  3. Prevent a connection to the configured networks (wrong password, AP shutdown, ...)
  4. Switch to config mode

Everything works fine and as expected, when the device connects to an available WiFi network.

Expected behavior

  1. The AP starts
  2. The PVT server is disabled
  3. The configuration page is served on port 80

    Actual behavior

  4. The AP starts
  5. The PVT server shutsdown resulting in a fatal error: HALTED: Network user PVT Server is already idle
  6. The configuration page is served, but changes can't be saved

Complete log with all debug messages enabled: 15:16:57.337 -> STATE_ROVER_NO_FIX --> STATE_DISPLAY_SETUP, 2024-01-15 14:16:56.324 15:16:59.901 -> STATE_DISPLAY_SETUP --> STATE_WIFI_CONFIG_NOT_STARTED, 2024-01-15 14:16:58.856 15:17:00.399 -> Web Server Stopped 15:17:00.399 -> WiFi AP Started with IP: 192.168.4.1 15:17:00.545 -> newSettings len: 3233 15:17:00.545 -> newSettings: platformPrefix,Express, ... 15:17:00.819 -> Web Server Started 15:17:00.819 -> STATE_WIFI_CONFIG_NOT_STARTED --> STATE_WIFI_CONFIG, 2024-01-15 14:16:59.793 15:17:00.852 -> Shutdown pvtServer (mode 128, state 1) (Added in PvtServer.ino:L351) 15:17:00.852 -> Stopping PVT server in state PVT_SERVER_STATE_NETWORK_STARTED (Added in PvtServer.ino:L292) 15:17:00.896 -> HALTED: Network user PVT Server is already idle

It seems to me, that the PVT server calls networkUserClose() while the network is shutdown, because no WiFi is available. I thing it is related to this change.

This error also occurs with the PVT UDP server, because it shares the same logic and code in pvtUdpServerUpdate()

nseidle commented 10 months ago

Thanks for reporting! We'll have a look.

nseidle commented 10 months ago

We believe this has been fixed in the latest RC. Please give Jan 19th RC (or older) a try.

nseidle commented 4 months ago

Fixed in v4.1.