mhavill / Waveshare-SIM

WaveShare ESP32-S3-SIM7670G-4G - Thoughts and Observations
3 stars 2 forks source link

Any success in getting the cellular modem to work? #1

Open redhotchili0909 opened 3 months ago

redhotchili0909 commented 3 months ago

I got this board recently for a project as well, but I'm having trouble getting the modem to initialize. It would be awesome if you could share your progress or insights regarding this part.

laci22 commented 1 month ago

I got this board recently for a project as well, but I'm having trouble getting the modem to initialize. It would be awesome if you could share your progress or insights regarding this part.

Same me.. did you find something usefull?

mhavill commented 1 month ago

@redhotchili0909 & @laci22 - Sorry guys - I thought I had responded to this! I clearly remember writing a document but I must have not posted it to github! The sample code from Waveshare doesn't work initially due to the values used for the USB in and out channel. After a lot of trial and error I found a pair that does work. see line (6982) from my log below.

I (6945) USB_HCDC: Set Device Line State: dtr 1, rts 0 I (6951) USB_HCDC: Set Device Line State Done I (6956) IOT_USBH: Pipe init succeed, addr: 88 I (6961) IOT_USBH: Pipe init succeed, addr: 04 I (6966) USB_HCDC: CDC Device Connected I (6971) esp-modem: --------- Modem PreDefined Info ------------------ I (6978) esp-modem: Model: User Defined I (6982) esp-modem: Modem itf: IN Addr:0x88, OUT Addr:0x04 I (6989) esp-modem: ---------------------------------------------------- I (6996) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 I (7006) USB_HCDC: rx0 flush -0 = 0 I (7006) modem_board: DTE reconnect, reconnecting ...

I (8015) modem_board: reconnect after 5s... I (9015) modem_board: reconnect after 4s... I (10015) modem_board: reconnect after 3s... I (11015) modem_board: reconnect after 2s... I (12015) modem_board: reconnect after 1s... I (12015) modem_board: Modem state STAGE_SYNC, Start I (12031) modem_board: Network Auto reconnecting ...

mhavill commented 1 month ago

This is set in menuconfig (I use the ESP-IDF extension in VSCode, but you should be able to find it in the native menuconfig.

Note I have set the SIM APN there also - you will probably need it later - some data networks do require the APN but in the performance improvements it is recommended anyway!

Screenshot 2024-09-15 135105

mhavill commented 1 month ago

When you do get it working you will find the security is 'weak' but this can be changed in the 'app' which you can access once you can connect to the AP - for me it is http://192.168.4.1 - under WLAN change it to WPA2PSK.

BTW I have translated the app to English from Chinese in the spiffs directory - I'll copy it across to this github repo

zelms commented 1 month ago

Hey friends, I think I have a related issue. I've received code from a friend that was written in the Arduino IDE, which utilized the modem. For him, everything works great and after the first time I upload his code to the board, everything works for me. If I then power cycle the device, then I am unable to initialize the modem. I installed ESP-IDF with the hope that it would fix this issue, but when I accessed menuconfig (either through VS Code or the command line) I couldn't find the parameters mentioned in the above comment. Is there any additional installation I need to do to get those parameters in menuconfig? For reference, I'm using ESP-IDF version 5.3 on Ubuntu 22.04 and I am able to get example programs compiled and uploaded to the board.

laci22 commented 1 month ago

Hey friends, I think I have a related issue. I've received code from a friend that was written in the Arduino IDE, which utilized the modem. For him, everything works great and after the first time I upload his code to the board, everything works for me. If I then power cycle the device, then I am unable to initialize the modem. I installed ESP-IDF with the hope that it would fix this issue, but when I accessed menuconfig (either through VS Code or the command line) I couldn't find the parameters mentioned in the above comment. Is there any additional installation I need to do to get those parameters in menuconfig? For reference, I'm using ESP-IDF version 5.3 on Ubuntu 22.04 and I am able to get example programs compiled and uploaded to the board.

could you upload that arduino code?

zelms commented 1 month ago

could you upload that arduino code?

The code is probably too complicated to easily be understood, but here is an example from the tinyGSM arduino library where I've modified it to not use the autobaud feature. DiagnosticESP32s3.txt

mhavill commented 1 month ago

Hey friends, I think I have a related issue. I've received code from a friend that was written in the Arduino IDE, which utilized the modem. For him, everything works great and after the first time I upload his code to the board, everything works for me. If I then power cycle the device, then I am unable to initialize the modem. I installed ESP-IDF with the hope that it would fix this issue, but when I accessed menuconfig (either through VS Code or the command line) I couldn't find the parameters mentioned in the above comment. Is there any additional installation I need to do to get those parameters in menuconfig? For reference, I'm using ESP-IDF version 5.3 on Ubuntu 22.04 and I am able to get example programs compiled and uploaded to the board.

Hi. Is this the first time using ESP-IDF? It is very different to Arduino IDE. Your loaded program from Waveshare WIKI should look similar to this with .../managed_components/espressif__iot_usbh_modem image

Then in menuconfig you should see this image

If you are new to ESP-IDF I strongly recommend https://learnesp32.com/

zelms commented 1 month ago

Hi. Is this the first time using ESP-IDF?... If you are new to ESP-IDF I strongly recommend https://learnesp32.com/

Yes it is, thank you for the link to help me learn more.

Your loaded program from Waveshare WIKI...

I think this is where my problem originates from because I wasn't able to find any ESP-IDF code from the waveshare wiki. All of the code I can find is for the Arduino IDE, which is not very helpful for me. I found the iot_usbh_modem component example through the espressif registry, which seems to not have the waveshare example code you've mentioned. Where can I find the example code?

Then in menuconfig you should see this

Ah ok, so each menuconfig correlates to a specific program. It is not the same configuration options no matter what.

mhavill commented 1 month ago

Hi @zelms I have just added a message from WaveShare Support with a link to the demo software - it is in the Wiki but I missed it also!

zelms commented 1 month ago

I have just added a message from WaveShare Support with a link to the demo software

Thank you for adding that! I think I'm still missing something as when I download the zip file from the link I still can't find any code that looks like it's written for ESP-IDF. I can't find an example named ESP32-S3-A-SIM7670X-4G-example in the download, but I do have examples named GNSS-With-WaveshareCloud and SD. Is it possible that they've changed what demo software they're distributing?

mhavill commented 1 month ago

Hi @zelms I think you are correct! I have just added the original source to this repo under Waveshare folder

zelms commented 1 month ago

Thank you so much! I was able to get it running on my board, but I'm still having issues connecting to the modem. Since this is happening in both the Arduino IDE and ESP-IDF then I think that means it's an issue with the board. If I find a solution, then I will post it here for others to see

mhavill commented 1 month ago

Hi @zelms Did you make the changes to menuconfig as above?

zelms commented 1 month ago

Hey @mhavill Yes I did, with no luck. Here's a chunk out of the serial monitor, which looks like it's still waiting for the modem to initialize

I (828) sleep: Configure to isolate all GPIO pins in sleep state
I (835) sleep: Enable automatic switching of GPIO sleep configuration
I (842) main_task: Started on CPU0
I (849) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (855) main_task: Calling app_main()
I (872) 4g_main: ====================================
I (872) 4g_main:      ESP 4G Cat.1 Wi-Fi Router
I (872) 4g_main: ====================================
I (878) modem_board: iot_usbh_modem, version: 0.2.1
I (883) modem_board: Force reset modem board....
I (889) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (898) modem_board: Resetting modem using io=33, level=1
I (1104) modem_board: Waiting for modem initialize ready
I (6104) USB_HCDC: iot_usbh_cdc, version: 0.2.2
I (6104) IOT_USBH: iot_usbh, version: 0.2.1
I (6134) IOT_USBH: USB Port=1 init succeed, fifo strategy=0
I (6134) IOT_USBH: usb port start succeed
I (6134) IOT_USBH: USB Processing Start
I (6134) USB_HCDC: usbh cdc driver install succeed
I (6138) IOT_USBH: Waiting USB Connection
I (6144) USB_HCDC: Waiting CDC Device Connection
I (6148) IOT_USBH: Port power: ON Succeed
I (6134) USB_HCDC: CDC task start

At (1104) it looks like we're waiting for the modem, and there's no indication from the monitor that it has been initialized. The board also doesn't create a wifi network

mhavill commented 1 month ago

HI @zelms, You are a bit premature. See my log below. 9673 defines the usb channel in and out that you set in menuconfig 12616 onwards defines and sets up the wi-fi AP

How far do you get? Are you getting (6217) IOT_USBH: line 131 PORT_EVENT_CONNECTION? - Have you set your DIP switches correctly? 1,2,4,off with switch 3 (4g) ON

I (682) 4g_main:      ESP 4G Cat.1 Wi-Fi Router
I (682) 4g_main: ====================================
I (687) modem_board: iot_usbh_modem, version: 0.2.1
I (693) modem_board: Force reset modem board....
I (698) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (707) modem_board: Resetting modem using io=33, level=1
I (913) modem_board: Waiting for modem initialize ready
I (5913) USB_HCDC: iot_usbh_cdc, version: 0.2.2
I (5913) IOT_USBH: iot_usbh, version: 0.2.1
I (5943) IOT_USBH: USB Port=1 init succeed, fifo strategy=0
I (5943) IOT_USBH: usb port start succeed
I (5943) IOT_USBH: USB Processing Start
I (5943) USB_HCDC: usbh cdc driver install succeed
I (5947) IOT_USBH: Waiting USB Connection
I (5953) USB_HCDC: Waiting CDC Device Connection
I (5957) IOT_USBH: Port power: ON Succeed
I (5943) USB_HCDC: CDC task start
I (6217) IOT_USBH: line 131 PORT_EVENT_CONNECTION
I (6317) IOT_USBH: Resetting Port
I (6377) IOT_USBH: Port reset succeed
I (6377) IOT_USBH: Getting Port Speed
I (6377) IOT_USBH: USB Speed: full-speed
I (6379) IOT_USBH: Pipe init succeed, addr: 00
I (6384) IOT_USBH: Set Device Addr = 1
I (6389) IOT_USBH: Set Device Addr Done
I (6393) IOT_USBH: get device desc
I (6398) 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 0x19d1
idProduct 0x1
bcdDevice 2.00
iManufacturer 1
iProduct 2
iSerialNumber 3
bNumConfigurations 1
I (6427) IOT_USBH: get short config desc
I (6432) IOT_USBH: get config desc, actual_num_bytes:16
I (6437) IOT_USBH: get full config desc
I (6443) IOT_USBH: get full config desc, actual_num_bytes:347
*** Configuration descriptor ***
bLength 9
bDescriptorType 2
wTotalLength 339
bNumInterfaces 10
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
bMaxPower 200mA
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 0xe0
bFunctionSubClass 0x1
bFunctionProtocol 0x3
iFunction 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 0
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0xe0
        bInterfaceSubClass 0x1
        bInterfaceProtocol 0x3
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x81   EP 1 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 8
                bInterval 4
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 1
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x1    EP 1 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x82   EP 2 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 2
bInterfaceCount 2
bFunctionClass 0x2
bFunctionSubClass 0x2
bFunctionProtocol 0x1
iFunction 7
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 2
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0x2
        bInterfaceSubClass 0x2
        bInterfaceProtocol 0x1
        iInterface 7
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x83   EP 3 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 16
                bInterval 255
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 3
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x2    EP 2 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x84   EP 4 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 4
bInterfaceCount 2
bFunctionClass 0x2
bFunctionSubClass 0x2
bFunctionProtocol 0x1
iFunction 8
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 4
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0x2
        bInterfaceSubClass 0x2
        bInterfaceProtocol 0x1
        iInterface 8
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x85   EP 5 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 16
                bInterval 255
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 5
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x3    EP 3 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x86   EP 6 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 6
bInterfaceCount 2
bFunctionClass 0x2
bFunctionSubClass 0x2
bFunctionProtocol 0x1
iFunction 9
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 6
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0x2
        bInterfaceSubClass 0x2
        bInterfaceProtocol 0x1
        iInterface 9
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x87   EP 7 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 16
                bInterval 255
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 7
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x4    EP 4 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x88   EP 8 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 8
bInterfaceCount 2
bFunctionClass 0x2
bFunctionSubClass 0x2
bFunctionProtocol 0x1
iFunction 10
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 8
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0x2
        bInterfaceSubClass 0x2
        bInterfaceProtocol 0x1
        iInterface 10
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x89   EP 9 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 16
                bInterval 255
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 9
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x5    EP 5 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x8a   EP 10 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
I (6937) IOT_USBH: Set Device Configuration = 1
I (6942) IOT_USBH: Set Device Configuration Done
I (6947) USB_HCDC: Set Device Line State: dtr 1, rts 0
I (6953) USB_HCDC: Set Device Line State Done
I (6958) IOT_USBH: Pipe init succeed, addr: 88
I (6963) IOT_USBH: Pipe init succeed, addr: 04
I (6968) USB_HCDC: CDC Device Connected
I (6973) esp-modem: --------- Modem PreDefined Info ------------------
I (6980) esp-modem: Model: User Defined
I (6984) esp-modem: Modem itf: IN Addr:0x88, OUT Addr:0x04
I (6991) esp-modem: ----------------------------------------------------
I (6998) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (7008) USB_HCDC: rx0 flush -0 = 0
I (7008) modem_board: DTE reconnect, reconnecting ...

I (8017) modem_board: reconnect after 5s...
I (9017) modem_board: reconnect after 4s...
I (10017) modem_board: reconnect after 3s...
I (11017) modem_board: reconnect after 2s...
I (12017) modem_board: reconnect after 1s...
I (12017) modem_board: Modem state STAGE_SYNC, Start
I (12058) modem_board: Network Auto reconnecting ...
W (12058) 4g_main: Modem Board Event: Network disconnected
I (12058) modem_board: Modem state STAGE_SYNC, Success!
I (12164) modem_board: Modem state STAGE_CHECK_SIM, Start
I (12169) modem_board: SIM Card Ready
I (12169) 4g_main: Modem Board Event: SIM Card Connected
I (12169) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (12275) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
I (12280) modem_board: Signal quality: rssi=22, ber=0
I (12280) modem_board: Modem state STAGE_CHECK_SIGNAL, Success!
I (12382) modem_board: Modem state STAGE_CHECK_REGIST, Start
I (12386) modem_board: Network registed, Operator: "50502"
I (12386) modem_board: Modem state STAGE_CHECK_REGIST, Success!
I (12490) modem_board: Modem state STAGE_START_PPP, Start
I (12546) modem_board: Modem state STAGE_START_PPP, Success!
W (12547) modem_board: Modem event! 0
I (12586) esp-netif_lwip-ppp: Connected
I (12586) modem_board: IP event! 6
I (12586) modem_board: Modem Connected to PPP Server
I (12589) modem_board: ppp ip: 10.232.29.96, mask: 255.255.255.255, gw: 10.64.64.64
I (12598) modem_board: Main DNS: 198.142.152.162
I (12603) modem_board: Backup DNS: 198.142.152.163
I (12608) esp-modem-netif: PPP state changed event 0: (NETIF_PPP_ERRORNONE)
I (12616) 4g_router_server: ssid = Vanessa
I (12621) 4g_router_server: password =  xxxxxxxxxxxx (Hidden by me, but it does show in the logs and set in Menuconfig)
I (12627) 4g_router_server: auth_mode = WPA2_PSK
I (12632) 4g_router_server: channel : Can't find in NVS!
I (12638) 4g_router_server: hide_ssid = false
I (12643) 4g_router_server: bandwidth : Can't find in NVS!
I (12646) modem_board: Modem state STAGE_WAIT_IP, Start
I (12655) 4g_main: Modem Board Event: Network connected
I (12655) modem_board: Modem state STAGE_WAIT_IP, Success!
I (12661) 4g_router_server: max_connection : Can't find in NVS!
I (12713) 4g_router_server: Partition size: total: 956561, used: 184485
I (12714) 4g_router_server: Starting server on port: '80'
I (12717) 4g_router_server: Registering URI handlers
I (12722) 4g_router_server: Starting webserver
I (12727) pp: pp rom version: e7ae62f
I (12731) net80211: net80211 rom version: e7ae62f
I (12738) wifi:wifi driver task: 3fcd20f0, prio:23, stack:6656, core=0
I (12746) wifi:wifi firmware version: ccaebfa
I (12747) wifi:wifi certification version: v7.0
I (12751) wifi:config NVS flash: enabled
I (12754) wifi:config nano formating: disabled
I (12759) wifi:Init data frame dynamic rx buffer num: 32
I (12764) wifi:Init static rx mgmt buffer num: 5
I (12768) wifi:Init management short buffer num: 32
I (12773) wifi:Init static tx buffer num: 16
I (12777) wifi:Init tx cache buffer num: 32
I (12781) wifi:Init static tx FG buffer num: 2
I (12785) wifi:Init static rx buffer size: 1600
I (12789) wifi:Init static rx buffer num: 10
I (12793) wifi:Init dynamic rx buffer num: 32
I (12797) wifi_init: accept mbox: 6
I (12801) wifi_init: tcpip mbox: 32
I (12805) wifi_init: udp mbox: 6
I (12809) wifi_init: tcp mbox: 6
I (12813) wifi_init: tcp tx win: 5744
I (12817) wifi_init: tcp rx win: 5744
I (12822) wifi_init: tcp mss: 1440
I (12826) wifi_init: WiFi/LWIP prefer SPIRAM
I (12831) wifi_init: WiFi IRAM OP enabled
I (12836) wifi_init: WiFi RX IRAM OP enabled
I (12841) wifi_init: LWIP IRAM OP enabled
I (12846) phy_init: phy_version 680,a6008b2,Jun  4 2024,16:41:10
I (12895) wifi:mode : softAP (7c:df:a1:ed:65:0d)
I (12898) wifi:Total power save buffer number: 8
I (12898) wifi:Init max length of beacon: 752/752
I (12898) wifi:Init max length of beacon: 752/752
I (12902) modem_wifi: Wi-Fi AP started
I (12903) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
I (12920) wifi:Total power save buffer number: 8
I (12921) modem_wifi: softap ssid: Vanessa password: xxxxxxxxxxxx (Hidden by me, but it does show in the logs and set in Menuconfig)
I (12921) esp_netif_lwip: DHCP server started on interface WIFI_AP_DEF with IP: 192.168.4.1
I (12936) modem_wifi: ap dns addr(default): 8.8.8.8
I (12942) 4g_main: changed: ap dns addr (auto): 198.142.152.162
I (12948) 4g_main: Ping addr 8.8.8.8 Restart..
I (13228) 4g_main: 64 bytes from 8.8.8.8 icmp_seq=1 ttl=56 time=274 ms
zelms commented 1 month ago

Hi @mhavill

You were right about me being premature! I was able to get it to work briefly (which is really exciting since I haven't been able to get communication between the board and modem working for quite awhile), but I ran in to an issue where it seems like the modem can't start a PPP connection. It worked for about 10 minutes, and then it stopped being able to ping 8.8.8.8. After rebooting it couldn't start a PPP connection. Log below, first error at (12767)

I (27) boot: ESP-IDF v5.3.1 2nd stage bootloader
I (27) boot: compile time Sep 24 2024 12:02:31
I (27) boot: Multicore bootloader
I (30) boot: chip revision: v0.2
I (34) qio_mode: Enabling QIO for flash chip WinBond
I (39) boot.esp32s3: Boot SPI Speed : 80MHz
I (44) boot.esp32s3: SPI Mode       : QIO
I (49) boot.esp32s3: SPI Flash Size : 16MB
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) esp_image: segment 0: paddr=00010020 vaddr=3c0b0020 size=2bcech (179436) map
I (140) esp_image: segment 1: paddr=0003bd14 vaddr=3fc9cf00 size=04304h ( 17156) load
I (143) esp_image: segment 2: paddr=00040020 vaddr=42000020 size=a2a58h (666200) map
I (247) esp_image: segment 3: paddr=000e2a80 vaddr=3fca1204 size=009e8h (  2536) load
I (247) esp_image: segment 4: paddr=000e3470 vaddr=40374000 size=18eb4h (102068) load
I (282) boot: Loaded app from partition at offset 0x10000
I (282) boot: Disabling RNG early entropy source...
I (294) esp_psram: Found 2MB PSRAM device
I (294) esp_psram: Speed: 40MHz
I (294) cpu_start: Multicore app
I (714) esp_psram: SPI SRAM memory test OK
I (723) cpu_start: Pro cpu start user code
I (723) cpu_start: cpu freq: 240000000 Hz
I (723) app_init: Application information:
I (726) app_init: Project name:     usb_cdc_4g_module
I (731) app_init: App version:      1
I (736) app_init: Compile time:     Sep 25 2024 13:34:27
I (742) app_init: ELF file SHA256:  46adcca906ed730a...
I (748) app_init: ESP-IDF:          v5.3.1
I (752) efuse_init: Min chip rev:     v0.0
I (757) efuse_init: Max chip rev:     v0.99 
I (762) efuse_init: Chip rev:         v0.2
I (767) heap_init: Initializing. RAM available for dynamic allocation:
I (774) heap_init: At 3FCA54D0 len 00044240 (272 KiB): RAM
I (780) heap_init: At 3FCE9710 len 00005724 (21 KiB): RAM
I (786) heap_init: At 3FCF0000 len 00008000 (32 KiB): DRAM
I (792) heap_init: At 600FE100 len 00001EE8 (7 KiB): RTCRAM
I (799) esp_psram: Adding pool of 2048K of PSRAM memory to heap allocator
I (807) spi_flash: detected chip: winbond
I (811) spi_flash: flash io: qio
W (815) spi_flash: Detected size(16384k) larger than the size in the binary image header(4096k). Using the size in the binary image header.
I (828) sleep: Configure to isolate all GPIO pins in sleep state
I (835) sleep: Enable automatic switching of GPIO sleep configuration
I (842) main_task: Started on CPU0
I (849) esp_psram: Reserving pool of 32K of internal memory for DMA/internal allocations
I (855) main_task: Calling app_main()
I (874) 4g_main: ====================================
I (874) 4g_main:      ESP 4G Cat.1 Wi-Fi Router
I (874) 4g_main: ====================================
I (880) modem_board: iot_usbh_modem, version: 0.2.1
I (885) modem_board: Force reset modem board....
I (890) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (900) modem_board: Resetting modem using io=33, level=1
I (1106) modem_board: Waiting for modem initialize ready
I (6106) USB_HCDC: iot_usbh_cdc, version: 0.2.2
I (6106) IOT_USBH: iot_usbh, version: 0.2.1
I (6136) IOT_USBH: USB Port=1 init succeed, fifo strategy=0
I (6136) IOT_USBH: usb port start succeed
I (6136) IOT_USBH: USB Processing Start
I (6136) USB_HCDC: usbh cdc driver install succeed
I (6140) IOT_USBH: Waiting USB Connection
I (6146) USB_HCDC: Waiting CDC Device Connection
I (6150) IOT_USBH: Port power: ON Succeed
I (6136) USB_HCDC: CDC task start
I (6410) IOT_USBH: line 131 PORT_EVENT_CONNECTION
I (6510) IOT_USBH: Resetting Port
I (6570) IOT_USBH: Port reset succeed
I (6570) IOT_USBH: Getting Port Speed
I (6570) IOT_USBH: USB Speed: full-speed
I (6572) IOT_USBH: Pipe init succeed, addr: 00
I (6577) IOT_USBH: Set Device Addr = 1
I (6582) IOT_USBH: Set Device Addr Done
I (6586) IOT_USBH: get device desc
I (6591) 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 0x19d1
idProduct 0x1
bcdDevice 2.00
iManufacturer 1
iProduct 2
iSerialNumber 3
bNumConfigurations 1
I (6620) IOT_USBH: get short config desc
I (6625) IOT_USBH: get config desc, actual_num_bytes:16
I (6630) IOT_USBH: get full config desc
I (6636) IOT_USBH: get full config desc, actual_num_bytes:347
*** Configuration descriptor ***
bLength 9
bDescriptorType 2
wTotalLength 339
bNumInterfaces 10
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xa0
bMaxPower 200mA
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 0
bInterfaceCount 2
bFunctionClass 0xe0
bFunctionSubClass 0x1
bFunctionProtocol 0x3
iFunction 0
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 0
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0xe0
        bInterfaceSubClass 0x1
        bInterfaceProtocol 0x3
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x81   EP 1 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 8
                bInterval 4
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 1
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x1    EP 1 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x82   EP 2 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 2
bInterfaceCount 2
bFunctionClass 0x2
bFunctionSubClass 0x2
bFunctionProtocol 0x1
iFunction 7
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 2
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0x2
        bInterfaceSubClass 0x2
        bInterfaceProtocol 0x1
        iInterface 7
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x83   EP 3 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 16
                bInterval 255
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 3
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x2    EP 2 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x84   EP 4 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 4
bInterfaceCount 2
bFunctionClass 0x2
bFunctionSubClass 0x2
bFunctionProtocol 0x1
iFunction 8
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 4
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0x2
        bInterfaceSubClass 0x2
        bInterfaceProtocol 0x1
        iInterface 8
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x85   EP 5 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 16
                bInterval 255
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 5
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x3    EP 3 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x86   EP 6 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 6
bInterfaceCount 2
bFunctionClass 0x2
bFunctionSubClass 0x2
bFunctionProtocol 0x1
iFunction 9
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 6
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0x2
        bInterfaceSubClass 0x2
        bInterfaceProtocol 0x1
        iInterface 9
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x87   EP 7 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 16
                bInterval 255
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 7
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x4    EP 4 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x88   EP 8 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
*** Interface Association Descriptor ***
bLength 8
bDescriptorType 11
bFirstInterface 8
bInterfaceCount 2
bFunctionClass 0x2
bFunctionSubClass 0x2
bFunctionProtocol 0x1
iFunction 10
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 8
        bAlternateSetting 0
        bNumEndpoints 1
        bInterfaceClass 0x2
        bInterfaceSubClass 0x2
        bInterfaceProtocol 0x1
        iInterface 10
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x89   EP 9 IN
                bmAttributes 0x3        INT
                wMaxPacketSize 16
                bInterval 255
        *** Interface descriptor ***
        bLength 9
        bDescriptorType 4
        bInterfaceNumber 9
        bAlternateSetting 0
        bNumEndpoints 2
        bInterfaceClass 0xa
        bInterfaceSubClass 0x0
        bInterfaceProtocol 0x0
        iInterface 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x5    EP 5 OUT
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
                *** Endpoint descriptor ***
                bLength 7
                bDescriptorType 5
                bEndpointAddress 0x8a   EP 10 IN
                bmAttributes 0x2        BULK
                wMaxPacketSize 64
                bInterval 0
I (7130) IOT_USBH: Set Device Configuration = 1
I (7135) IOT_USBH: Set Device Configuration Done
I (7140) IOT_USBH: Pipe init succeed, addr: 88
I (7145) IOT_USBH: Pipe init succeed, addr: 04
I (7150) USB_HCDC: CDC Device Connected
I (7155) esp-modem: --------- Modem PreDefined Info ------------------
I (7162) esp-modem: Model: User Defined
I (7167) esp-modem: Modem itf: IN Addr:0x88, OUT Addr:0x04
I (7173) esp-modem: ----------------------------------------------------
I (7180) gpio: GPIO[33]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (7190) USB_HCDC: rx0 flush -0 = 0
I (7190) modem_board: DTE reconnect, reconnecting ...

I (8200) modem_board: reconnect after 5s...
I (9200) modem_board: reconnect after 4s...
I (10200) modem_board: reconnect after 3s...
I (11200) modem_board: reconnect after 2s...
I (12200) modem_board: reconnect after 1s...
I (12200) modem_board: Modem state STAGE_SYNC, Start
I (12219) modem_board: Network Auto reconnecting ...
W (12219) 4g_main: Modem Board Event: Network disconnected
I (12219) modem_board: Modem state STAGE_SYNC, Success!
I (12325) modem_board: Modem state STAGE_CHECK_SIM, Start
I (12329) modem_board: SIM Card Ready
I (12329) 4g_main: Modem Board Event: SIM Card Connected
I (12329) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (12436) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
I (12441) modem_board: Signal quality: rssi=23, ber=0
I (12441) modem_board: Modem state STAGE_CHECK_SIGNAL, Success!
I (12543) modem_board: Modem state STAGE_CHECK_REGIST, Start
I (12548) modem_board: Network registed, Operator: "310410"
I (12548) modem_board: Modem state STAGE_CHECK_REGIST, Success!
I (12651) modem_board: Modem state STAGE_START_PPP, Start
E (12767) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (22706) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (22716) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (32712) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(26): Command:ATO
E (32717) esp_modem_dce: esp_modem_switch_to_data_mode(144): Resume data mode failed
E (32726) esp_modem_dce: esp_modem_dce_set_working_mode(169): Setting data mode failed
E (32734) esp-modem-dte: esp_modem_dte_change_mode(350): set new working mode:1 failed
E (32743) esp-modem: esp_modem_start_ppp(46): enter ppp mode failed
W (32750) modem_board: Modem state STAGE_START_PPP, Failed, retry1, after 3000ms...
I (35758) modem_board: Modem state STAGE_START_PPP, Start
E (35896) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (45817) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (45828) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (55823) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(26): Command:ATO
E (55828) esp_modem_dce: esp_modem_switch_to_data_mode(144): Resume data mode failed
E (55837) esp_modem_dce: esp_modem_dce_set_working_mode(169): Setting data mode failed
E (55845) esp-modem-dte: esp_modem_dte_change_mode(350): set new working mode:1 failed
E (55854) esp-modem: esp_modem_start_ppp(46): enter ppp mode failed
W (55861) modem_board: Modem state STAGE_START_PPP, Failed, retry2, after 3000ms...
I (58869) modem_board: Modem state STAGE_START_PPP, Start
E (59000) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (68928) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (68939) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (78934) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(26): Command:ATO
E (78939) esp_modem_dce: esp_modem_switch_to_data_mode(144): Resume data mode failed
E (78948) esp_modem_dce: esp_modem_dce_set_working_mode(169): Setting data mode failed
E (78956) esp-modem-dte: esp_modem_dte_change_mode(350): set new working mode:1 failed
E (78965) esp-modem: esp_modem_start_ppp(46): enter ppp mode failed
W (78972) modem_board: Modem state STAGE_START_PPP, Failed, retry3, after 3000ms...
I (81980) modem_board: Modem state STAGE_START_PPP, Start
E (82280) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (92210) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (92221) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (102216) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutdem_dce: esp_modem_dce_generic_command(26): Command:ATO
E (102221) esp_modem_dce: esp_modem_switch_to_data_mode(144): Resume data mode failed
E (102230) esp_modem_dce: esp_modem_dce_set_working_mode(169): Setting data mode failed
E (102239) esp-modem-dte: esp_modem_dte_change_mode(350): set new working mode:1 failed
E (102247) esp-modem: esp_modem_start_ppp(46): enter ppp mode failed
W (102254) modem_board: Modem state STAGE_START_PPP, Failed, retry4, after 3000ms...
I (105263) modem_board: Modem state STAGE_START_PPP, Start
E (105402) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (115319) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutdem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (115330) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (125325) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutdem_dce: esp_modem_dce_generic_command(26): Command:ATO
E (125330) esp_modem_dce: esp_modem_switch_to_data_mode(144): Resume data mode failed
E (125339) esp_modem_dce: esp_modem_dce_set_working_mode(169): Setting data mode failed
E (125348) esp-modem-dte: esp_modem_dte_change_mode(350): set new working mode:1 failed
E (125356) esp-modem: esp_modem_start_ppp(46): enter ppp mode failed
E (125363) modem_board: Modem state STAGE_START_PPP, retry 5, timeout !
W (125371) modem_board: Retry From Start !
I (125375) modem_board: Modem state STAGE_SYNC, Start
I (125400) modem_board: Network Auto reconnecting ...
W (125400) 4g_main: Modem Board Event: Network disconnected
I (125400) modem_board: Modem state STAGE_SYNC, Success!
I (125507) modem_board: Modem state STAGE_CHECK_SIM, Start
I (125511) modem_board: SIM Card Ready
I (125511) 4g_main: Modem Board Event: SIM Card Connected
I (125511) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (125619) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
E (125356) esp-modem: esp_modem_start_ppp(46): enter ppp mode failed
E (125363) modem_board: Modem state STAGE_START_PPP, retry 5, timeout !
W (125371) modem_board: Retry From Start !
I (125375) modem_board: Modem state STAGE_SYNC, Start
I (125400) modem_board: Network Auto reconnecting ...
W (125400) 4g_main: Modem Board Event: Network disconnected
I (125400) modem_board: Modem state STAGE_SYNC, Success!
I (125507) modem_board: Modem state STAGE_CHECK_SIM, Start
I (125511) modem_board: SIM Card Ready
I (125511) 4g_main: Modem Board Event: SIM Card Connected
I (125511) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (125619) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
E (125363) modem_board: Modem state STAGE_START_PPP, retry 5, timeout !
W (125371) modem_board: Retry From Start !
I (125375) modem_board: Modem state STAGE_SYNC, Start
I (125400) modem_board: Network Auto reconnecting ...
W (125400) 4g_main: Modem Board Event: Network disconnected
I (125400) modem_board: Modem state STAGE_SYNC, Success!
I (125507) modem_board: Modem state STAGE_CHECK_SIM, Start
I (125511) modem_board: SIM Card Ready
I (125511) 4g_main: Modem Board Event: SIM Card Connected
I (125511) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (125619) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
W (125371) modem_board: Retry From Start !
I (125375) modem_board: Modem state STAGE_SYNC, Start
I (125400) modem_board: Network Auto reconnecting ...
W (125400) 4g_main: Modem Board Event: Network disconnected
I (125400) modem_board: Modem state STAGE_SYNC, Success!
I (125507) modem_board: Modem state STAGE_CHECK_SIM, Start
I (125511) modem_board: SIM Card Ready
I (125511) 4g_main: Modem Board Event: SIM Card Connected
I (125511) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (125619) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
W (125400) 4g_main: Modem Board Event: Network disconnected
I (125400) modem_board: Modem state STAGE_SYNC, Success!
I (125507) modem_board: Modem state STAGE_CHECK_SIM, Start
I (125511) modem_board: SIM Card Ready
I (125511) 4g_main: Modem Board Event: SIM Card Connected
I (125511) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (125619) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
I (125507) modem_board: Modem state STAGE_CHECK_SIM, Start
I (125511) modem_board: SIM Card Ready
I (125511) 4g_main: Modem Board Event: SIM Card Connected
I (125511) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (125619) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
I (125625) modem_board: Signal quality: rssi=23, ber=0
I (125625) modem_board: Modem state STAGE_CHECK_SIGNAL, Success!
I (125511) modem_board: SIM Card Ready
I (125511) 4g_main: Modem Board Event: SIM Card Connected
I (125511) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (125619) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
I (125625) modem_board: Signal quality: rssi=23, ber=0
I (125625) modem_board: Modem state STAGE_CHECK_SIGNAL, Success!
I (125726) modem_board: Modem state STAGE_CHECK_REGIST, Start
I (125731) modem_board: Network registed, Operator: "310410"
I (125511) modem_board: Modem state STAGE_CHECK_SIM, Success!
I (125619) modem_board: Modem state STAGE_CHECK_SIGNAL, Start
I (125625) modem_board: Signal quality: rssi=23, ber=0
I (125625) modem_board: Modem state STAGE_CHECK_SIGNAL, Success!
I (125726) modem_board: Modem state STAGE_CHECK_REGIST, Start
I (125731) modem_board: Network registed, Operator: "310410"
I (125731) modem_board: Modem state STAGE_CHECK_REGIST, Success!
I (125625) modem_board: Signal quality: rssi=23, ber=0
I (125625) modem_board: Modem state STAGE_CHECK_SIGNAL, Success!
I (125726) modem_board: Modem state STAGE_CHECK_REGIST, Start
I (125731) modem_board: Network registed, Operator: "310410"
I (125731) modem_board: Modem state STAGE_CHECK_REGIST, Success!
I (125726) modem_board: Modem state STAGE_CHECK_REGIST, Start
I (125731) modem_board: Network registed, Operator: "310410"
I (125731) modem_board: Modem state STAGE_CHECK_REGIST, Success!
I (125834) modem_board: Modem state STAGE_START_PPP, Start
E (125958) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (135891) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
I (125731) modem_board: Modem state STAGE_CHECK_REGIST, Success!
I (125834) modem_board: Modem state STAGE_START_PPP, Start
E (125958) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (135891) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutdem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
I (125834) modem_board: Modem state STAGE_START_PPP, Start
E (125958) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (135891) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutdem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (135891) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutdem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (135902) esp-modem-dte: esp_dte_handle_line(79): handle line failed
 response timeoutdem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (135902) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (145897) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
E (135902) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (145897) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
E (145897) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutdem_dce: esp_modem_dce_generic_command(26): Command:ATO
E (145902) esp_modem_dce: esp_modem_switch_to_data_mode(144): Resume data mode failed
E (145911) esp_modem_dce: esp_modem_dce_set_working_mode(169): Setting data mode failed
E (145920) esp-modem-dte: esp_modem_dte_change_mode(350): set new working mode:1 failed
E (145928) esp-modem: esp_modem_start_ppp(46): enter ppp mode failed
W (145935) modem_board: Modem state STAGE_START_PPP, Failed, retry1, after 3000ms...
I (148944) modem_board: Modem state STAGE_START_PPP, Start
E (149087) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (159000) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutdem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (159011) esp-modem-dte: esp_dte_handle_line(79): handle line failed
(The log continues, but it's an infinite loop of restarts...)

When attempting to resolve this issue myself, it seemed like this issue mostly happened in pre-existing libraries. I will keep digging to see what the issue may be

mhavill commented 1 month ago

We differ around this block in the logs, specifically at (12546) in mine

I (12490) modem_board: Modem state STAGE_START_PPP, Start
I (12546) modem_board: Modem state STAGE_START_PPP, Success!
W (12547) modem_board: Modem event! 0
I (12586) esp-netif_lwip-ppp: Connected
I (12586) modem_board: IP event! 6
I (12586) modem_board: Modem Connected to PPP Server
I (12589) modem_board: ppp ip: 10.232.29.96, mask: 255.255.255.255, gw: 10.64.64.64
I (12598) modem_board: Main DNS: 198.142.152.162
I (12603) modem_board: Backup DNS: 198.142.152.163
I (12608) esp-modem-netif: PPP state changed event 0: (NETIF_PPP_ERRORNONE)
I (12616) 4g_router_server: ssid = Vanessa
I (12621) 4g_router_server: password =  xxxxxxxxxxxx (Hidden by me, but it does show in the logs and set in Menuconfig)
I (12627) 4g_router_server: auth_mode = WPA2_PSK
I (12632) 4g_router_server: channel : Can't find in NVS!
I (12638) 4g_router_server: hide_ssid = false

In yours (12767) is showing an error and failure continues from there

I (12651) modem_board: Modem state STAGE_START_PPP, Start
E (12767) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (22706) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(26): Command:ATD*99***1#
E (22716) esp-modem-dte: esp_dte_handle_line(79): handle line failed
E (32712) esp-modem-dte: esp_modem_dte_send_cmd(268): process command timeout
 response timeoutem_dce: esp_modem_dce_generic_command(26): Command:ATO

Is it your switch settings?
I only have switch 3 ON the rest are all OFF Which version of ESP-IDF are you compiling in? I am using ESP-IDF v5.3.1

mhavill commented 1 month ago

I can see similar issues on the Internet when searching "esp-modem-dte: esp_dte_handle_line: handle line failed" but I have not found any with a fix yet

zelms commented 1 month ago

Is it your switch settings?

My switches are the same as yours

Which version of ESP-IDF are you compiling in?

I'm also on 5.3.1, version 1.8.1 on the VSCode plugin

Here's what I've figured out. "handle line failed" is being thrown at line 79 of managed_components/espressif__iot_usbh_modem/src/esp_modem_usb_dte.c

ESP_MODEM_ERR_CHECK(dce->handle_line(dce, line) == ESP_OK, "handle line failed", err);

And here is handle_line from managed_components/espressif__iot_usbh_modem/private_include/esp_modem_dce.h

/**
 * @brief Type of line handlers called fro DTE upon line response reception
 */
typedef esp_err_t (*esp_modem_dce_handle_line_t)(esp_modem_dce_t *dce, const char *line);

There is also the error "process command timeout" which is line 268 in managed_components/espressif__iot_usbh_modem/src/esp_modem_usb_dte.c

ESP_MODEM_ERR_CHECK(bits&ESP_MODEM_COMMAND_BIT, "process command timeout", err);

This catches the timeout for the call above it

EventBits_t bits = xEventGroupWaitBits(esp_dte->process_group, (ESP_MODEM_COMMAND_BIT|ESP_MODEM_STOP_BIT), pdTRUE, pdFALSE, pdMS_TO_TICKS(timeout));

And this command is waiting for the ESP modem command bit to be set or the ESP modem stop bit to be set. The error happens after neither of these things happen after a set time

Not sure how much that all helps, but it's something I will need to pick back up tomorrow. I'll keep digging into why these errors are being thrown