Answers checklist.
General issue report
Dear community, I have a question regarding the use of esp_modem with USB modem on esp32-s3.
Background:
So far I have used the BG95-M3 Mini PCIE with the esp_modem component, using UART as the means of communication. This mini pcie version does NOT require a power on signal (https://fcc.report/FCC-ID/XMR201910BG95M3/4893773.pdf).
I just told esp_modem it is an BG-96 and everything works as expected.
Now, I want to look into using USB as a means of communication, to be more flexible in terms of which modem can be used, since all vendors have the UART port on different pin numbers, and some have 3.3V UART and others have 1.8V UART; it is a big mess.
I thought it would be an easy switch from uart to USB. I have connected the modem on a generic mini pcie to usb board that also has a sim card holder, and attached it to the USB port of devkitC. Because the modem needs power, i soldered a lead to the 5V node on this mini pcie to usb board, and powered it from my lab supply.
So the board is connected to the usb of the ESP32-S3, and is powered. The gnd is also shared between the esp32-s3 and the modem.
I updated the code of the pppos example like so:
#if CONFIG_EXAMPLE_MODEM_DEVICE_BG96 == 1
ESP_LOGI(TAG, "Initializing esp_modem for the BG96 module...");
// struct esp_modem_usb_term_config usb_config = ESP_MODEM_BG96_USB_CONFIG();
struct esp_modem_usb_term_config usb_config = ESP_MODEM_DEFAULT_USB_CONFIG(0x2C7C, 0x0700, 2);
esp_modem_dce_device_t usb_dev_type = ESP_MODEM_DCE_BG96;
If i put the WRONG usb PID in the config (e.g. 0x0701) the output is like this and keeps stuck:
I (423) pppos_example: Initializing esp_modem for the BG96 module...
I (433) pppos_example: Waiting for USB device connection...
esp>
If i put the correct usb PID in the config (0x0700), the output is like this, which to me indicated the usb connection is fine, but there is some usb protocol stuff going wrong.
I (1033) pppos_example: Initializing esp_modem for the BG96 module...
I (1043) pppos_example: Waiting for USB device connection...
esp> V (1053) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1053) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x80E
D (1053) intr_alloc: Connected src 38 to int 9 (cpu 0)
D (1063) HCD DWC: FIFO config lines: RX=104, PTX=32, NPTX=64
D (1103) usb_terminal: USB Host installed
D (1103) cdc_acm: Checking list of opened USB devices
D (1103) cdc_acm: Checking list of connected USB devices
D (1153) cdc_acm: Checking list of connected USB devices
D (1203) cdc_acm: Checking list of connected USB devices
D (1253) cdc_acm: Checking list of connected USB devices
D (1303) cdc_acm: Checking list of connected USB devices
D (1353) cdc_acm: Checking list of connected USB devices
D (1403) cdc_acm: Checking list of connected USB devices
D (1413) HUB: Root port reset
D (1413) HUB: Device tree node (uid=1): new
D (1413) ENUM: [0:0] Start processing, device address 0
D (1413) ENUM: [0:0] GET_SHORT_DEV_DESC OK
D (1423) USBH: Processing actions 0x4
D (1423) USBH: Default pipe device 0
V (1423) ENUM: 0x3fcee8e8 80 06 00 01 00 00 08 00 12 01 00 02 00 00 00 40 |...............@|
D (1433) ENUM: [0:0] CHECK_SHORT_DEV_DESC OK
D (1453) cdc_acm: Checking list of connected USB devices
D (1493) ENUM: [0:0] SECOND_RESET OK
D (1493) ENUM: [0:0] SECOND_RESET_COMPLETE OK
D (1493) ENUM: [0:0] SET_ADDR OK
D (1493) USBH: Processing actions 0x4
D (1493) USBH: Default pipe device 0
V (1503) ENUM: 0x3fcee8e8 00 05 01 00 00 00 00 00 |........|
D (1503) ENUM: Assign address (dev_addr=1)
D (1513) ENUM: [0:0] CHECK_ADDR OK
D (1503) cdc_acm: Checking list of connected USB devices
D (1523) ENUM: [0:0] SET_ADDR_RECOVERY OK
D (1523) ENUM: [0:0] GET_FULL_DEV_DESC OK
D (1533) USBH: Processing actions 0x4
D (1533) USBH: Default pipe device 1
V (1533) ENUM: 0x3fcee8e8 80 06 00 01 00 00 12 00 12 01 00 02 00 00 00 40 |...............@|
V (1543) ENUM: 0x3fcee8f8 7c 2c 00 07 00 00 03 02 04 01 ||,........|
D (1553) ENUM: [0:0] CHECK_FULL_DEV_DESC OK
D (1553) ENUM: Selected bConfigurationValue=1
D (1553) ENUM: [0:0] SELECT_CONFIG OK
D (1553) ENUM: [0:0] GET_SHORT_CONFIG_DESC OK
D (1563) USBH: Processing actions 0x4
D (1563) USBH: Default pipe device 1
V (1573) ENUM: 0x3fcee8e8 80 06 00 02 00 00 08 00 09 02 73 00 04 01 01 e0 |..........s.....|
D (1583) ENUM: [0:0] CHECK_SHORT_CONFIG_DESC OK
D (1583) ENUM: [0:0] GET_FULL_CONFIG_DESC OK
D (1593) USBH: Processing actions 0x4
D (1593) USBH: Default pipe device 1
V (1593) ENUM: 0x3fcee8e8 80 06 00 02 00 00 73 00 09 02 73 00 04 01 01 e0 |......s...s.....|
V (1603) ENUM: 0x3fcee8f8 fa 09 04 00 00 02 ff ff 30 00 07 05 81 02 40 00 |........0.....@.|
V (1613) ENUM: 0x3fcee908 00 07 05 01 02 40 00 00 09 04 01 00 02 ff ff 60 |.....@.........`|
V (1613) ENUM: 0x3fcee918 00 07 05 82 02 40 00 00 07 05 02 02 40 00 00 09 |.....@......@...|
V (1633) ENUM: 0x3fcee928 04 02 00 03 ff ff ff 00 07 05 83 03 40 00 05 07 |............@...|
V (1643) ENUM: 0x3fcee938 05 84 02 40 00 00 07 05 03 02 40 00 00 09 04 03 |...@......@.....|
V (1643) ENUM: 0x3fcee948 00 03 ff ff ff 00 07 05 85 03 40 00 05 07 05 86 |..........@.....|
V (1653) ENUM: 0x3fcee958 02 40 00 00 07 05 04 02 40 00 00 |.@......@..|
D (1663) ENUM: [0:0] CHECK_FULL_CONFIG_DESC OK
D (1663) ENUM: [0:0] GET_SHORT_LANGID_TABLE OK
D (1563) cdc_acm: Checking list of connected USB devices
D (1663) USBH: Processing actions 0x4
D (1673) USBH: Default pipe device 1
V (1683) ENUM: 0x3fcee8e8 80 06 00 03 00 00 02 00 04 03 |..........|
D (1693) ENUM: [0:0] CHECK_SHORT_LANGID_TABLE OK
D (1693) ENUM: [0:0] GET_FULL_LANGID_TABLE OK
D (1703) USBH: Processing actions 0x4
D (1703) USBH: Default pipe device 1
V (1703) ENUM: 0x3fcee8e8 80 06 00 03 00 00 04 00 04 03 09 04 |............|
D (1713) ENUM: [0:0] CHECK_FULL_LANGID_TABLE OK
D (1713) ENUM: [0:0] GET_SHORT_MANU_STR_DESC OK
D (1723) USBH: Processing actions 0x4
D (1723) USBH: Default pipe device 1
V (1723) ENUM: 0x3fcee8e8 80 06 03 03 09 04 02 00 2c 03 |........,.|
D (1743) ENUM: [0:0] CHECK_SHORT_MANU_STR_DESC OK
D (1743) ENUM: [0:0] GET_FULL_MANU_STR_DESC OK
D (1723) cdc_acm: Checking list of connected USB devices
D (1743) USBH: Processing actions 0x4
D (1753) USBH: Default pipe device 1
V (1753) ENUM: 0x3fcee8e8 80 06 03 03 09 04 2c 00 2c 03 51 00 75 00 65 00 |......,.,.Q.u.e.|
V (1763) ENUM: 0x3fcee8f8 63 00 74 00 65 00 6c 00 2c 00 20 00 49 00 6e 00 |c.t.e.l.,. .I.n.|
V (1773) ENUM: 0x3fcee908 63 00 6f 00 72 00 70 00 6f 00 72 00 61 00 74 00 |c.o.r.p.o.r.a.t.|
V (1783) ENUM: 0x3fcee918 65 00 64 00 |e.d.|
D (1793) ENUM: [0:0] CHECK_FULL_MANU_STR_DESC OK
D (1803) ENUM: [0:0] GET_SHORT_PROD_STR_DESC OK
D (1803) cdc_acm: Checking list of connected USB devices
D (1803) USBH: Processing actions 0x4
D (1813) USBH: Default pipe device 1
V (1813) ENUM: 0x3fcee8e8 80 06 02 03 09 04 02 00 28 03 |........(.|
D (1813) ENUM: [0:0] CHECK_SHORT_PROD_STR_DESC OK
D (1823) ENUM: [0:0] GET_FULL_PROD_STR_DESC OK
D (1823) USBH: Processing actions 0x4
D (1823) USBH: Default pipe device 1
V (1843) ENUM: 0x3fcee8e8 80 06 02 03 09 04 28 00 28 03 51 00 75 00 65 00 |......(.(.Q.u.e.|
V (1843) ENUM: 0x3fcee8f8 63 00 74 00 65 00 6c 00 20 00 4c 00 50 00 57 00 |c.t.e.l. .L.P.W.|
V (1853) ENUM: 0x3fcee908 41 00 20 00 4d 00 6f 00 64 00 75 00 6c 00 65 00 |A. .M.o.d.u.l.e.|
D (1863) ENUM: [0:0] CHECK_FULL_PROD_STR_DESC OK
D (1863) ENUM: [0:0] GET_SHORT_SER_STR_DESC OK
D (1853) cdc_acm: Checking list of connected USB devices
D (1863) USBH: Processing actions 0x4
D (1873) USBH: Default pipe device 1
V (1873) ENUM: 0x3fcee8e8 80 06 04 03 09 04 02 00 12 03 |..........|
D (1893) ENUM: [0:0] CHECK_SHORT_SER_STR_DESC OK
D (1893) ENUM: [0:0] GET_FULL_SER_STR_DESC OK
D (1903) USBH: Processing actions 0x4
D (1903) USBH: Default pipe device 1
V (1903) ENUM: 0x3fcee8e8 80 06 04 03 09 04 12 00 12 03 31 00 65 00 35 00 |..........1.e.5.|
V (1913) ENUM: 0x3fcee8f8 63 00 63 00 65 00 32 00 35 00 |c.c.e.2.5.|
D (1913) ENUM: [0:0] CHECK_FULL_SER_STR_DESC OK
D (1923) ENUM: [0:0] SET_CONFIG OK
D (1923) cdc_acm: Checking list of connected USB devices
D (1933) USBH: Processing actions 0x4
D (1943) USBH: Default pipe device 1
V (1943) ENUM: 0x3fcee8e8 00 09 01 00 00 00 00 00 |........|
D (1953) ENUM: [0:0] CHECK_CONFIG OK
D (1953) ENUM: [0:0] Processing complete, new device address 1
D (1953) ENUM: [0:0] COMPLETE OK
D (1953) USBH: Processing actions 0x40
D (1963) USBH: New device 1
D (1963) cdc_acm: New device connected
D (1973) cdc_acm: Checking list of connected USB devices
D (1973) cdc_acm: Submitting poll for BULK IN transfer
D (1983) cdc_acm: Submitting poll for INTR IN transfer
I (1983) pppos_example: Modem connected, waiting 10 seconds for boot...
D (1983) cdc_acm: notif xfer cb
D (1993) usb_terminal: Ignored USB event 1
D (1993) cdc_acm: Submitting poll for INTR IN transfer
V (11983) command_lib: get_signal_quality
V (11983) command_lib: generic_get_string
D (11983) usb_terminal: 0x3fc9b3ec 41 54 2b 43 53 51 0d |AT+CSQ.|
V (11993) cdc_acm: Submitting BULK OUT transfer chunk: 7 bytes (remaining: 7)
D (11993) cdc_acm: out/ctrl xfer cb
E (12493) pppos_example: esp_modem_get_signal_quality failed with 263 ESP_ERR_TIMEOUT
I (12493) main_task: Returned from app_main()
I also tested the modem console example, and all AT commands time out...
Again, over UART everything was smooth sailing.
Am i missing something? If i plug the modem in my linux box, i can just open /dev/USB2 and start sending AT commands.
Please let me know if you have any toughts. I mean the USB seems te be ok and we receive the USB info...
Answers checklist.
General issue report
Dear community, I have a question regarding the use of esp_modem with USB modem on esp32-s3.
Background:
So far I have used the BG95-M3 Mini PCIE with the esp_modem component, using UART as the means of communication. This mini pcie version does NOT require a power on signal (https://fcc.report/FCC-ID/XMR201910BG95M3/4893773.pdf).
I just told esp_modem it is an BG-96 and everything works as expected.
Now, I want to look into using USB as a means of communication, to be more flexible in terms of which modem can be used, since all vendors have the UART port on different pin numbers, and some have 3.3V UART and others have 1.8V UART; it is a big mess.
I thought it would be an easy switch from uart to USB. I have connected the modem on a generic mini pcie to usb board that also has a sim card holder, and attached it to the USB port of devkitC. Because the modem needs power, i soldered a lead to the 5V node on this mini pcie to usb board, and powered it from my lab supply.
So the board is connected to the usb of the ESP32-S3, and is powered. The gnd is also shared between the esp32-s3 and the modem.
I updated the code of the pppos example like so:
If i put the WRONG usb PID in the config (e.g.
0x0701) the output is like this and keeps stuck:If i put the correct usb PID in the config (0x0700), the output is like this, which to me indicated the usb connection is fine, but there is some usb protocol stuff going wrong.
I also tested the modem console example, and all AT commands time out...
Again, over UART everything was smooth sailing.
Am i missing something? If i plug the modem in my linux box, i can just open /dev/USB2 and start sending AT commands.
Please let me know if you have any toughts. I mean the USB seems te be ok and we receive the USB info...