I am experiencing with AT commands using a sim800 modem (Dinstar), I am unable to get the response of the STK command after STK send short message.
When using my phone, the process goes as follows:
My problem is while using the modem, I am not able to see the message informing the user if the operation was successful or not. Here are the AT commands used with the result of each one:
at+stktrs=00,01
OK
+STKPCI: 0,SELECT ITEM,2,526563686172676520636C69656E74
+STKPCI: 0,ITEM,1,01,526563686172676520636C61737369717565
+STKPCI: 0,ITEM,2,02,4175747265207363056E6172696F206465207265636861726765
at+stktrs=00,01
OK
+STKPCI: 1,TIMER MANAGEMENT,01
+STKPCI: 0,GET INPUT,4,04456E7472657A206C6520636F646520636F6E666964656E7469656C203A0D0A362063686966667265732028302D3929,06,06
at+stktrs=00,01313131313131
OK
+STKPCI: 1,TIMER MANAGEMENT,01,00,01,00
+STKPCI: 0,GET INPUT,0,04456E7472657A206C65206E756D05726F2064652074056C0570686F6E6520636C69656E74203A0D0A31302063686966667265732028302D3929,0A,0C
at+stktrs=00,0130363535353535353535
OK
+STKPCI: 0,GET INPUT,0,04456E7472657A206C65206D6F6E74616E74206465206C61207265636861726765203A0D0A28302D3929,01,05
at+stktrs=00,0135
OK
+STKPCI: 0,DISPLAY TEXT,129,04566F756C657A2D766F757320767261696D656E7420726563686172676572206C6520636C69656E7420363535353535353535207F2068617574657572206465202064697268616D73203F
at
OK
at+stktrs=00
OK
+STKPCI: 1,SEND SHORT MESSAGE,5472616974656D656E7420656E20636F7572732E2E2E,0,0101038154F5000410E18B8FBAC72115E05B54866E5C667593
at+stksms=0
OK
+STKPCI: 2
+STKPCI: 0,PLAY TONE
After this, nothing is sent from the modem even after a long time. the +STKPCI SEND SHORT MESSAGE in my opinion sends the Short message. I also do not know what 0101038154F5000410E18B8FBAC72115E05B54866E5C667593 means, in the docs, this should be the SMS tpdu but I am not able to decode/parse it. I need to be able to send the STK SMS without browsing through the menu over and over again.
FYI, I am connecting to the modem via a TCP socket and not a serial connection, the modem I'm using is a Dinstar UC2000-VE.
EDIT: After using the at command AT+STKSMS=0, I am able to receive the topup on my phone, but nothing is shown on the gateway side. When I am using the phone, I am able to see a confirmation message after the tone stating if the operation was successful or not.
EDIT 2: I am adding another simple example which requires no user input but the confidential code: getting user balance, same problem the request is executed I am able to see the loading... message but nothing is returned after, while using the phone I am able to see my balance after the loading... message. Here are the AT commands executed:
at+stktrs=00,03
OK
+STKPCI: 1,"D00C810301270282028182240101"
+STKPCI: 0,"D03F8103012304820281828D3004456E7472657A206C6520636F646520636F6E666964656E7469656C203A0D0A362063686966667265732028302D392991020606"
at+stktrs=00,01313131313131
OK
+STKPCI: 1,"D0118103012700820281822401012503000100"
+STKPCI: 1,"D03C81030113008202818305165472616974656D656E7420656E20636F7572732E2E2E0B190101038154F5000410ED69EC90113BCA7F71B9E5ED07BB7935"
This string D03C81030113008202818305165472616974656D656E7420656E20636F7572732E2E2E0B190101038154F5000410ED69EC90113BCA7F71B9E5ED07BB7935 shows the Loading message but nothing is received after.
After thoroughly looking into this. I found a solution that is working as expected but a little bit weird.
After sending the STK short message and receiving the play tone STKPCI
at+stksms=0
OK
+STKPCI: 2
+STKPCI: 0,PLAY TONE
Sending an AT+STKTRS=10 seems to get the DISPLAY TEXT STKPCI, according to the manual, STKTRS '10' = Proactive SIM session terminated by the user.
Now it looks something like this:
at+stksms=0
OK
+STKPCI: 2
+STKPCI: 0,PLAY TONE
at+stktrs=10
OK
+STKPCI: 0,DISPLAY TEXT,129,046F7005726174696F6E200563686F7505653A20566575696C6C657A207205657373617965722E
The display text is the result of the operation, but I don't quite understand why do I need to close the session after the +STKPCI:2 is sent, which according to the manual means 2 No other command (end of session)