espressif / esp-protocols

Collection of ESP-IDF components related to networking protocols
198 stars 135 forks source link

Getting "ESP_ERR_TIMEOUT" on `esp_modem_get_signal_quality` call when running example code (IDFGH-13531) #639

Closed gamename closed 3 months ago

gamename commented 3 months ago

Answers checklist.

What component are you using? If you choose Other, provide details in More Information.

esp_modem

component version

1.1.0

IDF version.

5.2.1

More Information.

Hi,

First, let me say this is my first time working with cellular modems, so its probable there is a misconfiguration somewhere...

I'm using a SIM7600X HAT with an ESP32-S3-DevKitC-1-N16. When running the example code (see below), I get this error:

E (00:00:14.767) pppos_example: esp_modem_get_signal_quality failed with 263 ESP_ERR_TIMEOUT

The SIM7600X is meant as a HAT for Raspberry Pi (RPi), but can be used by other microcontrollers (like the ESP32). I confirmed this with the vendor.

Here are the relevant debugging datapoints:

  1. I am using this example code.
  2. There is a UART connection between my ESP32 and the SIM7600X.
  3. The SIM7600X has 2 interfaces, one for RPi and one for Non-RPi connections. I'm using the non-RPi connections (aka the yellow pins).
  4. The SIM7600X on-board jumpers are set to the "B" setting.
  5. I am using GPIO 17 (Tx) and GPIO 16 (Rx) on the ESP32
  6. I also connect GND from the ESP32 to GND on the SIM7600X
  7. My provider is Hologram. While running the example app, Hologram shows the board as connected, so the SIM7600X board itself is working.
  8. The SIM7600X board LEDs are illuminated.

Here is output from the ESP32 log:

idf monitor
Executing action: monitor
Serial port /dev/cu.usbmodem21101
Connecting...
Detecting chip type... ESP32-S3
Running idf_monitor in directory /Users/tennis/src/C2DS-esp32-coop-controller
Executing "/Users/tennis/.espressif/python_env/idf5.2_py3.12_env/bin/python /Users/tennis/esp/esp-idf/tools/idf_monitor.py -p /dev/cu.usbmodem21101 -b 115200 --toolchain-prefix xtensa-esp32s3-elf- --target esp32s3 --revision 0 /Users/tennis/src/C2DS-esp32-coop-controller/build/firmware.elf -m '/Users/tennis/.espressif/python_env/idf5.2_py3.12_env/bin/python' '/Users/tennis/esp/esp-idf/tools/idf.py'"...
--- esp-idf-monitor 1.4.0 on /dev/cu.usbmodem21101 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x15 (USB_UART_CHIP_RESET),boot:0x29 (SPI_FAST_FLASH_BOOT)
Saved PC:0x40048d00
0x40048d00: uart_rx_one_char in ROM

SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3810,len:0x178c
load:0x403c9700,len:0x4
load:0x403c9704,len:0xcbc
load:0x403cc700,len:0x2da0
SHA-256 comparison failed:
Calculated: 92b6991ae9c9ceb6d9c17ffaa1bba262a31f484d5c3b10fb0c04d18c8a14b89b
Expected: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
Attempting to boot anyway...
entry 0x403c9914
I (45) boot: ESP-IDF v5.2.1 2nd stage bootloader
I (45) boot: compile time Aug 22 2024 05:49:53
I (45) boot: Multicore bootloader
I (48) boot: chip revision: v0.1
I (52) boot.esp32s3: Boot SPI Speed : 80MHz
I (57) boot.esp32s3: SPI Mode       : DIO
I (62) boot.esp32s3: SPI Flash Size : 16MB
I (66) boot: Enabling RNG early entropy source...
I (72) boot: Partition Table:
I (75) boot: ## Label            Usage          Type ST Offset   Length
I (83) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (90) boot:  1 otadata          OTA data         01 00 0000f000 00002000
I (98) boot:  2 phy_init         RF data          01 01 00011000 00001000
I (105) boot:  3 factory          factory app      00 00 00020000 00120000
I (113) boot:  4 ota_0            OTA app          00 10 00140000 00120000
I (120) boot:  5 ota_1            OTA app          00 11 00260000 00120000
I (128) boot: End of partition table
I (132) boot: Defaulting to factory image
I (137) esp_image: segment 0: paddr=00020020 vaddr=3c080020 size=332d0h (209616) map
I (169) esp_image: segment 1: paddr=000532f8 vaddr=3fc93a00 size=02b90h ( 11152) load
I (171) esp_image: segment 2: paddr=00055e90 vaddr=40374000 size=0a188h ( 41352) load
I (181) esp_image: segment 3: paddr=00060020 vaddr=42000020 size=7ef3ch (519996) map
I (241) esp_image: segment 4: paddr=000def64 vaddr=4037e188 size=05838h ( 22584) load
I (251) boot: Loaded app from partition at offset 0x20000
I (251) boot: Disabling RNG early entropy source...
I (263) cpu_start: Multicore app
D (263) cpu_start: Pro cpu up
D (263) cpu_start: Starting app cpu, entry point is 0x40375374
0x40375374: call_start_cpu1 at /Users/tennis/esp/esp-idf-v5.2.1/components/esp_system/port/cpu_start.c:183

D (0) cpu_start: App cpu up
D (273) clk: RTC_SLOW_CLK calibration value: 3677914
I (284) cpu_start: Pro cpu start user code
I (284) cpu_start: cpu freq: 160000000 Hz
I (284) cpu_start: Application information:
I (287) cpu_start: Project name:     firmware
I (292) cpu_start: App version:      v1.0.0-f3708a6-36-g45be688-dirt
I (299) cpu_start: Compile time:     Aug 22 2024 05:54:59
I (305) cpu_start: ELF file SHA256:  e842a28cb...
I (311) cpu_start: ESP-IDF:          v5.2.1
I (316) cpu_start: Min chip rev:     v0.0
I (320) cpu_start: Max chip rev:     v0.99 
I (325) cpu_start: Chip rev:         v0.1
D (330) memory_layout: Checking 6 reserved memory ranges:
D (335) memory_layout: Reserved memory range 0x3fc84000 - 0x3fc93a00
D (342) memory_layout: Reserved memory range 0x3fc93a00 - 0x3fc98080
D (348) memory_layout: Reserved memory range 0x3fceee34 - 0x3fcf0000
D (355) memory_layout: Reserved memory range 0x40374000 - 0x40383a00
0x40374000: _WindowOverflow4 at /Users/tennis/esp/esp-idf-v5.2.1/components/xtensa/xtensa_vectors.S:2027

D (361) memory_layout: Reserved memory range 0x600fe000 - 0x600fe010
D (367) memory_layout: Reserved memory range 0x600fffe8 - 0x60100000
D (374) memory_layout: Building list of available memory regions:
D (380) memory_layout: Available memory region 0x3fc98080 - 0x3fca0000
D (387) memory_layout: Available memory region 0x3fca0000 - 0x3fcb0000
D (393) memory_layout: Available memory region 0x3fcb0000 - 0x3fcc0000
D (400) memory_layout: Available memory region 0x3fcc0000 - 0x3fcd0000
D (406) memory_layout: Available memory region 0x3fcd0000 - 0x3fce0000
D (413) memory_layout: Available memory region 0x3fce0000 - 0x3fce9710
D (420) memory_layout: Available memory region 0x3fce9710 - 0x3fceee34
D (426) memory_layout: Available memory region 0x3fcf0000 - 0x3fcf8000
D (433) memory_layout: Available memory region 0x600fe010 - 0x600fffe8
I (439) heap_init: Initializing. RAM available for dynamic allocation:
D (447) heap_init: New heap initialised at 0x3fc98080
I (452) heap_init: At 3FC98080 len 00051690 (325 KiB): RAM
I (458) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
D (464) heap_init: New heap initialised at 0x3fcf0000
I (469) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
D (475) heap_init: New heap initialised at 0x600fe010
I (480) heap_init: At 600FE010 len 00001FD8 (7 KiB): RTCRAM
D (487) intr_alloc: Connected src 39 to int 2 (cpu 0)
D (492) spi_flash: trying chip: issi
D (495) spi_flash: trying chip: gd
I (499) spi_flash: detected chip: gd
I (503) spi_flash: flash io: dio
D (507) cpu_start: calling init function: 0x42066084
0x42066084: _GLOBAL__sub_I__ZN17__eh_globals_init7_S_initE at /Users/brnomac003/.gitlab-runner/builds/qR2TxTby/0/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_globals.cc:162

D (512) cpu_start: calling init function: 0x42065e24
0x42065e24: _GLOBAL__sub_I__ZN9__gnu_cxx9__freeresEv at /Users/brnomac003/.gitlab-runner/builds/qR2TxTby/0/idf/crosstool-NG/.build/xtensa-esp-elf/src/gcc/libstdc++-v3/libsupc++/eh_alloc.cc:462

D (517) cpu_start: calling init function: 0x42038424
0x42038424: esp_ds_conn_lock at /Users/tennis/esp/esp-idf-v5.2.1/components/mbedtls/port/esp_ds/esp_rsa_sign_alt.c:51

D (522) cpu_start: calling init function: 0x4201a308
0x4201a308: esp_ipc_init at /Users/tennis/esp/esp-idf-v5.2.1/components/esp_system/esp_ipc.c:114

D (527) cpu_start: calling init function: 0x40379810
0x40379810: enable_timer_group0_for_calibration at /Users/tennis/esp/esp-idf-v5.2.1/components/esp_hw_support/port/esp32s3/rtc_time.c:199

D (532) cpu_start: calling init function: 0x42003adc
0x42003adc: esp_app_format_init_elf_sha256 at /Users/tennis/esp/esp-idf-v5.2.1/components/esp_app_format/esp_app_desc.c:68

D (537) cpu_start: calling init function: 0x42008dfc on core: 0
0x42008dfc: __esp_system_init_fn_esp_timer_startup_init at /Users/tennis/esp/esp-idf-v5.2.1/components/esp_timer/src/esp_timer.c:578

D (544) intr_alloc: Connected src 59 to int 3 (cpu 0)
D (548) cpu_start: calling init function: 0x4200689c on core: 0
0x4200689c: __esp_system_init_fn_esp_sleep_startup_init at /Users/tennis/esp/esp-idf-v5.2.1/components/esp_hw_support/sleep_gpio.c:189

I (555) sleep: Configure to isolate all GPIO pins in sleep state
I (561) sleep: Enable automatic switching of GPIO sleep configuration
D (568) cpu_start: calling init function: 0x42004de4 on core: 0
0x42004de4: __esp_system_init_fn_init_components0 at /Users/tennis/esp/esp-idf-v5.2.1/components/esp_system/startup.c:493

D (575) intr_alloc: Connected src 79 to int 9 (cpu 0)
D (579) app_start: Starting scheduler on CPU0
D (584) intr_alloc: Connected src 57 to int 12 (cpu 0)
D (584) intr_alloc: Connected src 80 to int 2 (cpu 1)
D (594) app_start: Starting scheduler on CPU1
D (594) intr_alloc: Connected src 58 to int 3 (cpu 1)
I (00:00:14.152) main_task: Started on CPU0
D (604) heap_init: New heap initialised at 0x3fce9710
D (604) intr_alloc: Connected src 52 to int 13 (cpu 0)
I (00:00:14.182) main_task: Calling app_main()
D (00:00:14.188) esp_netif_lwip: LwIP stack has been initialized
D (00:00:14.194) esp_netif_lwip: esp-netif has been successfully initialized
D (00:00:14.201) event: running task for loop 0x3fc9e898
D (00:00:14.206) event: created task for loop 0x3fc9e898
D (00:00:14.211) event: created event loop 0x3fc9e898
D (00:00:14.217) esp_netif_lwip: check: remote, if=0x3fc9bc60 fn=0x4201c5f8
0x4201c5f8: esp_netif_new_api at /Users/tennis/esp/esp-idf-v5.2.1/components/esp_netif/lwip/esp_netif_lwip.c:690

D (00:00:14.224) esp_netif_objects: esp_netif_add_to_list_unsafe netif added successfully (total netifs: 1)
ppp phase changed[1]: phase=0
D (00:00:14.236) esp-netif_lwip-ppp: esp_netif_new_ppp: PPP connection created: 0x3fc9fa68
D (00:00:14.244) esp-netif_lwip-ppp: Phase Dead
D (00:00:14.249) esp_netif_lwip: call api in lwip: ret=0x0, give sem
I (00:00:14.256) pppos_example: Initializing esp_modem for the SIM7600 module...
I (00:00:14.264) uart: queue free spaces: 30
D (704) intr_alloc: Connected src 28 to int 17 (cpu 0)
E (00:00:14.767) pppos_example: esp_modem_get_signal_quality failed with 263 ESP_ERR_TIMEOUT
I (00:00:14.768) main_task: Returned from app_main()

PXL_20240822_113928544

david-cermak commented 3 months ago

Hi @gamename

I'd suggest that you start with this example: https://github.com/espressif/esp-protocols/tree/master/components/esp_modem/examples/modem_console

This helps fixing the initial connection issues, like wires, baudrate, power supply etc. Since the problem you're experiencing suggests that the modem and the ESP32 cannot exchange a basic AT request/reply.

gamename commented 3 months ago

Hi @gamename

I'd suggest that you start with this example: https://github.com/espressif/esp-protocols/tree/master/components/esp_modem/examples/modem_console

This helps fixing the initial connection issues, like wires, baudrate, power supply etc. Since the problem you're experiencing suggests that the modem and the ESP32 cannot exchange a basic AT request/reply.

Will do. Thanks.

gamename commented 3 months ago

Abandoned use of the Waveshare equipment. Switched to Sixfab