Skip to content
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

usb cdc 4g module connection (AEGHB-244) #276

Open
narangmayank opened this issue Jun 12, 2023 · 23 comments
Open

usb cdc 4g module connection (AEGHB-244) #276

narangmayank opened this issue Jun 12, 2023 · 23 comments

Comments

@narangmayank
Copy link

How to set up SIM7600 modem via ESP32S3 USB Port.

IDF Version: 5.0.0
ESP IoT Solution Version: Master Branch

Just selected user defined modem board in the component config -> usb host modm.

Serial Logs:

I (3581) 4g_main: ====================================
I (3581) 4g_main:      ESP 4G Cat.1 Wi-Fi Router
I (3581) 4g_main: ====================================
I (3587) modem_board: iot_usbh_modem, version: 0.1.5
I (3592) modem_board: Force reset modem board....
I (3598) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (3607) modem_board: Resetting modem using io=13, level=0
I (3813) modem_board: Waiting for modem initialize ready
I (8813) USB_HCDC: iot_usbh_cdc, version: 0.1.3
I (8813) IOT_USBH: iot_usbh, version: 0.1.2
I (8843) IOT_USBH: USB Port=1 init succeed, fifo strategy=0
I (8843) USB_HCDC: CDC task start
I (8843) IOT_USBH: usb port start succeed
I (8846) USB_HCDC: usbh cdc driver install succeed
I (8852) USB_HCDC: Waiting CDC Device Connection
I (8857) IOT_USBH: USB Processing Start
I (8862) IOT_USBH: Waiting USB Connection
I (8866) IOT_USBH: Port power: ON Succeed

Ya that sit, it is hanged there. I guess it is wating for usb device.

Any help will be appreciated :)

@github-actions github-actions bot changed the title usb cdc 4g module connection usb cdc 4g module connection (AEGHB-244) Jun 12, 2023
@leeebo
Copy link
Collaborator

leeebo commented Jun 13, 2023

@mayankbytebeam Which development board do you use? Please make sure the device is powered

@narangmayank
Copy link
Author

narangmayank commented Jun 13, 2023

@leeebo I used ESP32S3 DevKitC1 and SIM7600 module in this setup.

@leeebo
Copy link
Collaborator

leeebo commented Jun 13, 2023

@mayankbytebeam ESP32S3 DevKitC1 USB Port can not output 5V power.

@narangmayank
Copy link
Author

@leeebo ok now I've powered the modem board exrternally but still some error is coming

I (9702) IOT_USBH: Set Device Configuration = 1
I (9708) IOT_USBH: Set Device Configuration Done
I (9713) IOT_USBH: Pipe init succeed, addr: 81
I (9718) IOT_USBH: Pipe init succeed, addr: 01
I (9723) USB_HCDC: CDC Device Connected
I (9727) esp-modem: --------- Modem PreDefined Info ------------------
I (9734) esp-modem: Model: User Defined
I (9739) esp-modem: Modem itf: IN Addr:0x81, OUT Addr:0x01
I (9745) esp-modem: ----------------------------------------------------
I (9753) gpio: GPIO[12]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (9762) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (9772) USB_HCDC: rx0 flush -0 = 0
I (9776) 4g_main: Modem Board Event: USB connected
I (9776) modem_board: DTE reconnect, reconnecting ...

I (10787) modem_board: reconnect after 5s...
I (11787) modem_board: reconnect after 4s...
I (12787) modem_board: reconnect after 3s...
I (13787) modem_board: reconnect after 2s...
I (14787) modem_board: reconnect after 1s...
I (14787) modem_board: Modem state STAGE_SYNC, Start
E (16797) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
I (16812) modem_board: Current timeouts: 1 and errors: 0
E (46812) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
W (46812) esp_modem_dce: esp_modem_dce_generic_command(22): Command:+++ response timeout
E (48817) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
E (50822) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
I (50837) modem_board: Current timeouts: 2 and errors: 0
W (50837) modem_board: Reset modem through reset pin........
W (50839) 4g_main: Modem Board Event: Hardware restart
I (50840) modem_board: modem_board_reset!
I (56050) 4g_main: Modem Board Event: Hardware restart done
E (58050) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT

I've selected the modem baord as user defined.
can you tell me if any additional configurations is required for setting this example for SIM7600 modem?

@leeebo
Copy link
Collaborator

leeebo commented Jun 14, 2023

@mayankbytebeam 4G modules generally have multiple interfaces, of which only one is the Modem interface, it seems 0x01 0x81 corresponding interface is not, you need to try other interfaces. In my experience, it's often the second-to-last interface

@leeebo
Copy link
Collaborator

leeebo commented Jun 14, 2023

@mayankbytebeam If you don't know how to find the endpoint address of the interface, please attach your full log here, i will help

@narangmayank
Copy link
Author

@leeebo sorry for the delay, we have changed the design a bit. Now we are using the N706 modem instead of SIM7600.

Serial logs,

*** Device descriptor ***
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0x0
bDeviceSubClass 0x0
bDeviceProtocol 0x0
bMaxPacketSize0 64
idVendor 0x2949
idProduct 0x7401
bcdDevice 0.00
iManufacturer 1
iProduct 2
iSerialNumber 0
bNumConfigurations 1
I (10134) IOT_USBH: get short config desc
I (10139) IOT_USBH: get config desc, actual_num_bytes:16
I (10145) IOT_USBH: get full config desc
I (10150) IOT_USBH: get full config desc, actual_num_bytes:244
*** Configuration descriptor ***
bLength 9
bDescriptorType 2
wTotalLength 236
bNumInterfaces 9
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
bMaxPower 400mA
*** 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 3
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x82   EP 2 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 8
                bInterval 16
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 1
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 4
                *** 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 0x1    EP 1 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 6
                *** 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 0x2    EP 2 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 3
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x84   EP 4 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x3    EP 3 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 4
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** 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 0x4    EP 4 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 5
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** 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 0x5    EP 5 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 6
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x87   EP 7 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x6    EP 6 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 7
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x88   EP 8 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x7    EP 7 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 8
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x89   EP 9 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x8    EP 8 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0

@narangmayank
Copy link
Author

@leeebo Can you help to find out the correct cdc endpoint addresses,

Here are are serial logs,

I (25) boot: ESP-IDF v5.0-dirty 2nd stage bootloader
I (25) boot: compile time 15:11:09
I (25) boot: chip revision: v0.1
I (27) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (34) qio_mode: Enabling default flash chip QIO
I (39) boot.esp32s3: Boot SPI Speed : 80MHz
I (44) boot.esp32s3: SPI Mode       : QIO
I (49) boot.esp32s3: SPI Flash Size : 4MB
I (54) boot: Enabling RNG early entropy source...
I (59) boot: Partition Table:
I (63) boot: ## Label            Usage          Type ST Offset   Length
I (70) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (77) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (85) boot:  2 factory          factory app      00 00 00010000 00100000
I (92) boot:  3 storage          Unknown data     01 82 00110000 00100000
I (100) boot: End of partition table
I (104) boot_comm: chip revision: 1, min. application chip revision: 0
I (111) esp_image: segment 0: paddr=00010020 vaddr=3c0b0020 size=2efech (192492) map
I (149) esp_image: segment 1: paddr=0003f014 vaddr=3fc9a400 size=01004h (  4100) load
I (150) esp_image: segment 2: paddr=00040020 vaddr=42000020 size=a77b0h (686000) map
I (259) esp_image: segment 3: paddr=000e77d8 vaddr=3fc9b404 size=03654h ( 13908) load
I (261) esp_image: segment 4: paddr=000eae34 vaddr=40374000 size=163a0h ( 91040) load
I (282) esp_image: segment 5: paddr=001011dc vaddr=50000000 size=00010h (    16) load
I (291) boot: Loaded app from partition at offset 0x10000
I (291) boot: Disabling RNG early entropy source...
I (303) cpu_start: Pro cpu up.
I (303) cpu_start: Starting app cpu, entry point is 0x403757c8
0x403757c8: call_start_cpu1 at C:/Espressif/frameworks/esp-idf-v5.0/components/esp_system/port/cpu_start.c:142

I (0) cpu_start: App cpu up.
I (317) cpu_start: Pro cpu start user code
I (317) cpu_start: cpu freq: 240000000 Hz
I (317) cpu_start: Application information:
I (320) cpu_start: Project name:     usb_cdc_4g_module
I (326) cpu_start: App version:      7f6be2fb-dirty
I (332) cpu_start: Compile time:     Aug  1 2023 15:58:40
I (338) cpu_start: ELF file SHA256:  4cc902f5cf4cede6...
I (344) cpu_start: ESP-IDF:          v5.0-dirty
I (349) heap_init: Initializing. RAM available for dynamic allocation:
I (356) heap_init: At 3FCA26C8 len 00047048 (284 KiB): D/IRAM
I (363) heap_init: At 3FCE9710 len 00005724 (21 KiB): STACK/DRAM
I (369) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (375) heap_init: At 600FE010 len 00001FF0 (7 KiB): RTCRAM
I (382) spi_flash: detected chip: generic
I (386) spi_flash: flash io: qio
W (390) spi_flash: Detected size(8192k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (404) sleep: Configure to isolate all GPIO pins in sleep state
I (410) sleep: Enable automatic switching of GPIO sleep configuration
I (417) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (433) led_indicator: LED Indicator Version: 0.3.0
I (439) gpio: GPIO[15]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (448) led_indicator: blink_lists is null, use default blink list
W (455) 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 (472) led_indicator: Indicator create successfully. type:GPIO mode, hardware_data:0xf, is_active_level_high:1, blink_lists:default
I (485) led_indicator: LED Indicator Version: 0.3.0
I (491) gpio: GPIO[17]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (500) led_indicator: blink_lists is null, use default blink list
W (507) 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 (524) led_indicator: Indicator create successfully. type:GPIO mode, hardware_data:0x11, is_active_level_high:1, blink_lists:default
I (537) led_indicator: LED Indicator Version: 0.3.0
I (543) gpio: GPIO[16]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (552) led_indicator: blink_lists is null, use default blink list
W (559) 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 (576) led_indicator: Indicator create successfully. type:GPIO mode, hardware_data:0x10, is_active_level_high:1, blink_lists:default
I (3604) 4g_main: ====================================
I (3604) 4g_main:      ESP 4G Cat.1 Wi-Fi Router
I (3604) 4g_main: ====================================
I (3610) modem_board: iot_usbh_modem, version: 0.1.6
I (3615) modem_board: Force reset modem board....
I (3621) gpio: GPIO[0]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (3630) modem_board: Resetting modem using io=0, level=0
I (3836) modem_board: Waiting for modem initialize ready
I (8836) USB_HCDC: iot_usbh_cdc, version: 0.1.3
I (8836) IOT_USBH: iot_usbh, version: 0.1.2
I (8866) IOT_USBH: USB Port=1 init succeed, fifo strategy=0
I (8866) USB_HCDC: CDC task start
I (8866) IOT_USBH: usb port start succeed
I (8870) USB_HCDC: usbh cdc driver install succeed
I (8875) USB_HCDC: Waiting CDC Device Connection
I (8880) IOT_USBH: USB Processing Start
I (8885) IOT_USBH: Waiting USB Connection
I (8889) IOT_USBH: Port power: ON Succeed
I (9144) IOT_USBH: line 131 PORT_EVENT_CONNECTION
I (9244) IOT_USBH: Resetting Port
I (9304) IOT_USBH: Port reset succeed
I (9304) IOT_USBH: Getting Port Speed
I (9304) IOT_USBH: USB Speed: full-speed
I (9306) IOT_USBH: Pipe init succeed, addr: 00
I (9311) IOT_USBH: Set Device Addr = 1
W (9316) IOT_USBH: line 166 Pipe: default PIPE_EVENT_ERROR_XFER
E (9322) IOT_USBH: ./managed_components/espressif__iot_usbh/iot_usbh.c:886 (_usbh_set_device_addr):urb event error
W (9344) IOT_USBH: line 135 PORT_EVENT_DISCONNECTION
W (9445) IOT_USBH: pipe=0x3fcf7bf8 clear failed
E (9445) IOT_USBH: ./managed_components/espressif__iot_usbh/iot_usbh.c:1006 (_usbh_processing_task):Set device address failed
W (9451) IOT_USBH: Resetting USB Driver
W (9456) IOT_USBH: Resetting default pipe
W (9560) IOT_USBH: pipe=0x3fcf7bf8 clear failed
I (9560) IOT_USBH: iot_usbh_pipe_deinit: pipe state = 1
I (9560) IOT_USBH: Pipe deinit succeed, addr: 00
I (9565) IOT_USBH: hcd recovering
I (9569) IOT_USBH: Port power: ON Succeed
I (9674) IOT_USBH: Waiting USB Connection
I (9924) IOT_USBH: line 131 PORT_EVENT_CONNECTION
I (10024) IOT_USBH: Resetting Port
I (10084) IOT_USBH: Port reset succeed
I (10084) IOT_USBH: Getting Port Speed
I (10084) IOT_USBH: USB Speed: full-speed
I (10087) IOT_USBH: Pipe init succeed, addr: 00
I (10092) IOT_USBH: Set Device Addr = 1
I (10096) IOT_USBH: Set Device Addr Done
I (10101) IOT_USBH: get device desc
I (10105) IOT_USBH: get device desc, actual_num_bytes:26
*** Device descriptor ***
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0x0
bDeviceSubClass 0x0
bDeviceProtocol 0x0
bMaxPacketSize0 64
idVendor 0x2949
idProduct 0x7401
bcdDevice 0.00
iManufacturer 1
iProduct 2
iSerialNumber 0
bNumConfigurations 1
I (10134) IOT_USBH: get short config desc
I (10139) IOT_USBH: get config desc, actual_num_bytes:16
I (10145) IOT_USBH: get full config desc
I (10150) IOT_USBH: get full config desc, actual_num_bytes:244
*** Configuration descriptor ***
bLength 9
bDescriptorType 2
wTotalLength 236
bNumInterfaces 9
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
bMaxPower 400mA
*** 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 3
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x82   EP 2 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 8
                bInterval 16
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 1
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 4
                *** 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 0x1    EP 1 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 6
                *** 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 0x2    EP 2 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 3
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x84   EP 4 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x3    EP 3 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 4
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** 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 0x4    EP 4 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 5
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** 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 0x5    EP 5 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 6
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x87   EP 7 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x6    EP 6 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 7
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x88   EP 8 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x7    EP 7 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 8
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xff
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 6
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x89   EP 9 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x8    EP 8 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
I (10588) IOT_USBH: Set Device Configuration = 1
I (10594) IOT_USBH: Set Device Configuration Done
I (10599) IOT_USBH: Pipe init succeed, addr: 81
I (10604) IOT_USBH: Pipe init succeed, addr: 01
I (10609) USB_HCDC: CDC Device Connected
I (10614) esp-modem: --------- Modem PreDefined Info ------------------
I (10621) esp-modem: Model: User Defined
I (10626) esp-modem: Modem itf: IN Addr:0x81, OUT Addr:0x01
I (10632) esp-modem: ----------------------------------------------------
I (10640) gpio: GPIO[12]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (10650) USB_HCDC: rx0 flush -0 = 0
I (10653) 4g_main: Modem Board Event: USB connected
I (10653) modem_board: DTE reconnect, reconnecting ...

I (11665) modem_board: reconnect after 5s...
I (12665) modem_board: reconnect after 4s...
I (13665) modem_board: reconnect after 3s...
I (14665) modem_board: reconnect after 2s...
I (15665) modem_board: reconnect after 1s...
I (15665) modem_board: Modem state STAGE_SYNC, Start
E (17675) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
I (17690) modem_board: Current timeouts: 1 and errors: 0
E (47690) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
W (47690) esp_modem_dce: esp_modem_dce_generic_command(22): Command:+++ response timeout
E (49695) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
E (51700) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
I (51715) modem_board: Current timeouts: 2 and errors: 0
W (51715) modem_board: Reset modem through reset pin........
W (51717) 4g_main: Modem Board Event: Hardware restart
I (51718) modem_board: modem_board_reset!
I (51728) 4g_main: Modem Board Event: Hardware restart done
E (53728) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
I (53743) modem_board: Current timeouts: 3 and errors: 0
I (53743) modem_board: modem_board_power_down!

@leeebo
Copy link
Collaborator

leeebo commented Aug 2, 2023

@mayankbytebeam From the module's descriptor, which has eight CDC-like interfaces, please first test with the penultimate one (IN 0x88, OUT 0x07). If that does not work, please try the eight interfaces one by one

image

@lovepreethitech
Copy link

Hi,

I m facing the same issue.
Hardware - ESP32 S2 WROOM 1
Modem - User Defined ( NEOWAY N58 )

@leeebo which interface class's endpoints should i use from below -

sudo lsusb -v -d 2949:7401
[sudo] password for lovepreet:

Bus 001 Device 008: ID 2949:7401 NEOWAY NEOWAY-N58
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x2949
idProduct 0x7401
bcdDevice 0.00
iManufacturer 1 NEOWAY
iProduct 2 NEOWAY-N58
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x00ec
bNumInterfaces 9
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
Self Powered
Remote Wakeup
MaxPower 400mA
Interface Association:
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 224 Wireless
bFunctionSubClass 1 Radio Frequency
bFunctionProtocol 3 RNDIS
iFunction 5 RNDIS
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 224 Wireless
bInterfaceSubClass 1 Radio Frequency
bInterfaceProtocol 3 RNDIS
iInterface 3 RNDIS Communications Control
** UNRECOGNIZED: 05 24 00 10 01
** UNRECOGNIZED: 05 24 01 00 01
** UNRECOGNIZED: 04 24 02 00
** UNRECOGNIZED: 05 24 06 00 01
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 16
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 4 RNDIS Ethernet Data
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81 EP 1 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01 EP 1 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 2
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 6 Neoway Generic Serial
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83 EP 3 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 6 Neoway Generic Serial
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 4
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 6 Neoway Generic Serial
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x85 EP 5 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x04 EP 4 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 5
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 6 Neoway Generic Serial
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x86 EP 6 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x05 EP 5 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 6
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 6 Neoway Generic Serial
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x87 EP 7 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x06 EP 6 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 7
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 6 Neoway Generic Serial
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x88 EP 8 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x07 EP 7 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 8
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 255 Vendor Specific Class
bInterfaceSubClass 0
bInterfaceProtocol 0
iInterface 6 Neoway Generic Serial
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x89 EP 9 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x08 EP 8 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0200 1x 512 bytes
bInterval 0
Device Qualifier (for other device speed):
bLength 10
bDescriptorType 6
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
bNumConfigurations 1
can't get debug descriptor: Resource temporarily unavailable
Device Status: 0x0001
Self Powered

-------------------------------------------------------*

Above data is from linux using lsusb command with Modem attached to laptop.

-----------------------------------------------------*-**-

BELOW ESP32 LOG WITH MODEM

-----------------------------------------------------*-**-
Build:Oct 25 2019
rst:0xf (BROWN_OUT_RST),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x18a4
load:0x4004c000,len:0xd2c
load:0x40050000,len:0x3080
entry 0x4004c23c
I (22) boot: ESP-IDF v4.4.5-249-gcc71308e2f 2nd stage bootloader
I (22) boot: compile time 17:14:04
�ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x18a4
load:0x4004c000,len:0xd2c
load:0x40050000,len:0x3080
entry 0x4004c23c
I (21) boot: ESP-IDF v4.4.5-249-gcc71308e2f 2nd stage bootloader
I (21) boot: compile time 17:14:04
I (21) boot: chip revision: v0.0
I (25) qio_mode: Enabling default flash chip QIO
I (31) boot.esp32s2: SPI Speed : 80MHz
I (36) boot.esp32s2: SPI Mode : QIO
I (40) boot.esp32s2: SPI Flash Size : 4MB
I (45) boot: Enabling RNG early entropy source...
I (50) boot: Partition Table:
I (54) boot: ## Label Usage Type ST Offset Length
I (61) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (69) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (76) boot: 2 factory factory app 00 00 00010000 00100000
I (84) boot: 3 storage Unknown data 01 82 00110000 00100000
I (91) boot: End of partition table
I (95) esp_image: segment 0: paddr=00010020 vaddr=3f000020 size=1c700h (116480) map
I (124) esp_image: segment 1: paddr=0002c728 vaddr=3ffc9000 size=02d7ch ( 11644) load
I (126) esp_image: segment 2: paddr=0002f4ac vaddr=40022000 size=00b6ch ( 2924) load
I (130) esp_image: segment 3: paddr=00030020 vaddr=40080020 size=7dbd8h (515032) map
I (226) esp_image: segment 4: paddr=000adc00 vaddr=40022b6c size=16490h ( 91280) load
I (258) boot: Loaded app from partition at offset 0x10000
I (258) boot: Disabling RNG early entropy source...
I (269) cache: Instruction cache : size 8KB, 4Ways, cache line size 32Byte
I (269) cpu_start: Pro cpu up.
I (289) cpu_start: Pro cpu start user code
I (289) cpu_start: cpu freq: 240000000
I (289) cpu_start: Application information:
I (292) cpu_start: Project name: usb_cdc_4g_module
I (298) cpu_start: App version: 4cfd216
I (303) cpu_start: Compile time: Aug 3 2023 18:39:29
I (309) cpu_start: ELF file SHA256: 650bb22e90c496ed...
I (315) cpu_start: ESP-IDF: v4.4.5-249-gcc71308e2f
I (321) cpu_start: Min chip rev: v0.0
I (326) cpu_start: Max chip rev: v1.99
I (331) cpu_start: Chip rev: v0.0
I (336) heap_init: Initializing. RAM available for dynamic allocation:
I (343) heap_init: At 3FFCF658 len 0002C9A8 (178 KiB): DRAM
I (349) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM
I (355) heap_init: At 3FF9E000 len 00002000 (8 KiB): RTCRAM
I (362) spi_flash: detected chip: generic
I (366) spi_flash: flash io: qio
I (374) cpu_start: Starting scheduler on PRO CPU.
I (376) led_indicator: LED Indicator Version: 0.3.0
I (381) gpio: GPIO[15]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (390) led_indicator: blink_lists is null, use default blink list
W (397) led_indicator: ../managed_components/espressif__led_indicator/src/led_indicator.c:280 (_led_indicator_create_com):LED indicator does n
I (415) led_indicator: Indicator create successfully. type:GPIO mode, hardware_data:0xf, is_active_level_high:1, blink_lists:default
I (427) led_indicator: LED Indicator Version: 0.3.0
I (433) gpio: GPIO[17]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (442) led_indicator: blink_lists is null, use default blink list
W (449) led_indicator: ../managed_components/espressif__led_indicator/src/led_indicator.c:280 (_led_indicator_create_com):LED indicator does n
I (467) led_indicator: Indicator create successfully. type:GPIO mode, hardware_data:0x11, is_active_level_high:1, blink_lists:default
I (480) led_indicator: LED Indicator Version: 0.3.0
I (485) gpio: GPIO[16]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (494) led_indicator: blink_lists is null, use default blink list
W (501) led_indicator: ../managed_components/espressif__led_indicator/src/led_indicator.c:280 (_led_indicator_create_com):LED indicator does n
I (519) led_indicator: Indicator create successfully. type:GPIO mode, hardware_data:0x10, is_active_level_high:1, blink_lists:default
I (3535) 4g_main: ====================================
I (3535) 4g_main: ESP 4G Cat.1 Wi-Fi Router
I (3535) 4g_main: ====================================
I (3541) modem_board: iot_usbh_modem, version: 0.1.6
I (3546) modem_board: Force reset modem board....
I (3552) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (3561) modem_board: Resetting modem using io=13, level=0
I (3767) modem_board: Waiting for modem initialize ready
I (8767) USB_HCDC: iot_usbh_cdc, version: 0.1.3
I (8767) IOT_USBH: iot_usbh, version: 0.1.2
I (8797) IOT_USBH: USB Port=1 init succeed, fifo strategy=0
I (8797) IOT_USBH: usb port start succeed
I (8797) USB_HCDC: usbh cdc driver install succeed
I (8802) USB_HCDC: Waiting CDC Device Connection
I (8807) USB_HCDC: CDC task start
I (8811) IOT_USBH: USB Processing Start
I (8816) IOT_USBH: Waiting USB Connection
I (8821) IOT_USBH: Port power: ON Succeed
I (9075) IOT_USBH: line 131 PORT_EVENT_CONNECTION
I (9175) IOT_USBH: Resetting Port
I (9235) IOT_USBH: Port reset succeed
I (9235) IOT_USBH: Getting Port Speed
I (9235) IOT_USBH: USB Speed: full-speed
I (9237) IOT_USBH: Pipe init succeed, addr: 00
I (9242) IOT_USBH: Set Device Addr = 1
I (9247) IOT_USBH: Set Device Addr Done
I (9251) IOT_USBH: get device desc
I (9255) IOT_USBH: get device desc, actual_num_bytes:26
*** Device descriptor ***
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0x0
bDeviceSubClass 0x0
bDeviceProtocol 0x0
bMaxPacketSize0 64
idVendor 0x2949
idProduct 0x7401
bcdDevice 0.00
iManufacturer 1
iProduct 2
iSerialNumber 0
bNumConfigurations 1
I (9284) IOT_USBH: get short config desc
I (9289) IOT_USBH: get config desc, actual_num_bytes:16
I (9295) IOT_USBH: get full config desc
I (9300) IOT_USBH: get full config desc, actual_num_bytes:244
*** Configuration descriptor ***
bLength 9
bDescriptorType 2
wTotalLength 236
bNumInterfaces 9
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xe0
bMaxPower 400mA
*** Interface descriptor ***
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 0xe0
bInterfaceSubClass 0x1
bInterfaceProtocol 0x3
iInterface 3
*** Endpoint descriptor ***
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 0x3 INT
wMaxPacketSize 8
bInterval 16
*** Interface descriptor ***
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 0xa
bInterfaceSubClass 0x0
bInterfaceProtocol 0x0
iInterface 4
*** 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 0x1 EP 1 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 6
*** 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 0x2 EP 2 OUT
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Interface descriptor ***
bLength 9
bDescriptorType 4
bInterfaceNumber 3
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 0xff
bInterfaceSubClass 0x0
bInterfaceProtocol 0x0
iInterface 6
*** Endpoint descriptor ***
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Endpoint descriptor ***
bLength 7
bDescriptorType 5
bEndpointAddress 0x3 EP 3 OUT
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Interface descriptor ***
bLength 9
bDescriptorType 4
bInterfaceNumber 4
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 0xff
bInterfaceSubClass 0x0
bInterfaceProtocol 0x0
iInterface 6
*** 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 0x4 EP 4 OUT
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Interface descriptor ***
bLength 9
bDescriptorType 4
bInterfaceNumber 5
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 0xff
bInterfaceSubClass 0x0
bInterfaceProtocol 0x0
iInterface 6
*** 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 0x5 EP 5 OUT
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Interface descriptor ***
bLength 9
bDescriptorType 4
bInterfaceNumber 6
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 0xff
bInterfaceSubClass 0x0
bInterfaceProtocol 0x0
iInterface 6
*** Endpoint descriptor ***
bLength 7
bDescriptorType 5
bEndpointAddress 0x87 EP 7 IN
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Endpoint descriptor ***
bLength 7
bDescriptorType 5
bEndpointAddress 0x6 EP 6 OUT
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Interface descriptor ***
bLength 9
bDescriptorType 4
bInterfaceNumber 7
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 0xff
bInterfaceSubClass 0x0
bInterfaceProtocol 0x0
iInterface 6
*** Endpoint descriptor ***
bLength 7
bDescriptorType 5
bEndpointAddress 0x88 EP 8 IN
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Endpoint descriptor ***
bLength 7
bDescriptorType 5
bEndpointAddress 0x7 EP 7 OUT
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Interface descriptor ***
bLength 9
bDescriptorType 4
bInterfaceNumber 8
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 0xff
bInterfaceSubClass 0x0
bInterfaceProtocol 0x0
iInterface 6
*** Endpoint descriptor ***
bLength 7
bDescriptorType 5
bEndpointAddress 0x89 EP 9 IN
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
*** Endpoint descriptor ***
bLength 7
bDescriptorType 5
bEndpointAddress 0x8 EP 8 OUT
bmAttributes 0x2 BULK
wMaxPacketSize 64
bInterval 0
I (9721) IOT_USBH: Set Device Configuration = 1
I (9727) IOT_USBH: Set Device Configuration Done
I (9732) IOT_USBH: Pipe init succeed, addr: 81
I (9737) IOT_USBH: Pipe init succeed, addr: 01
I (9742) USB_HCDC: CDC Device Connected
I (9747) esp-modem: --------- Modem PreDefined Info ------------------
I (9754) esp-modem: Model: User Defined
I (9758) esp-modem: Modem itf: IN Addr:0x81, OUT Addr:0x01
I (9764) esp-modem: ----------------------------------------------------
I (9772) gpio: GPIO[12]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (9781) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
I (9791) USB_HCDC: rx0 flush -0 = 0
I (9795) 4g_main: Modem Board Event: USB connected
I (9800) modem_board: DTE reconnect, reconnecting ...

I (10806) modem_board: reconnect after 5s...
I (11806) modem_board: reconnect after 4s...
I (12806) modem_board: reconnect after 3s...
I (13806) modem_board: reconnect after 2s...
I (14806) modem_board: reconnect after 1s...
I (14806) modem_board: Modem state STAGE_SYNC, Start
E (16816) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
I (16831) modem_board: Current timeouts: 1 and errors: 0
E (46831) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
W (46831) esp_modem_dce: esp_modem_dce_generic_command(22): Command:+++ response timeout
E (48836) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
E (50841) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
I (50856) modem_board: Current timeouts: 2 and errors: 0
W (50856) modem_board: Reset modem through reset pin........
W (50858) 4g_main: Modem Board Event: Hardware restart
I (50864) modem_board: modem_board_reset!
I (56069) 4g_main: Modem Board Event: Hardware restart done
E (58069) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
I (58084) modem_board: Current timeouts: 3 and errors: 0
I (58084) modem_board: modem_board_power_down!
E (68585) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
E (70590) esp-modem-dte: esp_modem_dte_send_cmd(266): process command timeout
response timeoutem_dce: esp_modem_dce_generic_command(22): Command:AT
I (70605) modem_board: Current timeouts: 4 and errors: 0
I (70605) modem_board: modem_board_power_down!

-----------------------------------------------------*-**-

@mayankbytebeam - Any Solution You Found ?

@narangmayank
Copy link
Author

@leeebo Thanks for your input. 0x85 and 0x04 worked for me.
@lovepreethitech Try each end point one by one.

@lovepreethitech
Copy link

Hi @mayankbytebeam ,

I guess you are using NEOWAY module.
I am using NEOWAY N58.

I have tried all the EPs
Majority interfaces gives - AT command Timeout
and 2 interfaces gives - AT&W failed error

EP IN | EP OUT | ERROR
81 | 1 | AT COMMAND – TIMEOUT
83 | 2 | AT&W COMMAND FAILED – ERROR
84 | 3 | AT COMMAND – TIMEOUT
85 | 4 | AT&W COMMAND FAILED – ERROR
86 | 5 | AT COMMAND – TIMEOUT
87 | 6 | AT COMMAND – TIMEOUT
88 | 7 | AT COMMAND – TIMEOUT
89 | 8 | AT COMMAND – TIMEOUT

Have you faced anything like this while working ?

@leeebo
Copy link
Collaborator

leeebo commented Aug 4, 2023

@lovepreethitech Hi please link Reset Control IO to your modem Reset Pin, try it again

image

@lovepreethitech
Copy link

Hi @leeebo

Could you please share the AT commands list that ESP send to 4G modem. Because my module is unresponsive to some commands. If i get the list i could check if that is working or not.

And Yes i have connected the modem reset pin to ESP.

@leeebo
Copy link
Collaborator

leeebo commented Aug 11, 2023

@lovepreethitech Hi, please set the ESP_LOG level to verbose to find the detailed Interaction process

@narangmayank
Copy link
Author

narangmayank commented Aug 11, 2023

@lovepreethitech Can you try commenting the command that is stucking?

Edit : I faced the same issue and after commenting the stuck command it went ahead and connected to my application server.

@lovepreethitech
Copy link

@mayankbytebeam In which file you comment that ?

@Y1hsiaochunnn
Copy link

@mayankbytebeam I am using SIM7600 4G HAT,i got it form waveshare ,i can connect it to esp32s3,but i found something is wrong.

Here are are serial logs:

I (10811) modem_board: reconnect after 5s...
I (11811) modem_board: reconnect after 4s...
I (12811) modem_board: reconnect after 3s...
I (13811) modem_board: reconnect after 2s...
I (14811) modem_board: reconnect after 1s...
I (14811) modem_board: Modem state STAGE_SYNC, Start
I (14849) modem_board: Network Auto reconnecting ...
I (14849) modem_board: Modem state STAGE_SYNC, Success!
W (14849) 4g_main: Modem Board Event: Network disconnected
I (14949) modem_board: Modem state STAGE_CHECK_SIM, Start
I (14953) modem_board: SIM Card Ready
I (14953) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (14953) 4g_main: Modem Board Event: SIM Card Connected
I (15054) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
I (15058) modem_board: Signal quality: rssi=1007317996, ber=1007321976
I (15058) modem_board: Modem state STAGE_CHECK_SIGNAL, Success!
I (15163) modem_board: Modem state STAGE_CHECK_REGIST, Start
W (15170) moGuru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.

Core 0 register dump:
PC : 0x4200c1e9 PS : 0x00060f30 A0 : 0x8200ceb4 A1 : 0x3fcba830
0x4200c1e9: strip_cr_lf_tail at D:/esp-iot-solution/components/usb/iot_usbh_modem/private_include/esp_modem_dce_common_commands.h:45
(inlined by) common_get_operator_after_mode_format at D:/esp-iot-solution/components/usb/iot_usbh_modem/src/esp_modem_dce_common_commands.c:206

A2 : 0x3fcb9904 A3 : 0x0000001d A4 : 0x0000000c A5 : 0x00000000
A6 : 0x3fcaaf60 A7 : 0x00000000 A8 : 0x00000000 A9 : 0x3fcba770
A10 : 0x00000013 A11 : 0x00000000 A12 : 0x3c0a90c4 A13 : 0x3fcb96f8
A14 : 0x0000000d A15 : 0x0000000a SAR : 0x00000010 EXCCAUSE: 0x0000001c
EXCVADDR: 0x0000001d LBEG : 0x400556d5 LEND : 0x400556e5 LCOUNT : 0xfffffffb
0x400556d5: strlen in ROM

0x400556e5: strlen in ROM

Backtrace: 0x4200c1e6:0x3fcba830 0x4200ceb1:0x3fcba870 0x4200cfc1:0x3fcba8a0
0x4200c1e6: strip_cr_lf_tail at D:/esp-iot-solution/components/usb/iot_usbh_modem/private_include/esp_modem_dce_common_commands.h:45
(inlined by) common_get_operator_after_mode_format at D:/esp-iot-solution/components/usb/iot_usbh_modem/src/esp_modem_dce_common_commands.c:206

0x4200ceb1: esp_dte_handle_line at D:/esp-iot-solution/components/usb/iot_usbh_modem/src/esp_modem_usb_dte.c:79

0x4200cfc1: esp_handle_usb_data at D:/esp-iot-solution/components/usb/iot_usbh_modem/src/esp_modem_usb_dte.c:119
(inlined by) _usb_data_recv_task at D:/esp-iot-solution/components/usb/iot_usbh_modem/src/esp_modem_usb_dte.c:222

ELF file SHA256: 4830ec08a754ae29

how can i fix it ?

@express8081999
Copy link

@mayankbytebeam Which development board do you use? Please make sure the device is powered

esp32s3 (合宙 luatos.com) and air780e 4G

@Y1hsiaochunnn
Copy link

Y1hsiaochunnn commented Sep 19, 2023 via email

@weekroom
Copy link

@Y1hsiaochunnn I can use the code from the Gitee library normally and have added the AIR780E option, which is convenient for me to apply to projects。https://gitee.com/dog_who_loves_cat_mint/esp32_-cdc_4-g

@leeebo
Copy link
Collaborator

leeebo commented Oct 9, 2023

@Y1hsiaochunnn

I (15163) modem_board: Modem state STAGE_CHECK_REGIST, Start
W (15170) moGuru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled.

It's a known bug, log in #295. will fix soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants