A6 GSM Modem - At Befehle für SMS empfang

OP #5179660
Lesenswert?

Hallo, ich beiße mir seit einigen Tagen die Zähne an diesem Modem aus.
Senden klappt und auch andere Funktionen, nur mit dem empfangen hab ich 
einfach keinen Erfolg. Hat jemand damit Erfahrung?

Here are my AT Commands (maybe someone has same expirences)

Issuing command: AT&F
REPLY:
OK
Reply in 56ms. Reply OK. <
OK
>
Issuing command: ATE0
REPLY: ATE0Å
OK
Reply in 55ms. Reply OK. <ATE0Å
OK
>
Issuing command: AT+CLIP=1
REPLY:
OK
⸮
Reply in 1055ms. Reply OK. <
OK
⸮>
Issuing command: AT+CMGF=1
REPLY:
OK
Reply in 55ms. Reply OK. <
OK
>
Issuing command: AT+CNMI=1,0
REPLY:
OK
Reply in 144ms. Reply OK. <
OK
>
Issuing command: AT+CPMS=ME,ME,ME
REPLY:
+CPMS: 21,2521,25,1,25
Reply in 202ms. Reply OK. <
+CPMS: 21,2521,25,1,25

OK
>

Issuing command: AT+CSCS="UCS2"
REPLY:
⸮OK
Reply in 56ms. Reply OK. <
⸮OK
>
Issuing command: AT+CSDH=1
REPLY:
OK
Reply in 58ms. Reply OK. <
OK
>

          Waiting for module to be ready...


Issuing command: AT+CMGL="ALL"
REPLY:
+CMGL:1,"REC READ",+4366306",,"2017/10/16,09:10:01+02",J⸮⸮⸮⸮⸮⸮Z⸮
Reply in 173ms. Reply OK. <
+CMGL:1,"REC READ",+4366306800",,"2017/10/16,09:10:01+02",J⸮⸮⸮⸮⸮⸮Z⸮>
OP #5180350
Lesenswert?

Leider klappts immer noch nicht.
Hab das im Manual gefunden

_____________________________________________________________________
 AT Commands and Response Description
AT+CMGF=1 Text mode
OK
AT+CSDH=1 Show the values in result codes
OK
AT+CMGL= " REC UNREAD " Receive unread message
+CMGL: 15,"REC
UNREAD","10658223",,"2008/4/1,10:53:4+32" List unread message
OK
AT+CMGL=”ALL” All message
+CMGL: 2,"STO UNSENT","1365125588"
testing
+CMGL: 3,"STO UNSENT","1365125588"
testing
+CMGL: 4,"STO UNSENT","1365125588"
testing
+CMGL: 5,"STO UNSENT","1365125588"
testing
+CMGL: 13,"REC
READ","13800138000",,"2008/3/28,16:17:18+32"
+CMGL: 14,"REC
READ","13800138000",,"2008/3/28,16:17:17+32"
+CMGL: 15,"REC
UNREAD","10658223",,"2008/4/1,10:53:4+32"
Show all of message
OK

___________________________________________________________________


und umegsetzt:



void loop() {
    int SMSbuffer[30]={0};
    SMSmessage actSMS;

    delay (3000);

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
+++++++++++++++++
 char buffer[20];

  String response;

  String command;
  A6command("AT+CMGF=1", "OK", "yy", A6_CMD_TIMEOUT, 2, NULL);
  A6command("AT+CSDH=1", "OK", "yy", A6_CMD_TIMEOUT, 2, NULL);
  A6command("AT+CMGL=\"ALL\"", "+CMGL", "yy", 15000, 2, &response);
  A6command("AT+CNMI=1,2,0,0,0", "OK", "yy", 5000, 2, NULL);


  A6command("AT+CMGR=1", "OK", "yy", 20000, 2, NULL);

//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 
+++++++++++++++++
  return;
Gast #5180414
Lesenswert?

> Leider klappts immer noch nicht.

Was klappt nicht?
Zeige ein Protokoll der Kommunikation und markiere dort, was Dir nicht 
gefällt. Beschreibe, welches Ergebnis du stattdessen erwartet hast.

Eine Frage zum nachdenken: Wo speichert dein AT+CMGR Kommando seine 
Ausgabe?
OP #5180488
Lesenswert?

Code:
  A6command("AT+CMGF=1", "OK", "yy", A6_CMD_TIMEOUT, 2, NULL);
  A6command("AT+CSDH=1", "OK", "yy", A6_CMD_TIMEOUT, 2, NULL);
  A6command("AT+CMGL=\"ALL\"", "+CMGL", "yy", 15000, 2, &response);
  A6command("AT+CNMI=1,2,0,0,0", "OK", "yy", 5000, 2, NULL);
  A6command("AT+CMGR=1", "OK", "yy", 20000, 2, NULL);

___________________________________________________________________
Ausgabe:

Issuing command: AT+CMGF=1
REPLY:

REPLY:
OK

Reply in 55ms. Reply OK. <
OK
>

Issuing command: AT+CSDH=1
REPLY:

REPLY:
OK

Reply in 54ms. Reply OK. <
OK
>

Issuing command: AT+CMGL="ALL"
REPLY:

REPLY:
+CMGL: 1,"RECREAD",+4366380",,"2017/10/16,09:10:01+02"⸮ZbL⸮⸮⸮⸮z⸮⸮b
6)⸮ʒb
Reply in 192ms. Reply OK. <
+CMGL: 1,"RECREAD",+4343663880",,"2017/10/16,09:10:01+02"⸮ZbL⸮⸮⸮⸮z⸮⸮b
6)⸮ʒb>

Issuing command: AT+CNMI=1,2,0,0,0
REPLY: J
6Ӓj4⸮⸮
REPLY: J
6Ӓj4⸮⸮⸮
⸮⸮⸮zҊ⸮
REPLY: J
6Ӓj4⸮⸮⸮
⸮⸮⸮zҊ⸮
⸮⸮⸮⸮⸮⸮⸮⸮
REPLY: J
6Ӓj4⸮⸮⸮
⸮⸮⸮zҊ⸮
⸮⸮⸮⸮⸮⸮⸮⸮(⸮⸮⸮z⸮⸮
REPLY: J
6Ӓj4⸮⸮⸮
⸮⸮⸮zҊ⸮
⸮⸮⸮⸮⸮⸮⸮⸮(⸮⸮⸮z⸮⸮
1I⸮Z⸮⸮⸮⸮⸮
REPLY: J
6Ӓj4⸮⸮⸮
⸮⸮⸮zҊ⸮
⸮⸮⸮⸮⸮⸮⸮⸮(⸮⸮⸮z⸮⸮
1I⸮Z⸮⸮⸮⸮⸮


REPLY: J
6Ӓj4⸮⸮⸮
⸮⸮⸮zҊ⸮
⸮⸮⸮⸮⸮⸮⸮⸮(⸮⸮⸮z⸮⸮
1I⸮Z⸮⸮⸮⸮⸮

OK

Reply in 356ms. Reply OK. <J
6Ӓj4⸮⸮⸮
⸮⸮⸮zҊ⸮
⸮⸮⸮⸮⸮⸮⸮⸮(⸮⸮⸮z⸮⸮
1I⸮Z⸮⸮⸮⸮⸮

OK
>

Issuing command: AT+CMGR=1
REPLY:
+CMGR: "REC )⸮⸮⸮","+436638⸮800",,"2017/10/16,09:10:01+02"&1,ʢ
REPLY:
+CMGR: "REC )⸮⸮⸮","+436638⸮800",,"2017/10/16,09:10:01+02"&1,ʢ
REPLY:
+CMGR: "REC )⸮⸮⸮","+436638⸮800",,"2017/10/16,09:10:01+02"&1,ʢ
REPLY:
+CMGR: "REC )⸮⸮⸮","+436638⸮800",,"2017/10/16,09:10:01+02"&1,ʢ
REPLY:
Reply in 20303ms. Timed out.
OP #5180492
Lesenswert?

Damit ist nix anzufangen.

Bevorzugter Speicher:

Issuing command: AT+CPMS=ME,ME,ME
REPLY:

REPLY:
+CPS*'⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮j
REPLY:
+CPS*'⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮j

REPLY:
+CPS*'⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮j
OK

Reply in 174ms. Reply OK. <
+CPS*'⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮b⸮⸮j
OK
>
Gast #5180669
Lesenswert?

Es scheint, als ob deine Empfangsroutine durcheinander kommt. Es könnte 
auch an leicht abweichenden Bitraten an der seriellen Schnittstelle 
liegen.

Schließe das Ding mal an deinen PC an und wiederhole die Kommandos in 
einem Terminalprogramm. Empfängt dieses den selben Käse?
Gast #5181181
Lesenswert?

> ich denke

Genügt offensichtlich nicht. Überlege Dir, wie du das Problem gezielt 
einkreisen kannst.

Du hast ein Modem, bei dem Du noch nicht sicher weist, dass es in 
Ordnung ist. Teste es mit einem Computer und einem Adapter der erprobt 
ist also ganz sicher nicht defekt und mit einem Programm das ebenfalls 
erprobt ist.

Du hast eine serielle Kommunikation, die wahrscheinlich nicht korrekt 
funktioniert. Hinterfrage, ob das Modem was falsches sendet oder ob dein 
µC falsch empfängt.

Du hast ein teilweise selbst geschriebenes Programm, das möglicherweise 
fehlerhaft ist (oder die verwendete Library). Tausche dieses also gegen 
ein minimales Programm aus, dem du trauen kannst bzw. das du untersuchen 
kannst. Dazu brauchst du vielleicht einen Debugger, ein bis zwei weitere 
USB-UART Adapter oder einen Logicanalyzer.
OP #5181448
Lesenswert?

wenn ich mir die Reply´s ansehe, ist die Kommunikation und auch die Art, 
wie ich Befehle sende ja in Ordnung:

Issuing command: AT+CMGF=1
REPLY:
REPLY:
OK
Reply in 64ms. Reply OK. <OK>

Issuing command: AT+CSDH=1
REPLY:
REPLY:
OK
Reply in 66ms. Reply OK. <OK>

Issuing command: AT+CMGL=?
REPLY:
REPLY:
+CMGL: ("REC UNREAD","REC READ","STO UNSENT","STO SENT","ALL")
Reply in 136ms. Reply OK. <+CMGL: ("REC UNREAD","REC READ","STO 
NSENT","STO SENT","ALL")>

Issuing command: AT+CNMI?
REPLY:
REPLY:
OK
Reply in 13ms. Reply OK. <OK>

Issuing command: AT+CNMI=0,2,0,1,0
REPLY:
REPLY: +CNMI: 0,2,0,1,0
REPLY: +CNMI: 0,2,0,1,0
REPLY: +CNMI: 0,2,0,1,0
OK

Reply in 80ms. Reply OK. <+CNMI: 0,2,0,1,0OK>

Issuing command: AT+CMGL="ALL"
REPLY:
REPLY: OK
REPLY: OK
REPLY: OKOK
REPLY: OKOK

Reply in 5063ms. Timed out.
______________________________________________________
REPLY ist was ich empfange. Somit klappen die Kommunikation und die 
Befehlesform. und wie gesagt - senden ist auch kein Problem..
_________________________________________________________
gerade mal beim Issuing command: AT+CMGL="ALL"
habe ich das Problem, nur ein OK zu erhalten....
Gast #5181453
Lesenswert?

> wenn ich mir die Reply´s ansehe, ist die Kommunikation und auch die Art,
> wie ich Befehle sende ja in Ordnung

Das sehe ich auch so. Aber irgendwann empfängst Müll. Zum beispiel die 
vielen OK's am Ende oder bei deinem vorherigen Protokoll die unlesbaren 
zeichen.

Aber immerhin reagiert das Modem und antwortet mit OK, also empfängt es 
wohl die Kommandos. Konzentriere dich daher auch die Leitung und 
Programmteile, welche die Antworten empfangen.
OP #5181631
Lesenswert?

Mal klappt die Antwort vom Modul nun, mal nicht. Es kann an den 
Leitungen liegen, oder aber an den Anschlüßen. Leider hab ich keine 
ahnung was ich machen kann, ausser die leitungen zu verdrillen und alle 
gegen GND zu schließen was nötig ist.
Merkwürdig nur, dass nach dem abhängen der versorgung über GND vom 
Controller Restspannung kommt. (Power Led am GSM Modul leuchtet schwach 
weiter).

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren