Using IDF in vscode but want to add support for a 4G USB modem eg from esp-iot-solution repository

MichaelS
Posts: 34
Joined: Mon Jul 08, 2024 12:08 am

Using IDF in vscode but want to add support for a 4G USB modem eg from esp-iot-solution repository

Postby MichaelS » Sun Dec 01, 2024 5:53 am

Hi
I am developing a project using ESP32-S3 IDF SDK 5.3.1 in vscode
I am now wanting to add support for a 4G modem module using the USB port.
I thought I would start with the example project usb_cdc_4g_module. I downloaded this directory and opened it in vscode. I found the
iot_usbh_modem component does not exist in IDF.

My ultimate goal is to merge this functionality into my main project using my local IDF installation. But is esp-iot-solution compatible with IDF?

I downloaded and copied all usb sub directories including iot_usbh_modem into my ...\esp\v5.3.1\esp-idf\components\usb directory
I edited my idf_component.yml file so it could find the iot_usbh_modem directory

Code: Select all

    version: "^1.0.0"
    override_path: "/Users/micha/esp/v5.3.1/esp-idf/components/usb/iot_usbh_modem"
I configured the project with menuconfig and successfully built and flashed the project.
But when I run it I get the following logs:

Code: Select all

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1     
load:0x3fce2820,len:0x1918
load:0x403c8700,len:0x4   
load:0x403c8704,len:0xe5c 
load:0x403cb700,len:0x303c
entry 0x403c893c
I (23) boot: ESP-IDF v5.3.1-dirty 2nd stage bootloader
I (24) boot: compile time Dec  1 2024 18:12:53
I (24) boot: Multicore bootloader
I (27) boot: chip revision: v0.2
I (31) qio_mode: Enabling default flash chip QIO
I (36) boot.esp32s3: Boot SPI Speed : 80MHz
I (41) boot.esp32s3: SPI Mode       : QIO        
I (46) boot.esp32s3: SPI Flash Size : 16MB       
I (51) boot: Enabling RNG early entropy source...
I (56) boot: Partition Table:
I (60) boot: ## Label            Usage          Type ST Offset   Length
I (67) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (319) app_init: App version:      1
I (323) app_init: Compile time:     Dec  1 2024 18:12:55
I (329) app_init: ELF file SHA256:  0461e8c61...
I (334) app_init: ESP-IDF:          v5.3.1-dirty
I (340) efuse_init: Min chip rev:     v0.0
I (354) heap_init: Initializing. RAM available for dynamic allocation:
I (361) heap_init: At 3FCA6128 len 000435E8 (269 KiB): RAM
I (368) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (374) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (380) heap_init: At 600FE100 len 00001EE8 (7 KiB): RTCRAM
I (387) spi_flash: detected chip: gd
I (390) spi_flash: flash io: qio
I (395) sleep: Configure to isolate all GPIO pins in sleep state
I (401) sleep: Enable automatic switching of GPIO sleep configuration
I (408) main_task: Started on CPU0
I (436) main_task: Calling app_main()
I (436) gpio: GPIO[18]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (439) gpio: GPIO[12]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (448) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (457) gpio: GPIO[17]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (477) led_indicator: LED Indicator Version: 0.3.0
I (477) gpio: GPIO[15]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (482) led_indicator: blink_lists is null, use default blink list
W (489) led_indicator: ./managed_components/espressif__led_indicator/src/led_indicator.c:280 (_led_indicator_create_com):LED indicator does not have the hal_indicator_set_brightness function
I (506) led_indicator: Indicator create successfully. type:GPIO mode, hardware_data:0xf, is_active_level_high:1, blink_lists:default
I (519) led_indicator: LED Indicator Version: 0.3.0
I (524) gpio: GPIO[17]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (533) led_indicator: blink_lists is null, use default blink list
W (540) led_indicator: ./managed_components/espressif__led_indicator/src/led_indicator.c:280 (_led_indicator_create_com):LED indicator does not have the hal_indicator_set_brightness function
I (558) led_indicator: Indicator create successfully. type:GPIO mode, hardware_data:0x11, is_active_level_high:1, blink_lists:default
I (571) led_indicator: LED Indicator Version: 0.3.0
I (576) gpio: GPIO[16]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (585) led_indicator: blink_lists is null, use default blink list
W (592) led_indicator: ./managed_components/espressif__led_indicator/src/led_indicator.c:280 (_led_indicator_create_com):LED indicator does not have the hal_indicator_set_brightness function
I (610) led_indicator: Indicator create successfully. type:GPIO mode, hardware_data:0x10, is_active_level_high:1, blink_lists:default
I (628) 4g_main: ====================================
I (628) 4g_main:      ESP 4G Cat.1 Wi-Fi Router
I (633) 4g_main: ====================================
I (639) modem_board: iot_usbh_modem, version: 1.0.0
I (645) modem_board: Force reset modem board....
I (650) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (659) modem_board: Resetting modem using io=13, level=0
I (865) modem_board: Waiting for modem initialize ready
I (5865) USBH_CDC: iot usbh cdc version: 1.0.0
I (5895) esp-modem: --------- Modem PreDefined Info ------------------
I (5896) esp-modem: Model: User Defined
I (5896) esp-modem: Modem itf 0        
I (5900) esp-modem: ----------------------------------------------------
I (5908) gpio: GPIO[12]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (5917) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x42018c9b  PS      : 0x00060930  A0      : 0x82018dee  A1      : 0x3fcb3600  
--- 0x42018c9b: _cdc_transfers_allocate at C:/Users/micha/esp/v5.3.1/esp-idf/components/usb/iot_usbh_cdc/iot_usbh_cdc.c:497

A2      : 0x00000000  A3      : 0x3fcb3a20  A4      : 0xffffffff  A5      : 0x3fcb4884
A6      : 0x3fcb3648  A7      : 0x3fcb4860  A8      : 0x3fcbdfc4  A9      : 0x42018a80
--- 0x42018a80: out_xfer_cb at C:/Users/micha/esp/v5.3.1/esp-idf/components/usb/iot_usbh_cdc/iot_usbh_cdc.c:420

A10     : 0x00000000  A11     : 0x00000000  A12     : 0x3fcb4870  A13     : 0x00000000
A14     : 0x00000000  A15     : 0x3fcb3604  SAR     : 0x00000016  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000001  LBEG    : 0x400570e8  LEND    : 0x400570f3  LCOUNT  : 0xffffffff
--- 0x400570e8: memset in ROM
0x400570f3: memset in ROM



Backtrace: 0x42018c98:0x3fcb3600 0x42018deb:0x3fcb3630 0x420190b1:0x3fcb3680 0x4201b1f1:0x3fcb36b0 0x42019192:0x3fcb36e0 0x4037e545:0x3fcb3700
--- 0x42018c98: _cdc_transfers_allocate at C:/Users/micha/esp/v5.3.1/esp-idf/components/usb/iot_usbh_cdc/iot_usbh_cdc.c:496
0x42018deb: _cdc_open at C:/Users/micha/esp/v5.3.1/esp-idf/components/usb/iot_usbh_cdc/iot_usbh_cdc.c:625
0x420190b1: usb_event_cb at C:/Users/micha/esp/v5.3.1/esp-idf/components/usb/iot_usbh_cdc/iot_usbh_cdc.c:243
0x4201b1f1: usb_host_client_handle_events at C:/Users/micha/esp/v5.3.1/esp-idf/components/usb/usb_host.c:809
0x42019192: usbh_cdc_client_task at C:/Users/micha/esp/v5.3.1/esp-idf/components/usb/iot_usbh_cdc/iot_usbh_cdc.c:198
0x4037e545: vPortTaskWrapper at C:/Users/micha/esp/v5.3.1/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:134
I found and downloaded binary files on the waveshare site:
https://www.waveshare.com/wiki/ESP32-S3 ... _WIFI_Demo
and loaded them.

With this file there is no crash and the process gets a lot further and trying to send AT commands as follows, so I think my hardware setup is ok:

Code: Select all

ESP-ROM:esp32s3-20210327
Build:Mar 27 2021
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3fce3818,len:0x1870
load:0x403c9700,len:0x4
load:0x403c9704,len:0xda4
load:0x403cc700,len:0x3130
entry 0x403c9934
I (24) boot: ESP-IDF v5.1-dirty 2nd stage bootloader
I (24) boot: compile time Nov 15 2023 09:59:09
I (24) boot: Multicore bootloader
I (27) boot: chip revision: v0.2
I (31) qio_mode: Enabling default flash chip QIO
I (36) boot.esp32s3: Boot SPI Speed : 80MHz
I (41) boot.esp32s3: SPI Mode       : QIO
I (46) boot.esp32s3: SPI Flash Size : 4MB
I (51) boot: Enabling RNG early entropy source...
I (56) boot: Partition Table:
I (60) boot: ## Label            Usage          Type ST Offset   Length
I (67) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (74) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (82) boot:  2 factory          factory app      00 00 00010000 00100000
I (89) boot:  3 storage          Unknown data     01 82 00110000 00100000
I (97) boot: End of partition table
I (101) esp_image: segment 0: paddr=00010020 vaddr=3c0a0020 size=2c7c8h (182216) map
I (137) esp_image: segment 1: paddr=0003c7f0 vaddr=3fc9b600 size=03828h ( 14376) load
I (140) esp_image: segment 2: paddr=00040020 vaddr=42000020 size=9f73ch (653116) map
I (242) esp_image: segment 3: paddr=000df764 vaddr=3fc9ee28 size=00d44h (  3396) load
I (243) esp_image: segment 4: paddr=000e04b0 vaddr=40374000 size=17510h ( 95504) load
I (276) boot: Loaded app from partition at offset 0x10000
I (276) boot: Disabling RNG early entropy source...
I (287) cpu_start: Multicore app
I (287) cpu_start: Pro cpu up.
I (288) cpu_start: Starting app cpu, entry point is 0x403758dc
I (0) cpu_start: App cpu up.
I (305) cpu_start: Pro cpu start user code
I (305) cpu_start: cpu freq: 240000000 Hz
I (306) cpu_start: Application information:
I (309) cpu_start: Project name:     usb_cdc_4g_module
I (314) cpu_start: App version:      aab3785e-dirty
I (320) cpu_start: Compile time:     Nov 15 2023 15:18:40
I (326) cpu_start: ELF file SHA256:  872601badd04bbe3...
I (332) cpu_start: ESP-IDF:          v5.1-dirty
I (337) cpu_start: Min chip rev:     v0.0
I (342) cpu_start: Max chip rev:     v0.99
I (347) cpu_start: Chip rev:         v0.2
I (351) heap_init: Initializing. RAM available for dynamic allocation:
I (359) heap_init: At 3FCA3218 len 000464F8 (281 KiB): DRAM
I (365) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (372) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (378) heap_init: At 600FE010 len 00001FF0 (7 KiB): RTCRAM
I (384) spi_flash: detected chip: gd
I (388) spi_flash: flash io: qio
W (392) spi_flash: Detected size(16384k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (405) sleep: Configure to isolate all GPIO pins in sleep state
I (412) sleep: Enable automatic switching of GPIO sleep configuration
I (419) app_start: Starting scheduler on CPU0
I (424) app_start: Starting scheduler on CPU1
I (424) main_task: Started on CPU0
I (434) main_task: Calling app_main()
I (445) 4g_main: ====================================
I (445) 4g_main:      ESP 4G Cat.1 Wi-Fi Router
I (448) 4g_main: ====================================
I (454) modem_board: iot_usbh_modem, version: 0.2.0
I (460) modem_board: Force reset modem board....
I (465) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (474) modem_board: Resetting modem using io=33, level=1
I (680) modem_board: Waiting for modem initialize ready
I (5730) USB_HCDC: iot_usbh_cdc, version: 0.2.0
I (5730) IOT_USBH: iot_usbh, version: 0.2.0
I (5760) IOT_USBH: USB Port=1 init succeed, fifo strategy=0
I (5760) IOT_USBH: usb port start succeed
I (5760) IOT_USBH: USB Processing Start
I (5760) USB_HCDC: usbh cdc driver install succeed
I (5764) IOT_USBH: Waiting USB Connection
I (5770) USB_HCDC: Waiting CDC Device Connection
I (5774) IOT_USBH: Port power: ON Succeed
I (5760) USB_HCDC: CDC task start
I (7925) IOT_USBH: line 131 PORT_EVENT_CONNECTION
I (8025) IOT_USBH: Resetting Port
I (8085) IOT_USBH: Port reset succeed
I (8085) IOT_USBH: Getting Port Speed
I (8085) IOT_USBH: USB Speed: full-speed
I (8087) IOT_USBH: Pipe init succeed, addr: 00
I (8092) IOT_USBH: Set Device Addr = 1
I (8097) IOT_USBH: Set Device Addr Done
I (8101) IOT_USBH: get device desc
I (8105) IOT_USBH: get device desc, actual_num_bytes:26
*** Device descriptor ***
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0xef
bDeviceSubClass 0x2
bDeviceProtocol 0x1
bMaxPacketSize0 64
idVendor 0x1e0e
idProduct 0x9011
bcdDevice 1.00
iManufacturer 1
iProduct 2
iSerialNumber 3
bNumConfigurations 1
I (8135) IOT_USBH: get short config desc
I (8140) IOT_USBH: get config desc, actual_num_bytes:16
I (8145) IOT_USBH: get full config desc
I (8150) IOT_USBH: get full config desc, actual_num_bytes:253
*** Configuration descriptor ***
bLength 9
bDescriptorType 2
wTotalLength 245
bNumInterfaces 6
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
bMaxPower 500mA
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 0xe0
bFunctionSubClass 0x1
bFunctionProtocol 0x3
iFunction 5
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 0
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0xe0
        bInterfaceSubClass 0x1
        bInterfaceProtocol 0x3
        iInterface 5
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x87   EP 7 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 64
                bInterval 16
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 1
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 5
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x83   EP 3 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0xc    EP 12 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 2
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 8
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x82   EP 2 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0xb    EP 11 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 4
        bAlternateSetting 0
        bNumEndpoints 3
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 11
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x89   EP 9 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 64
                bInterval 16
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x86   EP 6 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0xf    EP 15 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 5
        bAlternateSetting 0
        bNumEndpoints 3
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 11
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x88   EP 8 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 64
                bInterval 16
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x81   EP 1 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0xa    EP 10 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 3
        bAlternateSetting 0
        bNumEndpoints 3
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 8
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x84   EP 4 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 16
                bInterval 16
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x85   EP 5 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0xe    EP 14 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
I (8492) IOT_USBH: Set Device Configuration = 1
I (8498) IOT_USBH: Set Device Configuration Done
I (8503) IOT_USBH: Pipe init succeed, addr: 86
I (8508) IOT_USBH: Pipe init succeed, addr: 0F
I (8513) USB_HCDC: CDC Device Connected
I (8518) esp-modem: --------- Modem PreDefined Info ------------------
I (8525) esp-modem: Model: User Defined
I (8529) esp-modem: Modem itf: IN Addr:0x86, OUT Addr:0x0F
I (8536) esp-modem: ----------------------------------------------------
I (8543) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (8553) USB_HCDC: rx0 flush -0 = 0
I (8553) modem_board: DTE reconnect, reconnecting ...

I (9562) modem_board: reconnect after 5s...
I (10562) modem_board: reconnect after 4s...
I (11562) modem_board: reconnect after 3s...
I (12562) modem_board: reconnect after 2s...
I (13562) modem_board: reconnect after 1s...
I (13562) modem_board: Modem state STAGE_SYNC, Start
E (13578) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (13585) esp-modem-dte: esp_dte_handle_line(79): handle line failed
I (13585) modem_board: Network Auto reconnecting ...
W (13587) 4g_main: Modem Board Event: Network disconnected
I (13587) modem_board: Modem state STAGE_SYNC, Success!
I (13699) modem_board: Modem state STAGE_CHECK_SIM, Start
W (13706) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
E (15706) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
W (15706) esp_modem_dce: esp_modem_dce_generic_command(26): Command:AT+CPIN= response timeout
W (15718) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
W (15720) modem_board: Get SIM card state failed
W (15726) modem_board: Modem state STAGE_CHECK_SIM, Failed, retry1, after 3000ms...
I (18734) modem_board: Modem state STAGE_CHECK_SIM, Start
W (18741) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
E (20741) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
W (20741) esp_modem_dce: esp_modem_dce_generic_command(26): Command:AT+CPIN= response timeout
W (20754) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
W (20755) modem_board: Get SIM card state failed
W (20761) modem_board: Modem state STAGE_CHECK_SIM, Failed, retry2, after 3000ms...
I (23769) modem_board: Modem state STAGE_CHECK_SIM, Start
W (23776) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
E (25776) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
W (25776) esp_modem_dce: esp_modem_dce_generic_command(26): Command:AT+CPIN= response timeout
W (25789) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
W (25790) modem_board: Get SIM card state failed
W (25796) modem_board: Modem state STAGE_CHECK_SIM, Failed, retry3, after 3000ms...
I (28804) modem_board: Modem state STAGE_CHECK_SIM, Start
W (28811) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
E (30811) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
W (30811) esp_modem_dce: esp_modem_dce_generic_command(26): Command:AT+CPIN= response timeout
W (30824) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
W (30825) modem_board: Get SIM card state failed
W (30831) modem_board: Modem state STAGE_CHECK_SIM, Failed, retry4, after 3000ms...
I (33839) modem_board: Modem state STAGE_CHECK_SIM, Start
W (33846) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
E (35846) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
W (35846) esp_modem_dce: esp_modem_dce_generic_command(26): Command:AT+CPIN= response timeout
W (35859) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
W (35860) modem_board: Get SIM card state failed
E (35866) modem_board: Modem state STAGE_CHECK_SIM, retry 5, timeout !
W (35873) modem_board: Retry From Start !
I (35877) modem_board: Modem state STAGE_SYNC, Start
I (35906) modem_board: Network Auto reconnecting ...
W (35906) 4g_main: Modem Board Event: Network disconnected
I (35906) modem_board: Modem state STAGE_SYNC, Success!
I (36012) modem_board: Modem state STAGE_CHECK_SIM, Start
W (36019) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
E (38019) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
W (38019) esp_modem_dce: esp_modem_dce_generic_command(26): Command:AT+CPIN= response timeout
W (38032) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
W (38033) modem_board: Get SIM card state failed
W (38039) modem_board: Modem state STAGE_CHECK_SIM, Failed, retry1, after 3000ms...
I (41047) modem_board: Modem state STAGE_CHECK_SIM, Start
W (41054) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
E (43054) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
W (43054) esp_modem_dce: esp_modem_dce_generic_command(26): Command:AT+CPIN= response timeout
W (43067) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
W (43068) modem_board: Get SIM card state failed
W (43074) modem_board: Modem state STAGE_CHECK_SIM, Failed, retry2, after 3000ms...
I (46082) modem_board: Modem state STAGE_CHECK_SIM, Start
W (46089) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
E (48089) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
W (48089) esp_modem_dce: esp_modem_dce_generic_command(26): Command:AT+CPIN= response timeout
W (48102) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
W (48103) modem_board: Get SIM card state failed
W (48109) modem_board: Modem state STAGE_CHECK_SIM, Failed, retry3, after 3000ms...
I (51117) modem_board: Modem state STAGE_CHECK_SIM, Start
W (51124) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
E (53124) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
W (53124) esp_modem_dce: esp_modem_dce_generic_command(26): Command:AT+CPIN= response timeout
W (53137) esp_modem_dce: esp_modem_dce_generic_command(31): Command:AT+CPIN?
...failed
W (53138) modem_board: Get SIM card state failed
W (53144) modem_board: Modem state STAGE_CHECK_SIM, Failed, retry4, after 3000ms...
I would appreciate some help on how to resolve this, or a steer on what my approach should be. Another option I am considering is cloning the entire https://github.com/espressif/esp-iot-solution repository into my esp directory alongside my IDF "v5.3.1" directory and trying to select this and build. Does this make sense? I am also not sure if other components and include files etc may be missing from the esp-iot-solution repository breaking my existing project.
I don't understand how to manage different Espressif ESP32 repositories.

MicroController
Posts: 1821
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: Using IDF in vscode but want to add support for a 4G USB modem eg from esp-iot-solution repository

Postby MicroController » Sun Dec 01, 2024 9:10 am

Note the IDF build system.
You're not supposed to select and copy source folders around to make an application project.
In your case, you can git clone the IOT repository to some convenient location, then add its path to EXTRA_COMPONENT_DIRS and the name(s) of the component(s) you want to use to the REQUIRES in your application's CMakeLists.txt.
Or you can use the IDF component manager to do the downloading of required external components automatically for you.

daanpape
Posts: 4
Joined: Tue Jan 03, 2023 2:41 pm

Re: Using IDF in vscode but want to add support for a 4G USB modem eg from esp-iot-solution repository

Postby daanpape » Thu Dec 05, 2024 10:10 pm

Hi,

Any reason why you want to use USB, this won't be the most ideal solution. Maybe you can checkout Walter (https://www.quickspot.io/) it is a pre-certified module that combines the ESP32-S3 with a cellular modem that also supports GNSS. I have also created an ESP-IDF component that does all the heavy lifting with AT commands: https://github.com/QuickSpot/walter-esp-idf

Who is online

Users browsing this forum: No registered users and 114 guests