Skip to content

Add support for additional PointPerfect services #661

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

Merged
merged 79 commits into from
Jul 8, 2025

Conversation

nseidle
Copy link
Member

@nseidle nseidle commented Jun 27, 2025

This PR:

  • Creates a sub menu to allow the user to select between PointPerfect Flex IP, Flex L-Band North America, Flex NTRIP/RTCM, as well as the groundwork for PointPerfect Global and PointPerfect Live services when they become available.
  • Allows mosaic-X5 hardware to use MQTT IP based corrections (admittedly, now deprecated)
  • Stops the PPL when the selected PointPerfect service does not require it
  • Stops L-Band when the selected PointPerfect service does not require it
  • Stops MQTT client when the selected PointPerfect service does not require it
  • Includes a potential fix for infinite WiFi connect loop

Tested on Postcard, Facet mosaic-X5, Torch, EVK.

@nseidle nseidle requested a review from PaulZC June 30, 2025 17:05
@PaulZC
Copy link
Contributor

PaulZC commented Jul 7, 2025

I am testing this on my R&D Facet mosaic (X5). Attempting to register for "2) Flex NTRIP/RTCM".

I compiled the code using Core 3.0.7 and with ESP32 debug messages enabled.

I enter WiFi SSID and Password.
Exit the menus.
Re-enter the menus, open the PointPerfect menu and select "2) Flex NTRIP/RTCM".
Exit the menus.
Facet connects to WiFi and connects to ThingStream.
I see:

[248795][V][HTTPClient.cpp:242] beginInternal(): url: https://api.thingstream.io/ztp/pointperfect/credentials
[248805][D][HTTPClient.cpp:287] beginInternal(): switching host from '' to 'api.thingstream.io'. disconnecting first
[248816][D][HTTPClient.cpp:380] disconnect(): tcp stop
[248821][V][ssl_client.cpp:360] stop_ssl_socket(): Cleaning SSL connection.
[248832][D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: api.thingstream.io port: 443 url: /ztp/pointperfect/credentials
[248871][D][HTTPClient.cpp:574] sendRequest(): request type: 'POST' redirCount: 0

[248878][E][NetworkClient.cpp:319] setSocketOption(): fail on 0, errno: 9, "Bad file number"
[248887][D][NetworkManager.cpp:123] hostByName(): DNS found IPv4 52.18.203.8
[248894][V][ssl_client.cpp:68] start_ssl_client(): Free internal heap before TLS 42648
[248901][V][ssl_client.cpp:75] start_ssl_client(): Starting socket (domain 2)
[249003][V][ssl_client.cpp:166] start_ssl_client(): Seeding the random number generator
[249011][V][ssl_client.cpp:174] start_ssl_client(): Setting up the SSL/TLS structure...
[249019][V][ssl_client.cpp:194] start_ssl_client(): Loading CA cert
[249029][V][ssl_client.cpp:288] start_ssl_client(): Setting hostname for TLS session...
[249039][V][ssl_client.cpp:309] ssl_starttls_handshake(): Performing the SSL/TLS handshake...
[249515][V][ssl_client.cpp:330] ssl_starttls_handshake(): Verifying peer X.509 certificate...
[249524][V][ssl_client.cpp:338] ssl_starttls_handshake(): Certificate verified.
[249531][V][ssl_client.cpp:354] ssl_starttls_handshake(): Free internal heap after TLS 42796
[249539][D][HTTPClient.cpp:1112] connect():  connected to api.thingstream.io:443
[249691][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'HTTP/1.1 403 Forbidden'
[249699][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Date: Mon, 07 Jul 2025 13:47:26 GMT'
[249708][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Content-Type: text/plain'
[249717][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Content-Length: 36'
[249724][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Connection: keep-alive'
[249732][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: ''
[249738][D][HTTPClient.cpp:1257] handleHeaderResponse(): code: 403
[249744][D][HTTPClient.cpp:1260] handleHeaderResponse(): size: 36
[249749][D][HTTPClient.cpp:618] sendRequest(): sendRequest code=403

[249756][V][HTTPClient.cpp:1399] writeToStreamDataBlock(): connection closed or file end (written: 36).
[249765][D][HTTPClient.cpp:378] disconnect(): tcp keep open for reuse
This device is not whitelisted. Please contact support@sparkfun.com or goto https://www.sparkfun.com/rtk_facet_mosaic_registration to get the subscription activated. Please reference device ID: --------------
Batt (85%): Voltage: 4.06V Discharging: -4.37%/hr Charger Status: Standby
[254821][V][ssl_client.cpp:360] stop_ssl_socket(): Cleaning SSL connection.
HTTP Client stopped
Rover Accuracy (m): 0.300, SIV: 51 GNSS State: DGPS Fix
E (259243) wifi:NAN WiFi stop
[254972][V][STA.cpp:214] _onStaEvent(): STA Disconnected: SSID: VM2360384, BSSID: 64:7b:1e:97:84:1d, Reason: 8
[254984][V][NetworkEvents.cpp:119] checkForEvent(): Network Event: 14 - STA_DISCONNECTED
[254984][V][STA.cpp:188] _onStaEvent(): STA Stopped

Not unexpected. I'm not yet whitelisted.
I reset the Facet back to the defaults.
I whitelist the Facet.
I enter WiFi SSID and Password.
I exit the menus.
I reenter the PointPerfect menu.
I select "2) Flex NTRIP/RTCM".
I exit the menus.
Facet connects to WiFi and ThingStream.
I see:

[694571][V][HTTPClient.cpp:242] beginInternal(): url: https://api.thingstream.io/ztp/pointperfect/credentials
[694581][D][HTTPClient.cpp:287] beginInternal(): switching host from '' to 'api.thingstream.io'. disconnecting first
[694592][D][HTTPClient.cpp:380] disconnect(): tcp stop
[694597][V][ssl_client.cpp:360] stop_ssl_socket(): Cleaning SSL connection.
[694608][D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: api.thingstream.io port: 443 url: /ztp/pointperfect/credentials
[694648][D][HTTPClient.cpp:574] sendRequest(): request type: 'POST' redirCount: 0

[694655][E][NetworkClient.cpp:319] setSocketOption(): fail on 0, errno: 9, "Bad file number"
[694664][D][NetworkManager.cpp:123] hostByName(): DNS found IPv4 52.18.203.8
[694671][V][ssl_client.cpp:68] start_ssl_client(): Free internal heap before TLS 42412
[694678][V][ssl_client.cpp:75] start_ssl_client(): Starting socket (domain 2)
[694778][V][ssl_client.cpp:166] start_ssl_client(): Seeding the random number generator
[694786][V][ssl_client.cpp:174] start_ssl_client(): Setting up the SSL/TLS structure...
[694794][V][ssl_client.cpp:194] start_ssl_client(): Loading CA cert
[694804][V][ssl_client.cpp:288] start_ssl_client(): Setting hostname for TLS session...
[694814][V][ssl_client.cpp:309] ssl_starttls_handshake(): Performing the SSL/TLS handshake...
[695264][V][ssl_client.cpp:330] ssl_starttls_handshake(): Verifying peer X.509 certificate...
[695272][V][ssl_client.cpp:338] ssl_starttls_handshake(): Certificate verified.
[695280][V][ssl_client.cpp:354] ssl_starttls_handshake(): Free internal heap after TLS 42524
[695288][D][HTTPClient.cpp:1112] connect():  connected to api.thingstream.io:443
[700309][D][HTTPClient.cpp:618] sendRequest(): sendRequest code=-11

[700316][W][HTTPClient.cpp:1421] returnError(): error(-11): read Timeout
[700322][D][HTTPClient.cpp:1423] returnError(): tcp stop
[700328][V][ssl_client.cpp:360] stop_ssl_socket(): Cleaning SSL connection.
[700339][E][NetworkClient.cpp:319] setSocketOption(): fail on 0, errno: 9, "Bad file number"
[700347][W][HTTPClient.cpp:1421] returnError(): error(-4): not connected
[700353][E][NetworkClient.cpp:319] setSocketOption(): fail on 0, errno: 9, "Bad file number"
[700362][V][ssl_client.cpp:360] stop_ssl_socket(): Cleaning SSL connection.
Rover Accuracy (m): 0.334, SIV: 54 GNSS State: DGPS Fix
Batt (84%): Voltage: 4.06V Discharging: -3.33%/hr Charger Status: Standby
[700427][D][NetworkManager.cpp:123] hostByName(): DNS found IPv4 52.18.203.8
[700434][V][ssl_client.cpp:68] start_ssl_client(): Free internal heap before TLS 42800
[700442][V][ssl_client.cpp:75] start_ssl_client(): Starting socket (domain 2)
[700515][V][ssl_client.cpp:166] start_ssl_client(): Seeding the random number generator
[700524][V][ssl_client.cpp:174] start_ssl_client(): Setting up the SSL/TLS structure...
[700532][V][ssl_client.cpp:194] start_ssl_client(): Loading CA cert
[700542][V][ssl_client.cpp:288] start_ssl_client(): Setting hostname for TLS session...
[700551][V][ssl_client.cpp:309] ssl_starttls_handshake(): Performing the SSL/TLS handshake...
[701019][V][ssl_client.cpp:330] ssl_starttls_handshake(): Verifying peer X.509 certificate...
[701028][V][ssl_client.cpp:338] ssl_starttls_handshake(): Certificate verified.
[701035][V][ssl_client.cpp:354] ssl_starttls_handshake(): Free internal heap after TLS 42652
[701043][V][HTTPClient.cpp:242] beginInternal(): url: https://api.thingstream.io/ztp/pointperfect/credentials
[701054][D][HTTPClient.cpp:287] beginInternal(): switching host from '' to 'api.thingstream.io'. disconnecting first
[701064][D][HTTPClient.cpp:380] disconnect(): tcp stop
[701069][V][ssl_client.cpp:360] stop_ssl_socket(): Cleaning SSL connection.
[701080][D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: api.thingstream.io port: 443 url: /ztp/pointperfect/credentials
[701119][D][HTTPClient.cpp:574] sendRequest(): request type: 'POST' redirCount: 0

[701127][E][NetworkClient.cpp:319] setSocketOption(): fail on 0, errno: 9, "Bad file number"
[701135][D][NetworkManager.cpp:123] hostByName(): DNS found IPv4 52.18.203.8
[701142][V][ssl_client.cpp:68] start_ssl_client(): Free internal heap before TLS 42672
[701150][V][ssl_client.cpp:75] start_ssl_client(): Starting socket (domain 2)
[701224][V][ssl_client.cpp:166] start_ssl_client(): Seeding the random number generator
[701232][V][ssl_client.cpp:174] start_ssl_client(): Setting up the SSL/TLS structure...
[701240][V][ssl_client.cpp:194] start_ssl_client(): Loading CA cert
[701250][V][ssl_client.cpp:288] start_ssl_client(): Setting hostname for TLS session...
[701260][V][ssl_client.cpp:309] ssl_starttls_handshake(): Performing the SSL/TLS handshake...
[701714][V][ssl_client.cpp:330] ssl_starttls_handshake(): Verifying peer X.509 certificate...
[701723][V][ssl_client.cpp:338] ssl_starttls_handshake(): Certificate verified.
[701730][V][ssl_client.cpp:354] ssl_starttls_handshake(): Free internal heap after TLS 42520
[701738][D][HTTPClient.cpp:1112] connect():  connected to api.thingstream.io:443
[701920][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
[701928][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Date: Mon, 07 Jul 2025 14:03:01 GMT'
[701937][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Content-Type: application/json'
[701945][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Content-Length: 78'
[701953][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Connection: keep-alive'
[701961][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: ''
[701966][D][HTTPClient.cpp:1257] handleHeaderResponse(): code: 200
[701972][D][HTTPClient.cpp:1260] handleHeaderResponse(): size: 78
[701978][D][HTTPClient.cpp:618] sendRequest(): sendRequest code=200

[701985][V][HTTPClient.cpp:1399] writeToStreamDataBlock(): connection closed or file end (written: 78).
[701994][D][HTTPClient.cpp:378] disconnect(): tcp keep open for reuse
PointPerfect response: {"brokerPort":0,"supportsLband":false,"supportsMqtt":false,"subscriptions":[]}
Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x400958ed  PS      : 0x00060e30  A0      : 0x801042e9  A1      : 0x3ffd3b30
A2      : 0x3ffc729b  A3      : 0x00000000  A4      : 0x00000032  A5      : 0x0000ff00
A6      : 0x00ff0000  A7      : 0xff000000  A8      : 0x00000000  A9      : 0x3ffd3b00
A10     : 0x3ffc729b  A11     : 0x000000ff  A12     : 0x3f40e529  A13     : 0x3ffd3b20
A14     : 0x3ffd3ae0  A15     : 0x00000004  SAR     : 0x00000003  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000  LBEG    : 0x400958ed  LEND    : 0x400958fe  LCOUNT  : 0xffffffff


Backtrace: 0x400958ea:0x3ffd3b30 0x401042e6:0x3ffd3b40 0x40117cb2:0x3ffd3bd0 0x40117f4e:0x3ffd3c50 0x40161e24:0x3ffd3c70 0x4009b27a:0x3ffd3c90




ELF file SHA256: df997f1e08723f13

E (4265) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
E (4273) esp_core_dump_elf: Elf write init failed!
E (4278) esp_core_dump_common: Core dump write failed with error=-1
Rebooting...

It performs the certificate verification twice. Is that expected?
I got Code 200. A good sign.
Is the crash expected?

PC: 0x400958ed: strncpy at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/machine/xtensa/strncpy.S line 249
EXCVADDR: 0x00000000

Decoding stack results
0x400958ea: strncpy at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/machine/xtensa/strncpy.S line 247
0x401042e6: httpClientUpdate() at C:\Users\pc235\Documents\GitHub\SparkFun_RTK_Everywhere_Firmware\Firmware\RTK_Everywhere/HTTP_Client.ino line 616
0x40117cb2: networkUpdate() at C:\Users\pc235\Documents\GitHub\SparkFun_RTK_Everywhere_Firmware\Firmware\RTK_Everywhere/Network.ino line 2365
0x40117f4e: loop() at C:\Users\pc235\Documents\GitHub\SparkFun_RTK_Everywhere_Firmware\Firmware\RTK_Everywhere/RTK_Everywhere.ino line 1397
0x40161e24: loopTask(void*) at C:\Users\pc235\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\cores\esp32\main.cpp line 74
0x4009b27a: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c line 162

It crashed at Line 616 in HTTP_Client.ino:

                    strncpy(settings.ntripClient_CasterHost, (const char *)((*jsonZtp)["rtcmCredentials"]["endpoint"]),
                            sizeof(settings.ntripClient_CasterHost));

Maybe a memory allocation issue?

The code restarts and immediately crashes again:

I2C Devices:
  0x36 - MAX17048 Fuel Gauge
  0x3D - SSD1306 OLED Driver
Display started
==================================
SparkPNT RTK Facet mosaicX5 d99.99
==================================
Reset reason: ESP_RST_PANIC
[  2592][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RX (2) successfully set to 0x40160e34
[  2606][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_TX (3) successfully set to 0x40160e00
[  2618][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_CTS (4) successfully set to 0x40160dcc
[  2630][V][esp32-hal-periman.c:235] perimanSetBusDeinit(): Deinit function for type UART_RTS (5) successfully set to 0x40160d98
[  2642][V][esp32-hal-uart.c:408] uartBegin(): UART2 baud(230400) Mode(800001c) rxPin(13) txPin(14)
[  2651][V][esp32-hal-uart.c:497] uartBegin(): UART2 not installed. Starting installation
Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception).
Debug exception reason: Stack canary watchpoint triggered (GnssUartStart)
Core  1 register dump:
PC      : 0x4009b5f0  PS      : 0x00060236  A0      : 0x40084dde  A1      : 0x3ffd3d20
A2      : 0x00000009  A3      : 0x0000000d  A4      : 0x00000000  A5      : 0xffffffff
A6      : 0x3ffd3ff0  A7      : 0x00000005  A8      : 0x3ffd3fdc  A9      : 0x3ffd3df0
A10     : 0x3ffd3df0  A11     : 0x00000000  A12     : 0x3ffd4014  A13     : 0x00000000
A14     : 0x3ffd3fe4  A15     : 0x3ffd4100  SAR     : 0x00000004  EXCCAUSE: 0x00000001
EXCVADDR: 0x00000000  LBEG    : 0x40095705  LEND    : 0x40095715  LCOUNT  : 0xfffffffc


Backtrace: 0x4009b5ed:0x3ffd3d20 0x40084ddb:0x3ffd4100 0x402fc1f6:0x3ffd4190 0x40160973:0x3ffd41d0 0x40235bb1:0x3ffd4210 0x4015eba5:0x3ffd4290 0x40160fed:0x3ffd42d0 0x40161239:0x3ffd4320 0x40161adb:0x3ffd4360 0x4015910e:0x3ffd43f0 0x400ef666:0x3ffd4440 0x4009b27a:0x3ffd4470




ELF file SHA256: df997f1e08723f13

E (2865) esp_core_dump_flash: Core dump flash config is corrupted! CRC=0x7bd5c66f instead of 0x0
E (2873) esp_core_dump_elf: Elf write init failed!
E (2878) esp_core_dump_common: Core dump write failed with error=-1
Rebooting...

The crash takes place in pinGnssUartTask:

PC: 0x4009b5f0
EXCVADDR: 0x00000000

Decoding stack results
0x402fc1f6: vsnprintf at /builds/idf/crosstool-NG/.build/HOST-i686-w64-mingw32/xtensa-esp32-elf/src/newlib/newlib/libc/stdio/vsnprintf.c line 40
0x40160973: log_printfv at C:\Users\pc235\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\cores\esp32\esp32-hal-uart.c line 903
0x40235bb1: __wrap_log_printf at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/managed_components/espressif__esp_diagnostics/src/esp_diagnostics_log_hook.c line 418
0x4015eba5: perimanSetPinBus at C:\Users\pc235\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\cores\esp32\esp32-hal-periman.c line 160
0x40160fed: _uartAttachPins at C:\Users\pc235\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\cores\esp32\esp32-hal-uart.c line 202
0x40161239: uartSetPins at C:\Users\pc235\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\cores\esp32\esp32-hal-uart.c line 344
0x40161adb: uartBegin at C:\Users\pc235\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\cores\esp32\esp32-hal-uart.c line 552
0x4015910e: HardwareSerial::begin(unsigned long, unsigned long, signed char, signed char, bool, unsigned long, unsigned char) at C:\Users\pc235\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.7\cores\esp32\HardwareSerial.cpp line 338
0x400ef666: pinGnssUartTask(void*) at C:\Users\pc235\Documents\GitHub\SparkFun_RTK_Everywhere_Firmware\Firmware\RTK_Everywhere/Begin.ino line 1047
0x4009b27a: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c line 162

Line 1047 is:

serialGNSS->begin(settings.dataPortBaud, SERIAL_8N1, pin_GnssUart_RX,
                      pin_GnssUart_TX);

Code restarts again.
This time, it reconnects to PointPerfect, gets code 200, and gets RTK Fix almost immediately:

[ 23431][V][HTTPClient.cpp:242] beginInternal(): url: https://api.thingstream.io/ztp/pointperfect/credentials
[ 23441][D][HTTPClient.cpp:287] beginInternal(): switching host from '' to 'api.thingstream.io'. disconnecting first
[ 23452][D][HTTPClient.cpp:380] disconnect(): tcp stop
[ 23456][V][ssl_client.cpp:360] stop_ssl_socket(): Cleaning SSL connection.
[ 23467][D][HTTPClient.cpp:293] beginInternal(): protocol: https, host: api.thingstream.io port: 443 url: /ztp/pointperfect/credentials
[ 23507][D][HTTPClient.cpp:574] sendRequest(): request type: 'POST' redirCount: 0

[ 23514][E][NetworkClient.cpp:319] setSocketOption(): fail on 0, errno: 9, "Bad file number"
[ 23523][D][NetworkManager.cpp:123] hostByName(): DNS found IPv4 54.194.51.7
[ 23530][V][ssl_client.cpp:68] start_ssl_client(): Free internal heap before TLS 42268
[ 23537][V][ssl_client.cpp:75] start_ssl_client(): Starting socket (domain 2)
[ 23634][V][ssl_client.cpp:166] start_ssl_client(): Seeding the random number generator
[ 23642][V][ssl_client.cpp:174] start_ssl_client(): Setting up the SSL/TLS structure...
[ 23650][V][ssl_client.cpp:194] start_ssl_client(): Loading CA cert
[ 23660][V][ssl_client.cpp:288] start_ssl_client(): Setting hostname for TLS session...
[ 23670][V][ssl_client.cpp:309] ssl_starttls_handshake(): Performing the SSL/TLS handshake...
[ 24153][V][ssl_client.cpp:330] ssl_starttls_handshake(): Verifying peer X.509 certificate...
[ 24162][V][ssl_client.cpp:338] ssl_starttls_handshake(): Certificate verified.
[ 24169][V][ssl_client.cpp:354] ssl_starttls_handshake(): Free internal heap after TLS 42416
[ 24177][D][HTTPClient.cpp:1112] connect():  connected to api.thingstream.io:443
[ 24329][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'HTTP/1.1 200 OK'
[ 24337][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Date: Mon, 07 Jul 2025 14:03:30 GMT'
[ 24346][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Content-Type: application/json'
[ 24354][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Content-Length: 253'
[ 24362][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: 'Connection: keep-alive'
[ 24370][V][HTTPClient.cpp:1201] handleHeaderResponse(): RX: ''
[ 24376][D][HTTPClient.cpp:1257] handleHeaderResponse(): code: 200
[ 24382][D][HTTPClient.cpp:1260] handleHeaderResponse(): size: 253
[ 24388][D][HTTPClient.cpp:618] sendRequest(): sendRequest code=200

[ 24394][V][HTTPClient.cpp:1399] writeToStreamDataBlock(): connection closed or file end (written: 253).
[ 24404][D][HTTPClient.cpp:378] disconnect(): tcp keep open for reuse
PointPerfect response: {"brokerPort":0,"supportsLband":false,"supportsMqtt":false,"subscriptions":[],"rtcmCredentials":{"userName":"----------------","password":"----------------j","mountPoint":"NEAR-RTCM","endpoint":"ppntrip.services.u-blox.com","httpPort":"2101","httpsPort":"2102"}}
[ 24548][D][NVM.ino:199] recordSystemSettingsToFileLFS(): Removing LittleFS: /SFE_Facet_mosaic_Settings_0.txt
Credentials successfully updated!
NTRIP Client start
[ 24989][V][ssl_client.cpp:360] stop_ssl_socket(): Cleaning SSL connection.
HTTP Client stopped
Rover Accuracy (m): 0.325, SIV: 53 GNSS State: DGPS Fix
[ 25146][D][NetworkManager.cpp:123] hostByName(): DNS found IPv4 54.216.128.133
[ 25289][D][NtripClient.ino:735] ntripClientUpdate(): Caster Response: ICY 200 OK
Ntrip-Version: Ntrip/1.0
Ntrip-Flags: st_filter,st_auth,st_match,st_strict,rtsp
Server: NTRIP PointPerfectCaster/2.0
Date: Mon Jul 07 14:03:31 UTC 2025
Connection: close
Cache-Control: no-store, no-cache, max-age=0
Content-Type: gnss/data


NTRIP Client connected to ppntrip.services.u-blox.com:2101 via 192.168.0.125:52530 at 14:03:25
Batt (84%): Voltage: 4.06V Discharging: -3.33%/hr Charger Status: Standby
Rover Accuracy (m): 0.314, SIV: 54 GNSS State: DGPS Fix
STATE_ROVER_FIX --> STATE_ROVER_RTK_FIX, 2025-07-07 14:03:27.696
Rover Accuracy (m): 0.008, SIV: 54 GNSS State: RTK Fix
Batt (84%): Voltage: 4.06V Discharging: -3.33%/hr Charger Status: Standby
Rover Accuracy (m): 0.008, SIV: 55 GNSS State: RTK Fix
Rover Accuracy (m): 0.008, SIV: 55 GNSS State: RTK Fix
Rover Accuracy (m): 0.007, SIV: 55 GNSS State: RTK Fix

Mostly good. But we've got some gremlins to find...

@PaulZC
Copy link
Contributor

PaulZC commented Jul 7, 2025

The crash at line 616 in httpClient.ino is almost certainly caused by the JSON endpoint not being present.

PointPerfect returned: PointPerfect response: {"brokerPort":0,"supportsLband":false,"supportsMqtt":false,"subscriptions":[]}

The code was attempting to find ["rtcmCredentials"]["endpoint"] and it's not there...

It's not there, because PointPerfect is still busy activating the plan.

We either need a combination of:

  • a delay
  • a retry
  • use findZtpJSONEntryTnT / findZtpJSONEntryTTnT to check if (e.g.) the endpoint exists, before attempting to copy it

@PaulZC
Copy link
Contributor

PaulZC commented Jul 7, 2025

I think the HardwareSerial.begin crash was probably caused by serialGNSS not being initialized to nullptr. I suspect junk in the memory caused the if (serialGNSS == nullptr) (two lines above) to return false...?

At line 547 in RTK_Everywhere.ino, I believe we should change:

HardwareSerial *serialGNSS;  // Don't instantiate until we know what gnssPlatform we're on
HardwareSerial *serial2GNSS; // Don't instantiate until we know what gnssPlatform we're on

to

HardwareSerial *serialGNSS = nullptr;  // Don't instantiate until we know what gnssPlatform we're on
HardwareSerial *serial2GNSS = nullptr; // Don't instantiate until we know what gnssPlatform we're on

@PaulZC
Copy link
Contributor

PaulZC commented Jul 8, 2025

These issues are resolved by #667

Copy link
Contributor

@PaulZC PaulZC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great. Please merge #667 into this branch before you merge. It resolves the crashes and includes some nice-to-haves.

@nseidle nseidle merged commit 041c84a into release_candidate Jul 8, 2025
@nseidle nseidle deleted the PointPerfectRTCM branch July 10, 2025 21:13
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

Successfully merging this pull request may close these issues.

2 participants