olliiiver / esp_lte_modem

ESP32 / esp-idf LTE UART modem library for sim7600 with cmux support
MIT License
54 stars 19 forks source link

after issue esp32 software reset the library gets stucks #4

Open sushant-ht opened 2 years ago

sushant-ht commented 2 years ago

Hi,

I am using this code to link esp32 with 7600 and send data to MQTT, but I have noticed 1 issue, on power the code works fine, but if it gets reset by software reset or esp32 reset itself for any error that the code get hangs in the below-mentioned loop,

` do { ESP_LOGI(TAG, "Trying to initialize modem on GPIO TX: %d / RX: %d", config.tx_io_num, config.rx_io_num);

    /* create dce object */
    #if CONFIG_EXAMPLE_MODEM_DEVICE_SIM800
        dce = sim800_init(dte);
    #elif CONFIG_EXAMPLE_MODEM_DEVICE_BG96
        dce = bg96_init(dte);
    #elif CONFIG_EXAMPLE_MODEM_DEVICE_SIM7600
        dce = sim7600_init(dte);
    #else
        #error "Unsupported DCE"
    #endif
    vTaskDelay(500 / portTICK_PERIOD_MS);
} while (dce == NULL);`

following is log after reset

I (29066) pppos_example: GOT ip event!!! I (29076) system_api: Base MAC address is not set I (29076) system_api: read default base MAC address from EFUSE I (29086) pppos_example: MQTT other event id: 7 I (30226) pppos_example: MQTT_EVENT_CONNECTED I (30226) pppos_example: sent subscribe successful, msg_id=59904 I (30576) pppos_example: MQTT_EVENT_SUBSCRIBED, msg_id=59904 I (30576) pppos_example: sent publish successful, msg_id=0 I (30926) pppos_example: MQTT_EVENT_DATA TOPIC=/topic/esp-pppos

DATA=esp32-pppos I (32476) pppos_example: rssi: 0, ber: 0 I (33576) pppos_example: rssi: 0, ber: 0 I (34676) pppos_example: rssi: 0, ber: 0 I (35776) pppos_example: rssi: 0, ber: 0 I (36876) pppos_example: rssi: 0, ber: 0 ets Jun 8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT) configsip: 0, SPIWP:0xee clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00 mode:DIO, clock div:2 load:0x3fff0030,len:4 load:0x3fff0034,len:6984 load:0x40078000,len:13852 load:0x40080400,len:4548 entry 0x400806ec I (29) boot: ESP-IDF v4.2 2nd stage bootloader I (29) boot: compile time 16:43:57 I (29) boot: chip revision: 1 I (32) boot_comm: chip revision: 1, min. bootloader chip revision: 0 I (39) boot.esp32: SPI Speed : 40MHz I (43) boot.esp32: SPI Mode : DIO I (48) boot.esp32: SPI Flash Size : 4MB I (52) boot: Enabling RNG early entropy source... I (58) boot: Partition Table: I (61) boot: ## Label Usage Type ST Offset Length I (69) boot: 0 nvs WiFi data 01 02 00009000 00006000 I (76) boot: 1 phy_init RF data 01 01 0000f000 00001000 I (84) boot: 2 factory factory app 00 00 00010000 00100000 I (91) boot: End of partition table I (95) boot_comm: chip revision: 1, min. application chip revision: 0 I (102) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x19360 (103264) map I (150) esp_image: segment 1: paddr=0x00029388 vaddr=0x3ffb0000 size=0x02114 ( 8468) load I (154) esp_image: segment 2: paddr=0x0002b4a4 vaddr=0x40080000 size=0x00400 ( 1024) load I (158) esp_image: segment 3: paddr=0x0002b8ac vaddr=0x40080400 size=0x0476c ( 18284) load I (174) esp_image: segment 4: paddr=0x00030020 vaddr=0x400d0020 size=0x63810 (407568) map I (329) esp_image: segment 5: paddr=0x00093838 vaddr=0x40084b6c size=0x06b6c ( 27500) load I (348) boot: Loaded app from partition at offset 0x10000 I (348) boot: Disabling RNG early entropy source... I (348) cpu_start: Pro cpu up. I (352) cpu_start: Application information: I (356) cpu_start: Project name: pppos_client I (362) cpu_start: App version: 1 I (366) cpu_start: Compile time: Aug 11 2021 17:01:58 I (372) cpu_start: ELF file SHA256: af7ac3fa0b39003a... I (378) cpu_start: ESP-IDF: v4.2-dirty I (384) cpu_start: Starting app cpu, entry point is 0x40081268 I (376) cpu_start: App cpu up. I (394) heap_init: Initializing. RAM available for dynamic allocation: I (401) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM I (407) heap_init: At 3FFB39B0 len 0002C650 (177 KiB): DRAM I (413) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM I (420) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM I (426) heap_init: At 4008B6D8 len 00014928 (82 KiB): IRAM I (432) cpu_start: Pro cpu start user code I (451) spi_flash: detected chip: generic I (451) spi_flash: flash io: dio I (452) cpu_start: Starting scheduler on PRO CPU. I (0) cpu_start: Starting scheduler on APP CPU. I (26056) uart: queue free spaces: 30 I (26056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (27556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (27556) dce_service: esp_modem_dce_sync(67): send command failed E (27556) bg96: bg96_init(539): sync failed I (28056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (29556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (29556) dce_service: esp_modem_dce_sync(67): send command failed E (29556) bg96: bg96_init(539): sync failed I (30056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (31556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (31556) dce_service: esp_modem_dce_sync(67): send command failed E (31556) bg96: bg96_init(539): sync failed I (32056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (33556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (33556) dce_service: esp_modem_dce_sync(67): send command failed E (33556) bg96: bg96_init(539): sync failed I (34056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (35556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (35556) dce_service: esp_modem_dce_sync(67): send command failed E (35556) bg96: bg96_init(539): sync failed I (36056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (37556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (37556) dce_service: esp_modem_dce_sync(67): send command failed E (37556) bg96: bg96_init(539): sync failed I (38056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (39556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (39556) dce_service: esp_modem_dce_sync(67): send command failed E (39556) bg96: bg96_init(539): sync failed I (40056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (41556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (41556) dce_service: esp_modem_dce_sync(67): send command failed E (41556) bg96: bg96_init(539): sync failed I (42056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (43556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (43556) dce_service: esp_modem_dce_sync(67): send command failed E (43556) bg96: bg96_init(539): sync failed I (44056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (45556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (45556) dce_service: esp_modem_dce_sync(67): send command failed E (45556) bg96: bg96_init(539): sync failed I (46056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (47556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (47556) dce_service: esp_modem_dce_sync(67): send command failed E (47556) bg96: bg96_init(539): sync failed I (48056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (49556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (49556) dce_service: esp_modem_dce_sync(67): send command failed E (49556) bg96: bg96_init(539): sync failed I (50056) pppos_example: Trying to initialize modem on GPIO TX: 26 / RX: 25 E (51556) esp-modem: esp_modem_dte_send_cmd(417): process command timeout E (51556) dce_service: esp_modem_dce_sync(67): send command failed E (51556) bg96: bg96_init(539): sync failed

Can you help some way resolve this, when I send SMS it is received, so i don't think it is a communication error between esp32 & sim7600, actually i thought earlier may be sim7600 is getting in sleep mode but that is not the case, somewhere pppos library is getting stuck,

W (434356) pppos_example: Unknow line received: 0m E (434406) esp-modem: esp_dte_handle_line(138): handle line failed W (434406) pppos_example: Unknow line received: +CMTI: "SM",15

is there a way to debug ? and find the root of the problem?