I have a Sim900 module model s2-1040s-z1k18 and an Arduino Mega 2560. I need to know the rest of the current package. The answer comes in the form of SMS. I have this code:
void setup()
{
Serial.begin(57600);
Serial1.begin(57600);
}
void loop()
{
delay(100);
while(Serial.available())
{
Serial1.write(Serial.read());
}
while(Serial1.available())
{
Serial.write(Serial1.read());
}
}
In the port monitor I specify commands like this
AT
OK
AT+CMGF=1
OK
AT+CUSD=1,"*106#" // find out the rest of the package from beeline
OK
+CUSD: 0,"04120430044800345660430043F0440043E345500200432002
I also tested the command
AT+CMGL="REC UNREAD"
+CMGL: 4,"REC UNREAD","BeeInfo","","22/07/27,20:49:06+24"
00200432342CDC0435043D002343C0438043D002
How do I decrypt the character set data? In all examples in which such methods were specified, the text was returned as text, not as a set of characters. Or how else can I find out the rest of the package? I will need to use this data in the further code of the program.
Addition
I tried this type of command
AT+CMGF=0
OK
AT+CMGL=1
+CMGL: 1,1,"",159
07917750000022F1600DD0C27239E936BF010008227072029
+CMGL: 3,1,"",159
07917750000022F1600DD0C27239E936BF01000822002E00200418043D0444043E003A002
0003600360036003800200438043B0438002022F1600DD0C27239E936BF0100082270721230
944288050003C203020440044304,"",156
07917750000022F1600DD0C27239E936BF01000822707202757042880543B044C043C043E04
32002C002004410435044004380430043B043E043200200441
I tried to decode it with the Online SMS PDU Decoder, but in the Message category: 쁃 쀂D၃偄C聃C끃 DĀ I am getting strange characters
Addition
As it turns out, delay is unnecessary in this code. However, I still get what appears to be an incomplete message. If you read everything and decrypt it one by one, you can collect the complete message. But how to get complete information and preferably in plain text?
AT+CMGF=0
OK AT+CMGL=4
+CMGL: 1,1,"",159 07917750000022F1600DD0C27239E936BF010008227072029460428B0608044C6E0402041804220020043D04300020041A04300437043D043504420020002B00200031003304130411002C0020043104350437043B0438043C0020043D04300020004200650065006C0069006E0065002C00200031003500300020043C0438043D0020043D0430002004340440002E0020043C043E0431002E0020043F043E00200420041A002C
+CMGL: 2,1,"",91 07917750000022F1600DD0C27239E936BF01000822707202946042470608044C6E04040442043E0432003A0020002A003100300036002300200438043B043800A000680074007400700073003A002F002F006200650065002E00670067002F004D0042
+CMGL: 3,1,"",159 07917750000022F1600DD0C27239E936BF010008227072029460428B0608044C6E0401041E0442043B04380447043D044B043900200432044B0431043E0440002100200423002004120430044100200442043004400438044400200022041204410451002004210443043F0435044000210022002E002004220435043F04350440044C0020044300200412043004410020043504410442044C0020041104150417041B0418041C
+CMGL: 4,1,"",159 07917750000022F1640DD0C27239E936BF010008227072029460428B0608044C6E04030020043E0431043C0435043D0020043C0438043D0020043D0430002004130411002E00200418043D0444043E003A0020003600360036003800200438043B0438002000680074007400700073003A002F002F006200650065002E00670067002F006D0079007400720020041F0440043E043204350440043A04300020043F0430043A0435
+CMGL: 5,1,"",156 07917750000022F1600DD0C27239E936BF0100082270721230444288050003C20301041204300448002004410447045104420020043F043E043F043E043B043D0435043D0020043D043000200031003000300030002E00300030002004420435043D04330435002E002004110430043B0430043D044100200031003900350037002E00300031002004420433002E00200020041F0440043E043204350440044C0020044D
+CMGL: 6,1,"",156 07917750000022F1600DD0C27239E936BF0100082270721230944288050003C20302044004430434043804460438044E002004380020043F043E043F0440043E04310443043900200432044B04380433044004300442044C002000310030003000200030003000300020044204330020043200200049006E00730074006100570069006E002004180433044004300442044C003A002000680074007400700073003A002F
+CMGL: 7,1,"",58 07917750000022F1640DD0C27239E936BF0100082270721230554226050003C20303002F006200650065002E00670067002F0069006E00730074006100770069006E
+CMGL: 8,1,"",156 07917750000022F1600DD0C27239E936BF01000822707202757042880500035E0301041204300448002004410447045104420020043F043E043F043E043B043D0435043D0020043D04300020003100350030002E00300030002004420435043D04330435002E002004110430043B0430043D044100200032003100300037002E00300031002004420433002E002000200414043E00200031003500200434043D04350439
+CMGL: 9,1,"",156 07917750000022F1600DD0C27239E936BF01000822707202753142880500035E03020020041104150421041F041B04100422041D041E00210020003100300030002004220412002D043A0430043D0430043B043E0432002C002000310034003000300030002004440438043B044C043C043E0432002C002004410435044004380430043B043E043200200441043E00200441043C0430044004420444043E043D04300020
+CMGL: 10,1,"",116 07917750000022F1640DD0C27239E936BF01000822707202758142600500035E030304380020041F041A003A002000680074007400700073003A002F002F00620065006500740076002E006B007A002F006100700070002004220440043004440438043A0020043104350437043B0438043C04380442043D044B0439
OK