Open dmitrij9992905 opened 7 months ago
Hi @dmitrij9992905
It seems like the initial connection just cannot be established, are you sure that your SIM card is activated, you've got the correct APN and the GSM band is supported in your country (SIM800 is G2 only)?
Could you try the default pppos client example, just to rule out potential CMUX issues?
Hi @dmitrij9992905
It seems like the initial connection just cannot be established, are you sure that your SIM card is activated, you've got the correct APN and the GSM band is supported in your country (SIM800 is G2 only)?
Yes, 2G works in my country, and I took credentials such as APN and user/password. It seems to me that APN is OK but user and password is not being transfered at all. So, the connection closes.
Could you try the default pppos client example, just to rule out potential CMUX issues?
Although I build my project based on default example, I will try to build another one based on pppos client example and write you back
I've just check both pppos and cmux modes, and it appeared that after power on, I restarted SIM800C modem and waited 10 secs, and it was too small to initiate modem and its connection to network. I set it 30 secs and started working normally with pppos. In CMUX, it connected SIM800C to Internet, requested operator name, but PPP has lost connection...
Here are logs for pppos client:
I (30) boot: ESP-IDF v5.2.1 2nd stage bootloader
I (31) boot: compile time May 7 2024 22:28:27
I (31) boot: Multicore bootloader
I (35) boot: chip revision: v1.0
I (39) boot.esp32: SPI Speed : 40MHz
I (43) boot.esp32: SPI Mode : DIO
I (48) boot.esp32: SPI Flash Size : 2MB
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 (83) boot: 2 factory factory app 00 00 00010000 00100000
I (91) boot: End of partition table
I (95) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=24aach (150188) map
I (155) esp_image: segment 1: paddr=00034ad4 vaddr=3ffb0000 size=023d4h ( 9172) load
I (159) esp_image: segment 2: paddr=00036eb0 vaddr=40080000 size=09168h ( 37224) load
I (175) esp_image: segment 3: paddr=00040020 vaddr=400d0020 size=68260h (426592) map
I (322) esp_image: segment 4: paddr=000a8288 vaddr=40089168 size=04fe0h ( 20448) load
I (337) boot: Loaded app from partition at offset 0x10000
I (337) boot: Disabling RNG early entropy source...
I (349) cpu_start: Multicore app
I (358) cpu_start: Pro cpu start user code
I (358) cpu_start: cpu freq: 160000000 Hz
I (358) cpu_start: Application information:
I (361) cpu_start: Project name: pppos_client
I (366) cpu_start: App version: 1
I (370) cpu_start: Compile time: May 7 2024 22:28:19
I (377) cpu_start: ELF file SHA256: 01f9b7720...
I (382) cpu_start: ESP-IDF: v5.2.1
I (387) cpu_start: Min chip rev: v0.0
I (391) cpu_start: Max chip rev: v3.99
I (396) cpu_start: Chip rev: v1.0
I (401) heap_init: Initializing. RAM available for dynamic allocation:
I (408) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (414) heap_init: At 3FFB3CF8 len 0002C308 (176 KiB): DRAM
I (421) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (427) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (433) heap_init: At 4008E148 len 00011EB8 (71 KiB): IRAM
I (441) spi_flash: detected chip: generic
I (444) spi_flash: flash io: dio
W (448) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (462) main_task: Started on CPU0
I (472) main_task: Calling app_main()
I (472) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (472) gpio: GPIO[25]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (682) pppos_example: Modem power has been setup
I (30682) pppos_example: Initializing esp_modem for the SIM800 module...
I (30682) uart: queue free spaces: 30
I (30692) pppos_example: HW set_flow_control OK
I (30692) pppos_example: Signal quality: rssi=19, ber=5
I (30712) pppos_example: Waiting for IP address
I (31242) pppos_example: Modem Connect to PPP Server
I (31242) esp-netif_lwip-ppp: Connected
I (31242) pppos_example: ~~~~~~~~~~~~~~
I (31242) pppos_example: IP : 11.61.236.24
I (31252) pppos_example: Netmask : 255.255.255.255
I (31252) pppos_example: Gateway : 192.168.254.254
I (31262) pppos_example: Name Server1: 213.87.142.85
I (31262) pppos_example: Name Server2: 213.87.142.84
I (31272) pppos_example: ~~~~~~~~~~~~~~
I (31272) pppos_example: GOT ip event!!!
I (31282) pppos_example: PPP state changed event 0
I (31282) pppos_example: MQTT other event id: 7
I (31292) pppos_example: Waiting for MQTT data
I (32812) pppos_example: MQTT_EVENT_CONNECTED
I (32812) pppos_example: sent subscribe successful, msg_id=24787
I (33182) pppos_example: MQTT_EVENT_SUBSCRIBED, msg_id=24787
I (33192) pppos_example: sent publish successful, msg_id=0
I (33492) pppos_example: MQTT_EVENT_DATA
TOPIC=/topic/esp-pppos
DATA=esp32-pppos
I (33812) esp-netif_lwip-ppp: User interrupt
I (33812) pppos_example: PPP state changed event 5
I (33812) pppos_example: User interrupted event from netif:0x3ffb9440
I (33822) esp_modem_netif: PPP state changed event 5
I (34012) pppos_example: IMSI=250017149186727
I (34012) main_task: Returned from app_main()
Here is the log from cmux client after delay increase:
I (1442) main_task: Calling app_main()
System start
V (1952) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1952) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1952) intr_alloc: Connected src 50 to int 13 (cpu 0)
I (1952) gpio: GPIO[35]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:2
V (1962) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (1972) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0xE
D (1982) intr_alloc: Connected src 22 to int 17 (cpu 0)
I (1992) cmux_example: Success init axp20x !!!
I (2002) cmux_example: DC2: 1800 mV
I (2002) cmux_example: DC3: 3300 mV
I (2002) cmux_example: LDO2: 3300 mV
I (2002) cmux_example: LDO3: 3300 mV
I (2012) cmux_example: LDO4: DISABLE
I (2012) cmux_example: Exten: ENABLE
I (2022) cmux_example: setChargeControlCur:15
I (2032) gpio: GPIO[4]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (2032) gpio: GPIO[25]| InputEn: 0| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:0
I (2242) cmux_example: Modem power has been setup
D (62242) event: running task for loop 0x3ffb9f44
D (62242) event: created task for loop 0x3ffb9f44
D (62242) event: created event loop 0x3ffb9f44
D (62242) esp_netif_lwip: LwIP stack has been initialized
D (62242) esp_netif_lwip: esp-netif has been successfully initialized
I (62252) uart: ESP_INTR_FLAG_IRAM flag not set while CONFIG_UART_ISR_IN_IRAM is enabled, flag updated
I (62262) uart: queue free spaces: 30
V (62262) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (62272) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting flags 0x40E
D (62282) intr_alloc: Connected src 35 to int 18 (cpu 0)
D (62292) esp_netif_lwip: check: remote, if=0x3ffb8c10 fn=0x400ebc10
0x400ebc10: esp_netif_new_api at /home/espidf521/esp/esp-idf-v5.2.1/components/esp_netif/lwip/esp_netif_lwip.c:690
V (62292) esp_netif_objects: esp_netif_add_to_list_unsafe 0x3ffbf388
D (62302) esp_netif_objects: esp_netif_add_to_list_unsafe netif added successfully (total netifs: 1)
D (62312) esp-netif_lwip-ppp: esp_netif_new_ppp: PPP connection created: 0x3ffbf5b8
D (62312) esp-netif_lwip-ppp: Phase Dead
D (62322) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (62322) esp_netif_lwip: check: remote, if=0x3ffbf388 fn=0x400ec364
0x400ec364: esp_netif_ppp_set_auth_api at /home/espidf521/esp/esp-idf-v5.2.1/components/esp_netif/lwip/esp_netif_lwip.c:2503
D (62332) esp_netif_lwip: call api in lwip: ret=0x0, give sem
I (62342) cmux_example: PPP auth set
V (62342) command_lib: set_flow_control
V (62342) command_lib: generic_command_common
V (62352) command_lib: generic_command
D (62352) command_lib: generic_command command AT+IFC=2,2
D (62362) command_lib: Response:
OK
I (62362) cmux_example: set_flow_control OK
V (62372) command_lib: set_echo
V (62372) command_lib: generic_command_common
V (62372) command_lib: generic_command
D (62382) command_lib: generic_command command ATE0
D (62382) command_lib: Response:
OK
V (62392) command_lib: set_pdp_context
V (62392) command_lib: generic_command_common
V (62392) command_lib: generic_command
D (62402) command_lib: generic_command command AT+CGDCONT=1,"IP","internet.mts.ru"
D (62412) command_lib: Response:
OK
V (62412) command_lib: set_data_mode
V (62412) command_lib: generic_command
D (62422) command_lib: generic_command command ATD*99#
D (62432) command_lib: Response:
CONNECT
D (62432) esp_netif_handlers: esp_netif action has started with netif0x3ffbf388 from event_id=0
D (62432) esp_netif_lwip: check: remote, if=0x3ffbf388 fn=0x400ebe80
0x400ebe80: esp_netif_start_api at /home/espidf521/esp/esp-idf-v5.2.1/components/esp_netif/lwip/esp_netif_lwip.c:1068
D (62442) esp_netif_lwip: esp_netif_start_api 0x3ffbf388
D (62452) esp-netif_lwip-ppp: esp_netif_start_ppp: Starting PPP connection: 0x3ffbf5b8
D (62452) esp-netif_lwip-ppp: Phase Start
D (62462) esp-netif_lwip-ppp: Phase Establish
D (62462) esp_netif_lwip: check: local, if=0x3ffbf388 fn=0x400ec598
0x400ec598: esp_netif_update_default_netif_lwip at /home/espidf521/esp/esp-idf-v5.2.1/components/esp_netif/lwip/esp_netif_lwip.c:316
D (62472) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3ffbf388
V (62482) esp_netif_lwip: esp_netif_is_netif_up esp_netif:0x3ffbf388
D (62482) esp_netif_lwip: call api in lwip: ret=0x0, give sem
E (62492) cmux_example: esp_modem_set_mode(ESP_MODEM_MODE_DATA) failed with 1
D (62502) esp_netif_handlers: esp_netif action stopped with netif0x3ffbf388 from event_id=0
D (62502) esp-netif_lwip-ppp: Phase Authenticate
D (62512) esp_netif_lwip: check: remote, if=0x3ffbf388 fn=0x400ec068
0x400ec068: esp_netif_stop_api at /home/espidf521/esp/esp-idf-v5.2.1/components/esp_netif/lwip/esp_netif_lwip.c:1167
D (62512) esp-netif_lwip-ppp: Phase Network
D (62522) esp-netif_lwip-ppp: esp_netif_stop_ppp: Stopped PPP connection: 0x3ffbf5b8
D (62532) esp-netif_lwip-ppp: Phase Terminate
D (62532) esp-netif_lwip-ppp: Phase Establish
D (62542) esp_netif_lwip: check: local, if=0x3ffbf388 fn=0x400ec598
0x400ec598: esp_netif_update_default_netif_lwip at /home/espidf521/esp/esp-idf-v5.2.1/components/esp_netif/lwip/esp_netif_lwip.c:316
D (62542) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3ffbf388
V (62552) esp_netif_objects: esp_netif_next_unsafe 0x0
V (62552) esp_netif_lwip: esp_netif_is_netif_up esp_netif:0x3ffbf388
V (62562) esp_netif_objects: esp_netif_next_unsafe 0x3ffbf388
D (62572) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (62572) esp-netif_lwip-ppp: Phase Disconnect
D (62582) esp-netif_lwip-ppp: Phase Dead
I (62582) esp-netif_lwip-ppp: User interrupt
D (62582) event: running post NETIF_PPP_STATUS:5 with handler 0x400dc998 and context 0x3ffc0930 on loop 0x3ffb9f44
0x400dc998: esp_modem::Netif::on_ppp_changed(void*, char const*, long, void*) at /home/espidf521/esp32-workspace/simple_cmux_client/managed_components/espressif__esp_modem/src/esp_modem_netif.cpp:22
I (62592) esp_modem_netif: PPP state changed event 5
V (62602) intr_alloc: esp_intr_free: Disabling int, killing handler
I (62612) main_task: Returned from app_main()
Answers checklist.
General issue report
For now, I need to connect to Internet from ESP32 using SIM800C again, using LilyGO T-Call based on AXP192 PMIC. I use ESP-IDF 5.2.1 and esp-modem v1.1.0 component, and use simple_cmux_client as a base.
But all I see that AT commands are working, PDP context is setting up, but connection to *99# establishes and interrupts even without connection to Internet. Even with setting the PAP authentication.
Now I'm using MTS sim card and I see the same effect as with Beeline.
Here is my code:
And verbose connection logs: