Der Test-sketch unter test-sketches/test_tinygsm-lib_with_ttgo-t-call-sim800c at main · ClemensGruber/test-sketches · benötigt im Schnitt etwa 32 Sekunden mit angeschaltetem debug auf der Seriellen. Aber auch mal 50 Sekunden (mit ca. 10 Durchläufen getestet).
Hier die gesamte debug-Ausgabe für einen Durchgang:
22:57:55.367 -> ets Jun 8 2016 00:22:57
22:57:55.367 ->
22:57:55.367 -> rst:0x5 (DEEPSLEEP_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
22:57:55.367 -> configsip: 0, SPIWP:0xee
22:57:55.367 -> clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
22:57:55.367 -> mode:DIO, clock div:1
22:57:55.367 -> load:0x3fff0018,len:4
22:57:55.367 -> load:0x3fff001c,len:1216
22:57:55.367 -> ho 0 tail 12 room 4
22:57:55.367 -> load:0x40078000,len:10944
22:57:55.367 -> load:0x40080400,len:6388
22:57:55.367 -> entry 0x400806b4
22:57:55.546 -> VBUS:4960.60 mV 0.00 mA ,BATTERY: 0.00
22:57:56.616 -> Initializing modem...
22:57:56.616 -> AT
22:57:56.916 -> AT
22:57:57.218 -> AT
22:57:57.548 -> AT
22:57:57.817 -> AT
22:57:58.118 -> AT
22:57:58.418 -> AT
22:57:58.718 -> AT
22:57:59.019 -> AT
22:57:59.319 -> AT
22:57:59.636 -> AT
22:57:59.921 -> AT
22:57:59.921 -> ⸮AT
22:58:00.507 -> AT
22:58:00.823 -> AT
22:58:01.123 -> AT
22:58:01.424 -> AT
22:58:01.724 -> AT
22:58:01.824 -> ⸮AT
22:58:02.009 ->
22:58:02.009 -> OK
22:58:02.009 -> AT&W
22:58:02.056 ->
22:58:02.056 -> OK
22:58:02.056 -> AT+CFUN=0
22:58:02.056 ->
22:58:02.056 -> OK
22:58:02.056 -> AT+CFUN=1,1
22:58:02.056 ->
22:58:02.056 -> OK
22:58:05.052 -> [9569] ### TinyGSM Version: 0.10.9
22:58:05.052 -> [9569] ### TinyGSM Compiled Module: TinyGsmClientSIM800
22:58:05.052 -> AT
22:58:05.353 -> AT
22:58:05.654 -> AT
22:58:05.954 -> AT
22:58:06.254 -> AT
22:58:06.254 -> ⸮⸮AT
22:58:06.534 -> ⸮AT
22:58:07.156 -> AT
22:58:07.449 -> AT
22:58:07.757 -> AT
22:58:08.057 -> AT
22:58:08.204 -> ⸮AT
22:58:08.357 ->
22:58:08.357 -> OK
22:58:08.357 -> ATE0
22:58:08.357 ->
22:58:08.357 -> OK
22:58:08.357 -> AT+CMEE=2
22:58:08.357 ->
22:58:08.357 -> OK
22:58:08.357 -> AT+GMM
22:58:08.357 ->
22:58:08.357 -> SIMCOM_SIM800C
22:58:08.357 ->
22:58:08.357 -> OK
22:58:08.357 -> [12870] ### Modem: SIMCOM SIM800C
22:58:08.357 -> [12870] ### Modem: SIMCOM SIM800C
22:58:08.357 -> AT+CLTS=1
22:58:08.357 ->
22:58:08.357 -> OK
22:58:08.357 -> AT+CBATCHK=1
22:58:08.357 ->
22:58:08.357 -> OK
22:58:08.357 -> AT+CPIN?
22:58:08.357 ->
22:58:08.357 -> +CME ERROR: CFUN state is 0 or 4
22:58:09.359 -> AT+CPIN?
22:58:09.359 ->
22:58:09.359 -> RDY
22:58:09.359 ->
22:58:09.359 -> +CFUN: 1
22:58:09.359 ->
22:58:09.359 -> +CME ERROR: SIM busy
22:58:10.360 -> AT+CPIN?
22:58:10.360 ->
22:58:10.360 -> +CPIN: READY
22:58:10.360 ->
22:58:10.360 -> +CPIN: READY
22:58:10.360 ->
22:58:10.360 -> OK
22:58:10.360 -> Turning on SIM800 Red LED...
22:58:10.360 -> AT+CNETLIGHT=1
22:58:10.360 -> Waiting for network...AT+CREG?
22:58:10.360 ->
22:58:10.360 -> OK
22:58:10.576 ->
22:58:10.576 -> Call Ready
22:58:10.576 ->
22:58:10.576 -> +CREG: 0,2
22:58:10.576 ->
22:58:10.576 -> OK
22:58:10.861 -> AT+CREG?
22:58:10.861 ->
22:58:10.861 -> +CREG: 0,2
22:58:10.861 ->
22:58:10.861 -> OK
22:58:11.108 -> AT+CREG?
22:58:11.108 ->
22:58:11.108 -> +CREG: 0,2
22:58:11.108 ->
22:58:11.108 -> OK
22:58:11.361 -> AT+CREG?
22:58:11.361 ->
22:58:11.361 -> SMS Ready
22:58:11.361 ->
22:58:11.361 -> +CREG: 0,2
22:58:11.361 ->
22:58:11.361 -> OK
22:58:11.624 -> AT+CREG?
22:58:11.624 ->
22:58:11.624 -> +CREG: 0,2
22:58:11.624 ->
22:58:11.624 -> OK
22:58:11.862 -> AT+CREG?
22:58:11.862 ->
22:58:11.862 -> +CREG: 0,2
22:58:11.862 ->
22:58:11.862 -> OK
22:58:12.109 -> AT+CREG?
22:58:12.109 ->
22:58:12.109 -> +CREG: 0,2
22:58:12.109 ->
22:58:12.109 -> OK
22:58:12.363 -> AT+CREG?
22:58:12.363 ->
22:58:12.363 -> +CREG: 0,2
22:58:12.363 ->
22:58:12.363 -> OK
22:58:12.626 -> AT+CREG?
22:58:12.626 ->
22:58:12.626 -> +CREG: 0,2
22:58:12.626 ->
22:58:12.626 -> OK
22:58:12.864 -> AT+CREG?
22:58:12.864 ->
22:58:12.864 -> +CREG: 0,2
22:58:12.864 ->
22:58:12.864 -> OK
22:58:13.111 -> AT+CREG?
22:58:13.111 ->
22:58:13.111 -> +CREG: 0,2
22:58:13.111 ->
22:58:13.111 -> OK
22:58:13.365 -> AT+CREG?
22:58:13.365 ->
22:58:13.365 -> +CREG: 0,2
22:58:13.365 ->
22:58:13.365 -> OK
22:58:13.628 -> AT+CREG?
22:58:13.628 ->
22:58:13.628 -> +CREG: 0,2
22:58:13.628 ->
22:58:13.628 -> OK
22:58:13.866 -> AT+CREG?
22:58:13.913 ->
22:58:13.913 -> +CREG: 0,2
22:58:13.913 ->
22:58:13.913 -> OK
22:58:14.166 -> AT+CREG?
22:58:14.166 ->
22:58:14.166 -> +CREG: 0,2
22:58:14.166 ->
22:58:14.166 -> OK
22:58:14.413 -> AT+CREG?
22:58:14.413 ->
22:58:14.413 -> +CREG: 0,2
22:58:14.413 ->
22:58:14.413 -> OK
22:58:14.629 -> AT+CREG?
22:58:14.629 ->
22:58:14.629 -> +CREG: 0,2
22:58:14.629 ->
22:58:14.629 -> OK
22:58:14.914 -> AT+CREG?
22:58:14.914 ->
22:58:14.914 -> +CREG: 0,2
22:58:14.914 ->
22:58:14.914 -> OK
22:58:15.168 -> AT+CREG?
22:58:15.168 ->
22:58:15.168 -> +CREG: 0,2
22:58:15.168 ->
22:58:15.168 -> OK
22:58:15.415 -> AT+CREG?
22:58:15.415 ->
22:58:15.415 -> +CREG: 0,2
22:58:15.415 ->
22:58:15.415 -> OK
22:58:15.669 -> AT+CREG?
22:58:15.669 ->
22:58:15.669 -> +CREG: 0,2
22:58:15.669 ->
22:58:15.669 -> OK
22:58:15.916 -> AT+CREG?
22:58:15.916 ->
22:58:15.916 -> +CREG: 0,2
22:58:15.916 ->
22:58:15.916 -> OK
22:58:16.169 -> AT+CREG?
22:58:16.169 ->
22:58:16.169 -> +CREG: 0,2
22:58:16.169 ->
22:58:16.169 -> OK
22:58:16.416 -> AT+CREG?
22:58:16.416 ->
22:58:16.416 -> +CREG: 0,2
22:58:16.416 ->
22:58:16.416 -> OK
22:58:16.670 -> AT+CREG?
22:58:16.670 ->
22:58:16.670 -> +CREG: 0,2
22:58:16.670 ->
22:58:16.670 -> OK
22:58:16.917 -> AT+CREG?
22:58:16.917 ->
22:58:16.917 -> +CREG: 0,2
22:58:16.917 ->
22:58:16.917 -> OK
22:58:17.171 -> AT+CREG?
22:58:17.171 ->
22:58:17.171 -> +CREG: 0,2
22:58:17.171 ->
22:58:17.171 -> OK
22:58:17.464 -> AT+CREG?
22:58:17.464 ->
22:58:17.464 -> +CREG: 0,2
22:58:17.464 ->
22:58:17.464 -> OK
22:58:17.687 -> AT+CREG?
22:58:17.687 ->
22:58:17.687 -> +CREG: 0,5
22:58:17.687 ->
22:58:17.687 -> OK
22:58:17.687 -> OK
22:58:17.687 -> AT+CREG?
22:58:17.734 ->
22:58:17.734 -> +CREG: 0,5
22:58:17.734 ->
22:58:17.734 -> OK
22:58:17.734 -> Connected to mobile network
22:58:17.734 -> Connecting to APN: iot.1nce.netAT+CIPSHUT
22:58:17.734 ->
22:58:17.734 -> SHUT OK
22:58:17.734 -> AT+CGATT=0
22:58:17.734 ->
22:58:17.734 -> OK
22:58:17.734 -> AT+SAPBR=3,1,"Contype","GPRS"
22:58:17.734 ->
22:58:17.734 -> OK
22:58:17.734 -> AT+SAPBR=3,1,"APN","iot.1nce.net"
22:58:17.734 ->
22:58:17.734 -> OK
22:58:17.734 -> AT+CGDCONT=1,"IP","iot.1nce.net"
22:58:17.819 ->
22:58:17.819 -> OK
22:58:17.819 -> AT+CGACT=1,1
22:58:18.172 ->
22:58:18.172 -> *PSUTTZ: 2021,8,26,20,58,17,"+8",1
22:58:18.172 -> [22671] ### Network time and time zone updated.
22:58:18.172 ->
22:58:18.172 -> DST: 1
22:58:18.172 -> [22672] ### Daylight savings time state updated.
22:58:18.172 ->
22:58:18.172 -> +CIEV: 10,"26203","o2 - de","o2 - de", 0, 0
22:58:23.283 ->
22:58:23.283 -> +CTZV: +8,1
22:58:23.283 -> [27789] ### Network time zone updated.
22:58:23.283 ->
22:58:23.283 -> *PSUTTZ: 2021,8,26,20,58,23,"+8",1
22:58:23.283 -> [27800] ### Network time and time zone updated.
22:58:23.283 ->
22:58:23.283 -> DST: 1
22:58:23.283 -> [27801] ### Daylight savings time state updated.
22:58:23.684 ->
22:58:23.684 -> OK
22:58:23.684 -> AT+SAPBR=1,1
22:58:23.984 ->
22:58:23.984 -> OK
22:58:23.984 -> AT+SAPBR=2,1
22:58:23.984 ->
22:58:23.984 -> +SAPBR: 1,1,"100.125.18.1"
22:58:23.984 ->
22:58:23.984 -> OK
22:58:23.984 -> AT+CGATT=1
22:58:23.984 ->
22:58:23.984 -> OK
22:58:23.984 -> AT+CIPMUX=1
22:58:23.984 ->
22:58:23.984 -> OK
22:58:23.984 -> AT+CIPQSEND=1
22:58:23.984 ->
22:58:23.984 -> OK
22:58:23.984 -> AT+CIPRXGET=1
22:58:23.984 ->
22:58:23.984 -> OK
22:58:23.984 -> AT+CSTT="iot.1nce.net","",""
22:58:24.031 ->
22:58:24.031 -> OK
22:58:24.031 -> AT+CIICR
22:58:24.031 ->
22:58:24.031 -> OK
22:58:24.031 -> AT+CIFSR;E0
22:58:24.031 ->
22:58:24.031 -> 100.125.18.1
22:58:24.031 ->
22:58:24.031 -> OK
22:58:24.031 -> AT+CDNSCFG="8.8.8.8","8.8.4.4"
22:58:24.031 ->
22:58:24.031 -> OK
22:58:24.031 -> OK
22:58:24.031 -> Connecting to open-hive.org
22:58:24.031 -> AT+CIPCLOSE=0,1
22:58:24.031 ->
22:58:24.031 -> +CME ERROR: operation not allowed
22:58:24.031 -> AT+CIPSSL=0
22:58:24.031 ->
22:58:24.031 -> OK
22:58:24.031 -> AT+CIPSTART=0,"TCP","open-hive.org",80
22:58:24.031 ->
22:58:24.031 -> OK
22:58:24.748 ->
22:58:24.748 -> 0, CONNECT OK
22:58:24.748 -> OK
22:58:24.748 -> Read sensors:
22:58:24.886 -> basic battery lavel: 0.00
22:58:24.886 -> /apiary/upload.php?user=[your-user-name]&id=[your-id]&node=10&dataset=timestamp-by-server,0.00
22:58:24.886 -> Performing HTTP GET request...
22:58:24.886 -> AT+CIPSEND=0,102
22:58:24.886 ->
22:58:24.886 -> >GET /apiary/upload.php?user=[your-user-name]&id=[your-id]&node=10&dataset=timestamp-by-server,0.00 HTTP/1.1
22:58:24.886 ->
22:58:24.886 -> DATA ACCEPT:0,102
22:58:24.886 -> AT+CIPSEND=0,21
22:58:24.886 ->
22:58:24.886 -> >Host: open-hive.org
22:58:24.886 ->
22:58:24.886 -> DATA ACCEPT:0,21
22:58:24.886 -> AT+CIPSEND=0,21
22:58:24.886 ->
22:58:24.886 -> >Connection: close
22:58:24.886 ->
22:58:24.886 ->
22:58:24.886 -> DATA ACCEPT:0,21
22:58:24.886 -> AT+CIPSEND=0,2
22:58:24.886 ->
22:58:24.886 -> >
22:58:24.886 ->
22:58:24.886 -> DATA ACCEPT:0,2
22:58:24.886 -> AT+CIPRXGET=4,0
22:58:24.886 ->
22:58:24.886 -> +CIPRXGET: 4,0,0
22:58:24.886 ->
22:58:24.886 -> OK
22:58:24.886 -> AT+CIPSTATUS=0
22:58:24.933 ->
22:58:24.933 -> +CIPSTATUS: 0,0,"TCP","87.230.20.183","80","CONNECTED"
22:58:24.933 ->
22:58:24.933 -> OK
22:58:25.387 -> AT+CIPRXGET=4,0
22:58:25.387 ->
22:58:25.387 -> +CIPRXGET: 4,0,0
22:58:25.387 ->
22:58:25.387 -> OK
22:58:25.387 -> AT+CIPSTATUS=0
22:58:25.434 ->
22:58:25.434 -> +CIPSTATUS: 0,0,"TCP","87.230.20.183","80","CONNECTED"
22:58:25.434 ->
22:58:25.434 -> OK
22:58:25.888 -> AT+CIPRXGET=4,0
22:58:25.888 ->
22:58:25.888 -> +CIPRXGET: 4,0,0
22:58:25.888 ->
22:58:25.888 -> OK
22:58:25.888 -> AT+CIPSTATUS=0
22:58:25.935 ->
22:58:25.935 -> +CIPSTATUS: 0,0,"TCP","87.230.20.183","80","CONNECTED"
22:58:25.935 ->
22:58:25.935 -> OK
22:58:25.935 ->
22:58:25.935 -> +CIPRXGET: 1,0
22:58:25.935 -> AT+CIPRXGET=4,0
22:58:25.935 ->
22:58:25.935 -> +CIPRXGET: 4,0,208
22:58:25.935 ->
22:58:25.935 -> OK
22:58:25.935 -> AT+CIPRXGET=2,0,208
22:58:25.988 ->
22:58:25.988 -> +CIPRXGET: 2,0,208,0
22:58:25.988 -> HTTP/1.1 200 OK
22:58:25.988 -> Date: Thu, 26 Aug 2021 20:58:25 GMT
22:58:25.988 -> Server: Apache
22:58:25.988 -> X-Powered-By: PHP
22:58:25.988 -> Content-Length: 27
22:58:25.988 -> Connection: close
22:58:25.988 -> Content-Type: text/html
22:58:25.988 ->
22:58:25.988 -> ok: open-hive
22:58:25.988 -> ok: hiveeyes
22:58:25.988 ->
22:58:25.988 -> OK
22:58:25.988 -> HTTP/1.1 200 OK
22:58:25.988 -> Date: Thu, 26 Aug 2021 20:58:25 GMT
22:58:25.988 -> Server: Apache
22:58:25.988 -> X-Powered-By: PHP
22:58:25.988 -> Content-Length: 27
22:58:25.988 -> Connection: close
22:58:25.988 -> Content-Type: text/html
22:58:25.988 ->
22:58:25.988 -> ok: open-hive
22:58:25.988 -> ok: hiveeyes
22:58:26.389 -> AT+CIPRXGET=4,0
22:58:26.389 ->
22:58:26.389 -> +CIPRXGET: 4,0,0
22:58:26.389 ->
22:58:26.389 -> OK
22:58:26.389 -> AT+CIPSTATUS=0
22:58:26.436 ->
22:58:26.436 -> +CIPSTATUS: 0,0,"TCP","87.230.20.183","80","REMOTE CLOSING"
22:58:26.436 ->
22:58:26.436 -> OK
22:58:26.436 ->
22:58:26.436 -> AT+CIPCLOSE=0,1
22:58:26.436 ->
22:58:26.436 -> 0, CLOSE OK
22:58:26.436 -> Server disconnected
22:58:26.436 -> AT+CIPSHUT
22:58:26.436 ->
22:58:26.436 -> SHUT OK
22:58:26.436 -> AT+CGATT=0
22:58:26.483 ->
22:58:26.483 -> +SAPBR 1: DEACT
22:58:26.689 ->
22:58:26.689 -> OK
22:58:26.689 -> GPRS disconnected
22:58:26.689 -> AT+CPOWD=1
22:58:27.136 ->
22:58:27.136 -> NORMAL POWER DOWNPoweroff
22:58:27.136 -> Runtime: 31
22:58:27.136 ->
Dabei gibt es noch einige Fehlermeldungen, denen wir uns zuerst widmen sollten. Der erste ist +CME ERROR: CFUN state is 0 or 4
und +CME ERROR: SIM busy
der vermutlich damit zusammen hängt.
AT+CPIN
erwatet vermutlich die Eingabe der SIM-Pin, diese habe bei der verwendeten Karte deaktiviert, und mit
const char simPIN[] = ""; // SIM card PIN code, if any
im code auch nicht spezifiziert.
22:58:08.357 -> AT+CPIN?
22:58:08.357 ->
22:58:08.357 -> +CME ERROR: CFUN state is 0 or 4
22:58:09.359 -> AT+CPIN?
22:58:09.359 ->
22:58:09.359 -> RDY
22:58:09.359 ->
22:58:09.359 -> +CFUN: 1
22:58:09.359 ->
22:58:09.359 -> +CME ERROR: SIM busy
22:58:10.360 -> AT+CPIN?
22:58:10.360 ->
22:58:10.360 -> +CPIN: READY
22:58:10.360 ->
22:58:10.360 -> +CPIN: READY
22:58:10.360 ->
22:58:10.360 -> OK
Die Vergabe einer Pin im code (ohne das bei der SIM-Karte einzurichten) führ übrigens zu dieser Ausgabe:
23:20:53.647 -> AT+CPIN?
23:20:53.647 ->
23:20:53.647 -> +CME ERROR: CFUN state is 0 or 4
23:20:54.649 -> AT+CPIN?
23:20:54.649 ->
23:20:54.649 -> RDY
23:20:54.649 ->
23:20:54.649 -> +CFUN: 1
23:20:54.649 ->
23:20:54.649 -> +CME ERROR: SIM busy
23:20:55.652 -> AT+CPIN?
23:20:55.652 ->
23:20:55.652 -> +CPIN: READY
23:20:55.652 ->
23:20:55.652 -> +CPIN: READY
23:20:55.652 ->
23:20:55.652 -> OK
23:20:55.652 -> Turning on SIM800 Red LED...
23:20:55.652 -> AT+CNETLIGHT=1
23:20:55.652 -> AT+CPIN?
23:20:55.652 ->
23:20:55.652 -> OK
23:20:55.852 ->
23:20:55.852 -> Call Ready
23:20:55.852 ->
23:20:55.852 -> +CPIN: READY
23:20:55.852 ->
23:20:55.852 -> OK
23:20:55.852 -> AT+CPIN="1234"
23:20:55.906 ->
23:20:55.906 -> +CME ERROR: operation not allowed
23:20:55.906 -> Waiting for network...AT+CREG?
23:20:55.906 ->
Mir erschließt sich hier nicht was der Fehler ist, es funktioniert ja dann auch. Ein timing-Problem? Irgend etwas scheint beim Modem noch nicht initialisiert zu sein was es später ist?
16:14:32.631 -> Connecting to open-hive.org
16:14:32.631 -> AT+CIPCLOSE=0,1
16:14:32.631 ->
16:14:32.631 -> +CME ERROR: operation not allowed
16:14:32.631 -> AT+CIPSSL=0
16:14:32.631 ->
16:14:32.631 -> OK
16:14:32.631 -> AT+CIPSTART=0,"TCP","open-hive.org",80
16:14:32.684 ->
16:14:32.684 -> OK
Zu +CME ERROR: operation not allowed
habe ich das gefunden: Web client can't connect to the sample webside (AT+CIPCLOSE=0,1 +CME ERROR: operation not allowed). · Issue #466 · vshymanskyy/TinyGSM · GitHub auch da ist es bei mir so, dass die connection ja doch funktioniert, nur nicht gleich, beim bug-report wird empfohlen ein delay von 10 Sekunden einzubauen, was low power mäßig keine gute Idee ist. So lassen wie es ist?