Closed fng97 closed 9 months ago
Could it be that the first time cellular connects (after being offline for hours), IP connectivity is not yet "that ready" (whatever that could mean). And the next tries are much more smoother (cell connection is "hot")?
Would be interesting to see if a delay between cel connect and ntrip connect makes a difference (or retrying ntrip instead of going to error state, without a reboot) makes things better
@dbou-ublox
Could it be that the first time cellular connects (after being offline for hours), IP connectivity is not yet "that ready" (whatever that could mean). And the next tries are much more smoother (cell connection is "hot")?
Would be interesting to see if a delay between cel connect and ntrip connect makes a difference (or retrying ntrip instead of going to error state, without a reboot) makes things better
Heya!
I did try adding a 2 second delay here with no luck. Still seemed to fail/succeed unpredictably.
I also couldn't figure out what error code is referred to in: Error reading from socket, socket errno -> [0]
. Any ideas? Could it be that it's the number of bytes read? If that's the case, maybe the socket just has too short a timeout?
Hi @fng97
The error you run into means that the server is responding in an unexpected way that the HPGLib NTRIP client cannot handle.
Can you please provide the caster and/or mountpoint you are using so that we can test it?
Hi @fng97
The error you run into means that the server is responding in an unexpected way that the HPGLib NTRIP client cannot handle.
Can you please provide the caster and/or mountpoint you are using so that we can test it?
Hiya @anik-ublox! I tested this using RTKFnet. We use this provider in production and use a reserved mountpoint. I can raise this with them if we believe the issue is on their side.
Hello @fng97 ,
Unfortunately the provider you are using does not offer a trial account that we can test however we want to investigate more into your issue and find out what the problem is.
I'm uploading a patch for the NTRIP client with some more loggings to see the response you are getting from the caster and hopefully make our client compatible with the service you are using.
Would you mind building the example with this patch and providing us with the console output?
Hiya @anik-ublox. Sorry for the delay in getting back to you. I no longer have my dev kit. It is with a colleague for a few weeks. I will follow up on this as soon as possible.
Hiya @anik-ublox, sorry again for the delay. I won't be able to test this any time soon. I'll go ahead and close this.
I have observed an issue where NTRIP sometimes fails to connect. The first time I ran this example, it connected successfully. The next day, the first two times I tried to run it (with SD card logging enabled), it failed to connect. However, subsequent tries (manually resetting the board using the reset button) worked most of the time. I'm not sure, but I get the impression it happens more often the first time the program starts after hooking up the dev board.
Environment
Reproduction Steps
From
XPLR-HPG-SW
directory in a clean repo:hpg_cell_ntrip_correction
inXPLR-HPG-SW/CMakeLists.txt
ubxlib
:git submodule update --init
get_idf
cmake -S . -B build -G Ninja
menuconfig
:ninja -C build menuconfig
XPLR HPG2 C214
hpg_cell_ntrip_correction.c
, enable logging (#define APP_SD_LOGGING_ENABLED 1U
) and extend app time (#define APP_RUN_TIME_SEC (3*10*60)
).cmake --build build
ESPPORT=/dev/cu.SLAB_USBtoUART ninja -C build flash
Terminal Outputs
Expand configure step (4) terminal output:
``` fng@Franciscos-MacBook-Pro XPLR-HPG-SW % cmake -S . -B build -G Ninja -- -----------Package Info--------- -- XPLR_HPG_SW_PATH is /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW -- XPLR_HPG_EXAMPLE_SELECTED: hpg_cell_ntrip_correction -- Loading source files... -- Loaded from: examples/cellular/04_hpg_cell_ntrip_correction -- IDF_TARGET not set, using default target: esp32 -- Found Git: /opt/homebrew/bin/git (found version "2.42.0") -- Component directory /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW/components/ubxlib does not contain a CMakeLists.txt file. No component will be added -- The C compiler identification is GNU 8.4.0 -- The CXX compiler identification is GNU 8.4.0 -- The ASM compiler identification is GNU -- Found assembler: /Users/fng/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /Users/fng/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /Users/fng/.espressif/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-g++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Building ESP-IDF components for target esp32 -- Checking Python dependencies... /Users/fng/esp/esp-idf/tools/check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources Python requirements from /Users/fng/esp/esp-idf/requirements.txt are satisfied. -- -----------Board Info--------- -- IDF_TARGET = esp32 -- Board DIR = -- ---------Board Info End--------- -- -----------Project Info--------- -- Building Component: hpglib -- -----------Project Info--------- -- Building Component: xplr_mqtt -- -----------Project Info--------- -- Building Component: xplr_wifi_starter -- Project sdkconfig file /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW/sdkconfig Loading defaults file /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW/sdkconfig.defaults... CMake Deprecation Warning at /Users/fng/esp/esp-idf/components/mbedtls/mbedtls/CMakeLists.txt:23 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argumentExpand build step (6) terminal output:
``` fng@Franciscos-MacBook-Pro XPLR-HPG-SW % cmake --build build [0/1] Re-running CMake... -- -----------Package Info--------- -- XPLR_HPG_SW_PATH is /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW -- XPLR_HPG_EXAMPLE_SELECTED: hpg_cell_ntrip_correction -- Loading hpg_cell_ntrip_correction source files... -- Loaded from: examples/cellular/04_hpg_cell_ntrip_correction -- Component directory /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW/components/ubxlib does not contain a CMakeLists.txt file. No component will be added -- Building ESP-IDF components for target esp32 -- Checking Python dependencies... /Users/fng/esp/esp-idf/tools/check_python_dependencies.py:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources Python requirements from /Users/fng/esp/esp-idf/requirements.txt are satisfied. -- -----------Board Info--------- -- IDF_TARGET = esp32 -- Board DIR = -- ---------Board Info End--------- -- -----------Project Info--------- -- Building Component: hpglib -- -----------Project Info--------- -- Building Component: xplr_mqtt -- -----------Project Info--------- -- Building Component: xplr_wifi_starter -- Project sdkconfig file /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW/sdkconfig Loading defaults file /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW/sdkconfig.defaults... CMake Deprecation Warning at /Users/fng/esp/esp-idf/components/mbedtls/mbedtls/CMakeLists.txt:23 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Update the VERSION argumentExpand flashing step (7) terminal output:
``` fng@Franciscos-MacBook-Pro XPLR-HPG-SW % ESPPORT=/dev/cu.SLAB_USBtoUART ninja -C build flash ninja: Entering directory `build' [1/5] cd /Users/fng/Downloads/XPLR-HPG-soft...-HPG-SW/build/hpg_cell_ntrip_correction.bi hpg_cell_ntrip_correction.bin binary size 0x762e0 bytes. Smallest app partition is 0x300000 bytes. 0x289d20 bytes (85%) free. [2/5] Performing build step for 'bootloader' [1/1] cd /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW/build/bootloader/esp-idf/esptool_py && python /Users/fng/esp/esp-idf/components/partition_table/check_sizes.py --offset 0x8000 bootloader 0x1000 /Users/fng/Downloads/XPLR-HPG-software/XPLR-HPG-SW/build/bootloader/bootloader.bin Bootloader binary size 0x6330 bytes. 0xcd0 bytes (11%) free. [4/5] cd /Users/fng/esp/esp-idf/components/...components/esptool_py/run_serial_tool.cmak Note: python /Users/fng/esp/esp-idf/components/esptool_py/esptool/esptool.py --chip esp32 will attempt to set baud rate automatically. To specify a baud rate, set the ESPBAUD environment variable. esptool.py esp32 -p /dev/cu.SLAB_USBtoUART --before=default_reset --after=hard_reset write_flash --flash_mode dio --flash_freq 40m --flash_size 8MB 0x1000 bootloader/bootloader.bin 0x10000 hpg_cell_ntrip_correction.bin 0x8000 partition_table/partition-table.bin esptool.py v3.3.2-dev Serial port /dev/cu.SLAB_USBtoUART Connecting..... Chip is ESP32-D0WD-V3 (revision 3) Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None Crystal is 40MHz MAC: e8:31:cd:da:68:c0 Uploading stub... Running stub... Stub running... Configuring flash size... Flash will be erased from 0x00001000 to 0x00007fff... Flash will be erased from 0x00010000 to 0x00086fff... Flash will be erased from 0x00008000 to 0x00008fff... Compressed 25392 bytes to 15881... Writing at 0x00001000... (100 %) Wrote 25392 bytes (15881 compressed) at 0x00001000 in 1.7 seconds (effective 121.9 kbit/s)... Hash of data verified. Compressed 484064 bytes to 272737... Writing at 0x00010000... (5 %) Writing at 0x0001f213... (11 %) Writing at 0x0002ca6e... (17 %) Writing at 0x000328a6... (23 %) Writing at 0x00037e9d... (29 %) Writing at 0x0003de6f... (35 %) Writing at 0x00043c3c... (41 %) Writing at 0x0004970a... (47 %) Writing at 0x0004f22d... (52 %) Writing at 0x00054a7b... (58 %) Writing at 0x0005a133... (64 %) Writing at 0x000606cd... (70 %) Writing at 0x00066693... (76 %) Writing at 0x0006c5a8... (82 %) Writing at 0x00075bdf... (88 %) Writing at 0x0007c66a... (94 %) Writing at 0x000821d7... (100 %) Wrote 484064 bytes (272737 compressed) at 0x00010000 in 24.1 seconds (effective 160.4 kbit/s)... Hash of data verified. Compressed 3072 bytes to 105... Writing at 0x00008000... (100 %) Wrote 3072 bytes (105 compressed) at 0x00008000 in 0.0 seconds (effective 515.9 kbit/s)... Hash of data verified. Leaving... Hard resetting via RTS pin... ```I have observed the following issue:
An issue with NTRIP not connecting (in this case after hitting the reset button):
``` ets Jul 29 2019 12:21:46 rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:6660 load:0x40078000,len:14848 ho 0 tail 12 room 4 load:0x40080400,len:3792 0x40080400: _init at ??:? entry 0x40080694 I (29) boot: ESP-IDF v4.4.2 2nd stage bootloader I (29) boot: compile time 11:21:28 I (29) boot: chip revision: 3 I (32) boot_comm: chip revision: 3, min. bootloader chip revision: 0 I (39) boot.esp32: SPI Speed : 40MHz I (44) boot.esp32: SPI Mode : DIO I (48) boot.esp32: SPI Flash Size : 8MB I (53) boot: Enabling RNG early entropy source... I (58) boot: Partition Table: I (62) boot: ## Label Usage Type ST Offset Length I (69) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (76) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (84) boot: 2 factory factory app 00 00 00010000 00300000 I (91) boot: End of partition table I (96) boot_comm: chip revision: 3, min. application chip revision: 0 I (103) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=1a2f4h (107252) map I (150) esp_image: segment 1: paddr=0002a31c vaddr=3ffb0000 size=02724h ( 10020) load I (154) esp_image: segment 2: paddr=0002ca48 vaddr=40080000 size=035d0h ( 13776) load I (162) esp_image: segment 3: paddr=00030020 vaddr=400d0020 size=4b148h (307528) map I (276) esp_image: segment 4: paddr=0007b170 vaddr=400835d0 size=0bd24h ( 48420) load I (296) esp_image: segment 5: paddr=00086e9c vaddr=50000000 size=00010h ( 16) load I (303) boot: Loaded app from partition at offset 0x10000 I (304) boot: Disabling RNG early entropy source... I (316) cpu_start: Pro cpu up. I (316) cpu_start: Starting app cpu, entry point is 0x40081364 0x40081364: call_start_cpu1 at /Users/fng/esp/esp-idf/components/esp_system/port/cpu_start.c:160 I (0) cpu_start: App cpu up. I (332) cpu_start: Pro cpu start user code I (332) cpu_start: cpu freq: 160000000 I (333) cpu_start: Application information: I (337) cpu_start: Project name: hpg_cell_ntrip_correction I (344) cpu_start: App version: v1.0-dirty I (349) cpu_start: Compile time: Sep 26 2023 11:21:06 I (355) cpu_start: ELF file SHA256: 2855700b499c5879... I (361) cpu_start: ESP-IDF: v4.4.2 I (366) heap_init: Initializing. RAM available for dynamic allocation: I (373) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (379) heap_init: At 3FFB9780 len 00026880 (154 KiB): DRAM I (385) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (392) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (398) heap_init: At 4008F2F4 len 00010D0C (67 KiB): IRAM I (405) spi_flash: detected chip: mxic I (409) spi_flash: flash io: dio I (414) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (432) gpio: GPIO[32]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (481) sdspi_transaction: cmd=5, R1 response: command not supported I [(684) app|app_main|243|: XPLR-HPG-SW Demo: NTRIP Cellular Client I [(686) app|appInitBoard|455|: Initializing board. I (689) gpio: GPIO[2]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (695) gpio: GPIO[15]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (704) gpio: GPIO[26]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (713) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (723) gpio: GPIO[38]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 D [(732) xplrBoard|xplrBoardInit|114|: Board init Done I (737) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0 D [(746) app|appInitBoard|471|: Boot0 pin configured as button OK D [(755) app|appInitBoard|472|: Board Initialized D [(812) xplrCommonHelpers|xplrHelpersUbxlibInit|131|: ubxlib init ok! W [(817) app|gnssInit|664|: Waiting for GNSS device to come online! D [(828) xplrGnss|xplrGnssStartDevice|597|: GNSS module configured successfully. D [(835) hpgCom|xplrUbxlibInit|148|: ubxlib init ok D [(839) hpgCom|xplrUbxlibInit|152|: ubxlib dvc init ok D [(843) hpgCom|dvcGetFirstFreeSlot|537|: ret index: 0 D [(847) hpgCom|cellSetConfig|594|: ok: 0 D [(851) hpgCom|xplrComCellInit|196|: ok, module settings configured D [(881) xplrGnss|xplrGnssFsm|627|: Logging is enabled. Trying to initialize. I [(885) xplrGnss|xplrGnssAsyncLogInit|2009|: Initializing async logging D [(902) xplrGnss|xplrGnssFsm|630|: Sucessfully initialized GNSS logging. I [(2728) xplrCommonHelpers|xplrHlprLocSrvcDeviceOpenNonBlocking|226|: ubxlib device opened! I [(2733) xplrCommonHelpers|xplrHlprLocSrvcDeviceOpenNonBlocking|229|: Network interface opened! D [(2745) xplrGnss|xplrGnssFsm|654|: Trying to open device. I [(3009) xplrCommonHelpers|xplrHlprLocSrvcGetDeviceInfo|412|: Got device info. ========= Device Info ========= Module variant: ZED-F9R Module version: EXT CORE 1.00 (a59682) Hardware version: 00190000 Rom: 0x118B2060 Firmware: HPS 1.30 Protocol: 33.30 ID: 554192fb00 ------------------------------- I2C Port: 0 I2C Address: 0x42 I2C SDA pin: 21 I2C SCL pin: 22 =============================== D [(3034) xplrGnss|xplrGnssFsm|664|: Configuration Completed. D [(3061) xplrGnss|xplrGnssFsm|893|: Trying to restart GNSS device. D [(3065) xplrCommonHelpers|xplrHlprLocSrvcSendUbxFormattedCommand|478|: Sent UBX data [12] bytes. D [(3069) xplrGnss|gnssDeviceRestart|2213|: Reset command issued succesfully D [(3075) xplrGnss|xplrGnssUbxMessagesAsyncStop|1242|: Looks like Gnss UBX Messages async is not running. Nothing to do. D [(3093) xplrGnss|xplrGnssNmeaMessagesAsyncStop|1211|: Looks like Gnss Get Fix Type async is not running. Nothing to do. D [(3098) xplrGnss|xplrGnssStopAllAsyncs|1273|: Stopped all async getters. D [(3112) xplrCommonHelpers|xplrHlprLocSrvcDeviceClose|249|: ubxlib device closed! D [(3116) xplrGnss|gnssDeviceStop|2246|: Sucessfully stoped GNSS device. D [(3119) xplrGnss|gnssDeviceRestart|2216|: Device stop command issued succesfully D [(3133) xplrGnss|gnssDeviceRestart|2217|: Restart routine executed succesfully. D [(3137) xplrGnss|xplrGnssFsm|896|: Restart succeeded. D [(3621) xplrGnss|xplrGnssFsm|654|: Trying to open device. I [(7458) xplrCommonHelpers|xplrHlprLocSrvcDeviceOpenNonBlocking|226|: ubxlib device opened! I [(7470) xplrCommonHelpers|xplrHlprLocSrvcDeviceOpenNonBlocking|229|: Network interface opened! D [(7474) xplrGnss|xplrGnssFsm|654|: Trying to open device. I [(7737) xplrCommonHelpers|xplrHlprLocSrvcGetDeviceInfo|412|: Got device info. ========= Device Info ========= Module variant: ZED-F9R Module version: EXT CORE 1.00 (a59682) Hardware version: 00190000 Rom: 0x118B2060 Firmware: HPS 1.30 Protocol: 33.30 ID: 554192fb00 ------------------------------- I2C Port: 0 I2C Address: 0x42 I2C SDA pin: 21 I2C SCL pin: 22 =============================== D [(7765) xplrGnss|xplrGnssFsm|667|: Restart Completed. D [(7785) xplrGnss|xplrGnssFsm|691|: xSemWatchdog created successfully D [(7789) xplrGnss|xplrGnssFsm|693|: Successfully released xSemWatchdog! D [(7803) xplrGnss|xplrGnssFsm|715|: Trying to set GNSS generic location settings. D [(7928) xplrCommonHelpers|xplrHlprLocSrvcOptionMultiValSet|319|: Set multiple configuration values. D [(7932) xplrGnss|xplrGnssFsm|719|: Set generic location settings on GNSS module. D [(7953) xplrGnss|xplrGnssFsm|727|: Trying to set correction data decryption keys. D [(7957) xplrGnss|xplrGnssFsm|738|: No keys stored. Skipping. D [(7971) xplrGnss|xplrGnssFsm|745|: Trying to set correction data source. D [(8087) xplrCommonHelpers|xplrHlprLocSrvcOptionSingleValSet|295|: Set configuration value. D [(8098) xplrGnss|xplrGnssFsm|748|: Set configured correction data source. D [(8112) xplrGnss|xplrGnssFsm|758|: Trying to start async getters. D [(8136) xplrGnss|xplrGnssNmeaMessagesAsyncStart|1129|: Started Gnss NMEA async. D [(8146) xplrGnss|xplrGnssUbxMessagesAsyncStart|1164|: Started Gnss UBX Messages async. D [(8151) xplrGnss|xplrGnssStartAllAsyncs|1186|: Started all async getters. D [(8165) xplrGnss|xplrGnssFsm|775|: Trying to init NVS. D [(8224) xplrNvs|xplrNvsInit|121|: nvs init ok D [(8227) xplrNvs|xplrNvsInit|136|: NVS data partition found D [(8228) xplrNvs|xplrNvsInit|155|: namespace set: