-
My goal is: To have an ESP32 with a SIM7000E modem connect to MQTT+SLL and mDash, after having made a connection to my provider through PPPoS / LTE-M.
-
My actions are: Having set up everything according to docs. Booting the Firmware on the ESP, seeing how PPPoS establishes a connection and gets an IP address. But never seeing MQTT or mDash making a connection.
-
The result I see is: See log below (excerpt from a fresh boot of the ESP). Funnily enough, SNTP seems to work…occasionally.
Trying baud rate 115200 (fc off)...
[Dec 16 16:16:14.730] mgos_pppos.c:137 12 -> 5 80.906829 0.000000
[Dec 16 16:16:14.740] mgos_pppos.c:137 5 -> 6 80.915198 0.000000
[Dec 16 16:16:14.755] mgos_pppos.c:137 6 -> 7 80.929560 0.000000
[Dec 16 16:16:14.768] mgos_pppos.c:664 Connecting (UART1, APN 'iot.1nce.net')...
[Dec 16 16:16:14.776] mgos_pppos.c:696 Trying to connect to 26201,Telekom.de 1nce.net
[Dec 16 16:16:14.789] mgos_pppos.c:137 7 -> 8 80.964475 0.000000
[Dec 16 16:16:14.798] mgos_pppos.c:127 >> AT
[Dec 16 16:16:14.798] mgos_pppos.c:137 8 -> 9 80.975913 82.973014
[Dec 16 16:16:14.804] mgos_net.c:86 PPP: connecting
[Dec 16 16:16:14.818] Net event: 1313166337
[Dec 16 16:16:14.818] mgos_event.c:135 ev NET1 triggered 3 handlers
[Dec 16 16:16:14.844] mgos_pppos.c:137 9 -> 8 81.018420 0.000000
[Dec 16 16:16:14.919] mgos_pppos.c:127 >> ATH
[Dec 16 16:16:14.919] mgos_pppos.c:137 8 -> 9 81.096927 83.093935
[Dec 16 16:16:14.945] mgos_pppos.c:137 9 -> 8 81.120135 0.000000
[Dec 16 16:16:14.998] mgos_pppos.c:127 >> ATE0
[Dec 16 16:16:15.001] mgos_pppos.c:137 8 -> 9 81.175717 83.172649
[Dec 16 16:16:15.024] mgos_pppos.c:137 9 -> 8 81.198834 0.000000
[Dec 16 16:16:15.119] mgos_pppos.c:127 >> AT+CFUN=0
[Dec 16 16:16:15.122] mgos_pppos.c:137 8 -> 9 81.297196 83.293697
[Dec 16 16:16:15.701] mgos_pppos.c:137 9 -> 8 81.876122 0.000000
[Dec 16 16:16:15.798] mgos_pppos.c:127 >> AT+CFUN=1
[Dec 16 16:16:15.802] mgos_pppos.c:137 8 -> 9 81.976966 83.973459
[Dec 16 16:16:16.075] mgos_pppos.c:137 9 -> 8 82.249952 0.000000
[Dec 16 16:16:16.139] mgos_pppos.c:127 >> ATI
[Dec 16 16:16:16.139] mgos_pppos.c:137 8 -> 9 82.316925 84.313935
[Dec 16 16:16:16.166] mgos_pppos.c:137 9 -> 8 82.340471 0.000000
[Dec 16 16:16:16.702] mgos_pppos.c:127 >> AT+GSN
[Dec 16 16:16:16.705] mgos_pppos.c:137 8 -> 9 82.880323 84.877044
[Dec 16 16:16:16.724] mgos_pppos.c:279 SIM7000E R1351, IMEI: 865234032678814
[Dec 16 16:16:16.736] mgos_pppos.c:137 9 -> 8 82.910973 0.000000
[Dec 16 16:16:16.809] mgos_pppos.c:127 >> AT+CIMI
[Dec 16 16:16:16.812] mgos_pppos.c:137 8 -> 9 82.987113 84.983776
[Dec 16 16:16:16.835] mgos_pppos.c:137 9 -> 8 83.009969 0.000000
[Dec 16 16:16:16.839] main.c:25 Tick uptime: 83.01, RAM: 4511380, 4325552 free
[Dec 16 16:16:16.909] mgos_pppos.c:127 >> AT+CCID
[Dec 16 16:16:16.912] mgos_pppos.c:137 8 -> 9 83.086796 85.083459
[Dec 16 16:16:16.935] mgos_pppos.c:137 9 -> 8 83.110022 0.000000
[Dec 16 16:16:17.009] mgos_pppos.c:127 >> AT+CPIN?
[Dec 16 16:16:17.012] mgos_pppos.c:137 8 -> 9 83.187240 85.183831
[Dec 16 16:16:17.036] mgos_pppos.c:349 SIM is ready, IMSI: 901405102309107, ICCID: 89882280666023091071
[Dec 16 16:16:17.043] mgos_event.c:135 ev PoS2 triggered 0 handlers
[Dec 16 16:16:17.049] mgos_pppos.c:137 9 -> 8 83.224733 0.000000
[Dec 16 16:16:17.109] mgos_pppos.c:127 >> AT+CREG=0
[Dec 16 16:16:17.112] mgos_pppos.c:137 8 -> 9 83.287446 85.283924
[Dec 16 16:16:17.136] mgos_pppos.c:137 9 -> 8 83.310639 0.000000
[Dec 16 16:16:17.195] mgos_pppos.c:127 >> AT+COPS=4,2,"26201"
[Dec 16 16:16:17.198] mgos_pppos.c:137 8 -> 9 83.374231 143.369853
[Dec 16 16:16:17.945] mgos_pppos.c:137 9 -> 8 84.119341 0.000000
[Dec 16 16:16:17.999] mgos_pppos.c:127 >> AT+CREG?
[Dec 16 16:16:18.002] mgos_pppos.c:137 8 -> 9 84.177352 86.173935
[Dec 16 16:16:18.026] mgos_pppos.c:405 Connected to mobile network (roaming)
[Dec 16 16:16:18.030] mgos_pppos.c:137 9 -> 8 84.207547 0.000000
[Dec 16 16:16:18.098] mgos_pppos.c:127 >> AT+COPS=3,2
[Dec 16 16:16:18.102] mgos_pppos.c:137 8 -> 9 84.277192 86.273504
[Dec 16 16:16:18.125] mgos_pppos.c:137 9 -> 8 84.299979 0.000000
[Dec 16 16:16:18.199] mgos_pppos.c:127 >> AT+COPS?
[Dec 16 16:16:18.202] mgos_pppos.c:137 8 -> 9 84.376956 86.373541
[Dec 16 16:16:18.711] mgos_pppos.c:137 9 -> 8 84.885599 0.000000
[Dec 16 16:16:18.733] init.js:57 Solar state:
[Dec 16 16:16:18.761] init.js:58 {"LONG":"700","BMV":"700","SOC":1000,"CE":"0","I":"0","V":26.200000,"PID":"0x203"}
[Dec 16 16:16:18.808] mgos_pppos.c:127 >> AT+COPS=3,0
[Dec 16 16:16:18.811] mgos_pppos.c:137 8 -> 9 84.986611 86.982911
[Dec 16 16:16:18.835] mgos_pppos.c:137 9 -> 8 85.009781 0.000000
[Dec 16 16:16:18.899] mgos_pppos.c:127 >> AT+COPS?
[Dec 16 16:16:18.902] mgos_pppos.c:137 8 -> 9 85.077337 87.073920
[Dec 16 16:16:18.926] mgos_pppos.c:456 Operator: 26201,Telekom.de 1nce.net
[Dec 16 16:16:18.930] mgos_pppos.c:137 9 -> 8 85.107648 0.000000
[Dec 16 16:16:18.999] mgos_pppos.c:127 >> AT+CSQ
[Dec 16 16:16:19.002] mgos_pppos.c:137 8 -> 9 85.177001 87.173739
[Dec 16 16:16:19.025] mgos_pppos.c:137 9 -> 8 85.199920 0.000000
[Dec 16 16:16:19.098] mgos_pppos.c:127 >> AT+CGDCONT=1,"IP","iot.1nce.net"
[Dec 16 16:16:19.102] mgos_pppos.c:137 8 -> 9 85.278849 87.273330
[Dec 16 16:16:19.148] mgos_pppos.c:137 9 -> 8 85.322753 0.000000
[Dec 16 16:16:19.199] mgos_pppos.c:127 >> ATDT*99***1#
[Dec 16 16:16:19.202] mgos_pppos.c:137 8 -> 9 85.377407 87.373653
[Dec 16 16:16:19.710] mgos_pppos.c:137 9 -> 10 85.884399 0.000000
[Dec 16 16:16:19.713] mgos_pppos.c:812 Starting PPP, user ''
[Dec 16 16:16:19.721] mgos_pppos.c:137 10 -> 11 85.895970 115.895913
[Dec 16 16:16:19.756] mgos_mongoose.c:66 New heap free LWM: 4314680
[Dec 16 16:16:19.771] mgos_net.c:90 PPP: connected
[Dec 16 16:16:19.783] Net event: 1313166338
[Dec 16 16:16:19.783] mgos_event.c:135 ev NET2 triggered 3 handlers
[Dec 16 16:16:19.801] mgos_mongoose.c:66 New heap free LWM: 4314332
[Dec 16 16:16:19.884] mgos_net.c:102 PPP: ready, IP 10.215.141.1, GW 10.64.64.64, DNS default
[Dec 16 16:16:19.900] Net event: 1313166339
[Dec 16 16:16:19.900] mgos_sntp.c:129 SNTP next query in 962 ms
[Dec 16 16:16:19.906] mgos_mqtt_conn.c:471 MQTT0 connecting to mqtt.ulmernest.de:8883
[Dec 16 16:16:19.921] Sys event: 1297044230
[Dec 16 16:16:19.921] mgos_event.c:135 ev MOS6 triggered 2 handlers
[Dec 16 16:16:19.927] mongoose.c:3145 0x3ffcbdc0 mqtt.ulmernest.de:8883 -,-,ca.pem
[Dec 16 16:16:19.933] mgos_vfs.c:283 ca.pem -> /ca.pem pl 1 -> 1 0x3ffbc428 (refs 1)
[Dec 16 16:16:19.956] mgos_vfs.c:377 open ca.pem 0x0 0x1b6 => 0x3ffbc428 ca.pem 1 => 257 (refs 1)
[Dec 16 16:16:19.962] mgos_vfs.c:410 close 257 => 0x3ffbc428:1 => 0 (refs 0)
[Dec 16 16:16:19.968] mongoose.c:3145 0x3ffcc0e4 udp://8.8.8.8:53 -,-,-
[Dec 16 16:16:19.974] mongoose.c:3013 0x3ffcc0e4 udp://8.8.8.8:53
[Dec 16 16:16:19.980] mgos_rpc_channel_ws:263 0x3ffbccf4 Connecting to wss://mdash.net/api/v2/rpc, SSL? 1
[Dec 16 16:16:19.987] mongoose.c:8604 wss://mdash.net/api/v2/rpc use_ssl? 1 tcp://mdash.net:443
[Dec 16 16:16:19.996] mongoose.c:3145 0x3ffdf2e4 tcp://mdash.net:443 -,-,ca.pem
[Dec 16 16:16:20.002] mgos_vfs.c:283 ca.pem -> /ca.pem pl 1 -> 1 0x3ffbc428 (refs 1)
[Dec 16 16:16:20.008] mgos_vfs.c:377 open ca.pem 0x0 0x1b6 => 0x3ffbc428 ca.pem 1 => 257 (refs 1)
[Dec 16 16:16:20.017] mgos_vfs.c:410 close 257 => 0x3ffbc428:1 => 0 (refs 0)
[Dec 16 16:16:20.023] mongoose.c:3145 0x3ffdff50 udp://8.8.8.8:53 -,-,-
[Dec 16 16:16:20.029] mongoose.c:3013 0x3ffdff50 udp://8.8.8.8:53
[Dec 16 16:16:20.032] mgos_event.c:135 ev NET3 triggered 4 handlers
[Dec 16 16:16:20.049] mongoose.c:3028 0x3ffcc0e4 udp://8.8.8.8:53 -> 0
[Dec 16 16:16:20.052] mongoose.c:3028 0x3ffdff50 udp://8.8.8.8:53 -> 0
[Dec 16 16:16:20.059] mgos_mongoose.c:66 New heap free LWM: 4310972
[Dec 16 16:16:20.700] mgos_mongoose.c:66 New heap free LWM: 4309568
[Dec 16 16:16:20.870] mongoose.c:3145 0x3ffcbd18 udp://time.google.com:123 -,-,-
[Dec 16 16:16:20.876] mongoose.c:3145 0x3ffe30b8 udp://8.8.8.8:53 -,-,-
[Dec 16 16:16:20.879] mongoose.c:3013 0x3ffe30b8 udp://8.8.8.8:53
[Dec 16 16:16:20.885] mgos_sntp.c:96 SNTP query to time.google.com
[Dec 16 16:16:20.892] mgos_sntp.c:129 SNTP next query in 1897 ms
[Dec 16 16:16:20.906] mongoose.c:3028 0x3ffe30b8 udp://8.8.8.8:53 -> 0
[Dec 16 16:16:21.010] mgos_mongoose.c:66 New heap free LWM: 4308504
[Dec 16 16:16:21.026] mongoose.c:3013 0x3ffcbd18 udp://216.239.35.0:123
[Dec 16 16:16:21.029] mongoose.c:3028 0x3ffcbd18 udp://216.239.35.0:123 -> 0
[Dec 16 16:16:21.035] mgos_sntp.c:48 SNTP sent query to 216.239.35.0
[Dec 16 16:16:21.042] mgos_mongoose.c:66 New heap free LWM: 4308396
[Dec 16 16:16:21.193] mgos_sntp.c:59 SNTP reply from 216.239.35.0: time 1639667781.675384, local 87.371710, delta 1639667694.303674
[Dec 16 16:16:21.212] Sys event: 1297044227
[Dec 16 16:16:21.212] mgos_event.c:135 ev MOS3 triggered 4 handlers
[Dec 16 16:16:21.218] mgos_sntp.c:79 SNTP close
[Dec 16 16:16:21.221] mgos_sntp.c:129 SNTP next query in 6881684 ms
[Dec 16 16:16:21.228] mgos_mongoose.c:66 New heap free LWM: 4306864
[Dec 16 16:16:21.820] mongoose.c:3013 0x3ffdf2e4 tcp://157.90.34.55:443
[Dec 16 16:16:21.837] mongoose.c:3013 0x3ffcbdc0 tcp://18.158.254.200:8883
[Dec 16 16:16:21.908] mongoose.c:3028 0x3ffdf2e4 tcp://157.90.34.55:443 -> 0
[Dec 16 16:16:21.948] mongoose.c:3028 0x3ffcbdc0 tcp://18.158.254.200:8883 -> 0
[Dec 16 16:16:21.962] mgos_mongoose.c:66 New heap free LWM: 4305340
[Dec 16 16:16:22.973] mgos_mongoose.c:66 New heap free LWM: 4303816
[Dec 16 16:16:26.952] main.c:25 Tock uptime: 93.13, RAM: 4511232, 4313880 free
[Dec 16 16:16:36.851] main.c:25 Tick uptime: 103.02, RAM: 4511248, 4315436 free
[Dec 16 16:16:38.712] init.js:45 MQTT state:false
[Dec 16 16:16:46.851] main.c:25 Tock uptime: 113.02, RAM: 4511252, 4315440 free
[Dec 16 16:16:56.978] main.c:25 Tick uptime: 123.15, RAM: 4511248, 4315436 free
[Dec 16 16:17:06.851] main.c:25 Tock uptime: 133.02, RAM: 4511248, 4315452 free
[Dec 16 16:17:08.711] init.js:45 MQTT state:false
[Dec 16 16:17:16.851] main.c:25 Tick uptime: 143.02, RAM: 4511252, 4315440 free
[Dec 16 16:17:26.948] main.c:25 Tock uptime: 153.12, RAM: 4511240, 4313904 free
[Dec 16 16:17:36.851] main.c:25 Tick uptime: 163.02, RAM: 4511256, 4315460 free
[Dec 16 16:17:38.711] init.js:45 MQTT state:false
[Dec 16 16:17:46.851] main.c:25 Tock uptime: 173.02, RAM: 4511256, 4315460 free
[Dec 16 16:17:56.947] main.c:25 Tick uptime: 183.12, RAM: 4511252, 4315456 free
[Dec 16 16:18:06.851] main.c:25 Tock uptime: 193.03, RAM: 4511256, 4315460 free
[Dec 16 16:18:08.710] init.js:45 MQTT state:false
[Dec 16 16:18:16.852] main.c:25 Tick uptime: 203.02, RAM: 4511256, 4315460 free
[Dec 16 16:18:26.947] main.c:25 Tock uptime: 213.12, RAM: 4511252, 4315456 free
- My question is: How do I debug this? Obviously the connection is being made successfully, also I can see in the backend of my provider that the SIM has successfully established the connection and got an IP (the same as in the logs). So my initial, naive assumption would be that something in the lower levels of mgos (or even outside of it) like LwIP or esp-idf are failing to make that connection usable to the system and/or mgos. What would be the way to verify this?
On a side note: To rule out modem/provider issues, I connected the modem to a linux VM, and had pppd / pon / poff establish a connection with the same settings (APN, also I checked the AT command sequences to be equivalent). Here, the connection was successful as well (with the same IP), but I was also able to run any kind of traffic over the interface. So I’d guess it’s either not related to modem and/or provider, or there’s some small detail that I’m missing that’s different between mgos pppos and pppd.
Thanks in advance!