Discussion:
How to send and receive SMS via AT-Command with nokia E63 ?
(too old to reply)
dongtrien
2015-11-12 02:56:14 UTC
Permalink
How have you know to send and receive messages via batch scripts fo
nokia E63 AT-Command


--
dongtrien
John Henderson
2015-11-12 19:16:48 UTC
Permalink
How have you know to send and receive messages via batch scripts for
nokia E63 AT-Command ?
Do you have an AT command interface open?

If so, what does the command

AT+CMGF?

return?
dongtrien
2015-11-13 06:38:02 UTC
Permalink
Post by dongtrien
How have you know to send and receive messages via batch scripts fo
nokia E63 AT-Command ?
Do you have an AT command interface open
If so, what does the comman
AT+CMGF
return
i'm us

A
O
AT+CMGF=
O
AT+CMGS="0902563xxx
O
Post by dongtrien
you sent something..
return OK, but why i not found Incoming message to the phone numbe
0902563xxx


--
dongtrien
John Henderson
2015-11-13 19:03:39 UTC
Permalink
i'm use
AT
OK
AT+CMGF=1
OK
AT+CMGS="0902563xxx"
OK
you sent something...
return OK, but why i not found Incoming message to the phone number
0902563xxx ?
When you enter the command:

AT+CMGS="0902563xxx"

the E63 should reply with a ">" prompt. At that point, you type
the text to be sent, but you don't press the <Enter> key.

Instead, you give the E63 the ctrl-Z character. This is
character 26 decimal.

The E63 should then respond by sending the text and giving you a
message reference number, like this:

+CMGS: 44

Unless you get that reference number, you should assume that the
SMS was not sent.

What preference have you got set for the SMS carrier moce,
circuit-switched or packet-switched? The command:

AT+CGSMS?

will tell us.
dongtrien
2015-11-14 09:49:42 UTC
Permalink
Post by dongtrien
i'm us
A
O
AT+CMGF=
O
AT+CMGS="0902563xxx
OK
you sent something..
return OK, but why i not found Incoming message to the phone numbe
0902563xxx ?
When you enter the command
AT+CMGS="0902563xxx
the E63 should reply with a "" prompt. At that point, you typ
the text to be sent, but you don't press the Enter key
Instead, you give the E63 the ctrl-Z character. This i
character 26 decimal
The E63 should then respond by sending the text and giving you
message reference number, like this
+CMGS: 4
Unless you get that reference number, you should assume that th
SMS was not sent
What preference have you got set for the SMS carrier moce
circuit-switched or packet-switched? The command
AT+CGSMS
will tell us
thank you, I forgot to type Ctrl-Z character, I now It send good wit
hyperterminal but I changed to language C#.net, it was error "Respons
received is incomplete," you see my code committee know why ? note: E6
modem connected to very goo

Code
-------------------

public bool sendMsg(SerialPort port, string PhoneNo, string Message

bool isSend = false

tr
{
string recievedData = ExecCommand(port,"AT", 300, "No phone connected"); // Error here: recievedData = "Response received is incomplete
recievedData = ExecCommand(port,"AT+CMGF=1", 300, "Failed to set message format.")
String command = "AT+CMGS=\"" + PhoneNo + "\""
recievedData = ExecCommand(port,command, 300, "Failed to accept phoneNo");
command = Message + char.ConvertFromUtf32(26) + "\r"
recievedData = ExecCommand(port,command, 3000, "Failed to send message"); //3 second
if (recievedData.EndsWith("\r\nOK\r\n")

isSend = true

else if (recievedData.Contains("ERROR")

isSend = false

return isSend

catch (Exception ex

throw ex;


}

public string ExecCommand(SerialPort port,string command, int responseTimeout, string errorMessage

tr


port.DiscardOutBuffer()
port.DiscardInBuffer()
receiveNow.Reset()
port.Write(command + "\r")

string input = ReadResponse(port, responseTimeout)
if ((input.Length == 0) || ((!input.EndsWith("\r\n> ")) && (!input.EndsWith("\r\nOK\r\n")))
throw new ApplicationException("No success message was received.")
return input

catch (Exception ex

throw ex

}

public string ReadResponse(SerialPort port,int timeout

string buffer = string.Empty
tr
{
d

if (receiveNow.WaitOne(timeout, false)

string t = port.ReadExisting()
buffer += t

els

if (buffer.Length > 0
throw new ApplicationException("Response received is incomplete.")
els
throw new ApplicationException("No data received from phone.")


while (!buffer.EndsWith("\r\nOK\r\n") && !buffer.EndsWith("\r\n> ") && !buffer.EndsWith("\r\nERROR\r\n"))

catch (Exception ex

throw ex

return buffer


-------------------


--
dongtrien
John Henderson
2015-11-14 19:36:55 UTC
Permalink
thank you, I forgot to type Ctrl-Z character, I now It send good with
hyperterminal but I changed to language C#.net, it was error "Response
received is incomplete," you see my code committee know why ? note: E63
modem connected to very good
--------------------
public bool sendMsg(SerialPort port, string PhoneNo, string Message)
{
bool isSend = false;
try
{
string recievedData = ExecCommand(port,"AT", 300, "No phone connected"); // Error here: recievedData = "Response received is incomplete"
recievedData = ExecCommand(port,"AT+CMGF=1", 300, "Failed to set message format.");
String command = "AT+CMGS=\"" + PhoneNo + "\"";
recievedData = ExecCommand(port,command, 300, "Failed to accept phoneNo");
command = Message + char.ConvertFromUtf32(26) + "\r";
There should be no "\r" after the ctrl-Z. If fact you seem to be
sending two of them - there's one immediately above, and there's
another one being sent from within your "ExecCommand" subroutine.

What you should be doing after the ctrl-Z is flushing the output buffer
(pushing the "Message + char.ConvertFromUtf32(26)" out to the modem).

Do not send "\r" or any other character to the E63 until after you've
received the message reference number.
recievedData = ExecCommand(port,command, 3000, "Failed to send message"); //3 seconds
if (recievedData.EndsWith("\r\nOK\r\n"))
{
isSend = true;
}
else if (recievedData.Contains("ERROR"))
{
isSend = false;
}
return isSend;
}
catch (Exception ex)
{
throw ex;
}
}
public string ExecCommand(SerialPort port,string command, int responseTimeout, string errorMessage)
{
try
{
port.DiscardOutBuffer();
port.DiscardInBuffer();
receiveNow.Reset();
port.Write(command + "\r");
My suggestion is to remove that "\r" here, and pass it to this
subroutine as the last character of the string variable "command"
instead (but only where required).

Then flush the output buffer to the E63. Normally, sending a "\r" will
do that automatically. But terminating with a crtl-Z probably doesn't
result in a flush, so you'll need to perform that step specifically.
string input = ReadResponse(port, responseTimeout);
if ((input.Length == 0) || ((!input.EndsWith("\r\n> ")) && (!input.EndsWith("\r\nOK\r\n"))))
throw new ApplicationException("No success message was received.");
return input;
}
catch (Exception ex)
{
throw ex;
}
}
public string ReadResponse(SerialPort port,int timeout)
{
string buffer = string.Empty;
try
{
do
{
if (receiveNow.WaitOne(timeout, false))
{
string t = port.ReadExisting();
buffer += t;
}
else
{
if (buffer.Length > 0)
throw new ApplicationException("Response received is incomplete.");
else
throw new ApplicationException("No data received from phone.");
}
}
while (!buffer.EndsWith("\r\nOK\r\n") && !buffer.EndsWith("\r\n> ") && !buffer.EndsWith("\r\nERROR\r\n"));
}
catch (Exception ex)
{
throw ex;
}
return buffer;
}
--------------------
I hope that makes sense. Good luck.

John
John Henderson
2015-11-14 19:49:22 UTC
Permalink
thank you, I forgot to type Ctrl-Z character, I now It send good with
hyperterminal but I changed to language C#.net, it was error "Response
received is incomplete," you see my code committee know why ? note: E63
modem connected to very good
string recievedData = ExecCommand(port,"AT", 300, "No phone connected"); // Error here: recievedData = "Response received is incomplete"
If that's the only place you're getting the "Response received is
incomplete" response, I wouldn't be concerned. We don't know the exact
state of the E63 and its input buffer when you send it the first command.

Just send it "AT\r" again (after a pause) - it should work the second
time.

John
John Henderson
2015-11-14 23:13:43 UTC
Permalink
Post by dongtrien
char.ConvertFromUtf32(26)
If you have further problems, please check this.

I'm not familiar with that language. Does this expression give you an
8-bit ASCII character

You need it to be giving you the character that is the 8 binary bits
"00011010". That's what the E63 will be expecting.

John
dongtrien
2015-11-16 05:01:48 UTC
Permalink
This post might be inappropriate. Click to display it.
John Henderson
2015-11-16 08:09:44 UTC
Permalink
recievedData = ExecCommand(port, "at+stgr=6,1,1", 300, "Failed to SIM Toolkit Give Response.");
the variable recievedData is not get +STIN:9 and output: No success message was received.
In what units is the timeout paramater of 300?

Are you giving the device enough time to respond?

John
dongtrien
2015-11-17 03:27:31 UTC
Permalink
Post by dongtrien
-
recievedData = ExecCommand(port, "at+stgr=6,1,1", 300, "Failed to SI
Toolkit Give Response.");-
-
the variable recievedData is not get +STIN:9 and output: No succes
message was received.-
In what units is the timeout paramater of 300?
Are you giving the device enough time to respond?
John
you're right, not enough time to run, according to your time for thi
case how much ? and the calculation of time so that the most appropriat



--
dongtrien
John Henderson
2015-11-17 07:42:36 UTC
Permalink
Post by dongtrien
you're right, not enough time to run, according to your time for
this
Post by dongtrien
case how much ? and the calculation of time so that the most
appropriate

You'll need to experiment. Perhaps time it when you run it through
HyperTerminal. Run it a few times, and double the longest time.

That's what I'd do, and think about decreasing or increasing the
time later with more experience.

John
dongtrien
2015-11-18 04:39:39 UTC
Permalink
-
you're right, not enough time to run, according to your time for -
this-
case how much ? and the calculation of time so that the most -
appropriate
You'll need to experiment. Perhaps time it when you run it through
HyperTerminal. Run it a few times, and double the longest time.
That's what I'd do, and think about decreasing or increasing the
time later with more experience.
John
I think to have one certain way for rational calculation, if farmin
experience unreasonable because I think when I programmed the compute
to run more, which means that it runs on all computers with the lowes
configuration or maximu


--
dongtrien
John Henderson
2015-11-18 06:48:00 UTC
Permalink
I think to have one certain way for rational calculation, if farming
experience unreasonable because I think when I programmed the computer
to run more, which means that it runs on all computers with the lowest
configuration or maximum
If you're concerned about waiting too long for a response, then you could
pass another parameter along with the timeout time.

Pass a string argument containing some text which lets the reading routine
return earlier than the timeout time permits (return instead when the string
is found).

For many AT commands, this could be the string "\r\nOK\r\n".

In the special case we're considering, look for the string "+STIN:" and
return when it's found. Then you can make the timeout value large, without
ever having to wait for it to expire.

John
dongtrien
2015-11-20 04:50:57 UTC
Permalink
thank you for pointing help, I had a problem anymore, after registerin
successfully sim, group of AT command to get the information of sim an
the serial number has been registered successfully obtain suc
information chain posted successful sign ? eg

'128 12/11/11,15:19:16+28 You signed up for the subscription numbe
019861xxxx success. Trading code 0123xxxx


--
dongtrien
John Henderson
2015-11-20 07:25:18 UTC
Permalink
thank you for pointing help, I had a problem anymore, after registering
successfully sim, group of AT command to get the information of sim and
the serial number has been registered successfully obtain such
'128 12/11/11,15:19:16+28 You signed up for the subscription
number
019861xxxx success. Trading code 0123xxxxx
I'm sorry, but I do not understand what it is you are saying.

If it is important, or you have further questions, please try again.

John
dongtrien
2015-11-21 02:40:03 UTC
Permalink
Post by dongtrien
-
thank you for pointing help, I had a problem anymore, afte
registering
successfully sim, group of AT command to get the information of si
and
the serial number has been registered successfully obtain such
'128 12/11/11,15:19:16+28 You signed up for the subscription -
number-
019861xxxx success. Trading code 0123xxxxx-
I'm sorry, but I do not understand what it is you are saying.
If it is important, or you have further questions, please try again.
John
my english is not very good, assuming you have 2 SIM: SIM1 and SIM2, yo
use SIM1 to view information such as the date of registration of SIM2
through at command are not ? if the syntax like? do you understand


--
dongtrien
John Henderson
2015-11-21 22:17:46 UTC
Permalink
Post by dongtrien
my english is not very good,
That's OK.
Post by dongtrien
assuming you have 2 SIM: SIM1 and SIM2, you use SIM1 to view
information such as the date of registration of SIM2 through
at command are not ? if the syntax like? do you understand ?
I see that the E63 is a dual-SIM phone (it takes two SIMs).

I do not have an E63, and I have not used any dual-SIM device. I haven't
found any "AT Command Reference" which talks about Nokia dual-SIM
capability, so I don't think I can be of much help.

John
dongtrien
2015-11-24 06:34:53 UTC
Permalink
-
my english is not very good,-
That's OK.
-
assuming you have 2 SIM: SIM1 and SIM2, you use SIM1 to view
information such as the date of registration of SIM2 through
at command are not ? if the syntax like? do you understand ?-
I see that the E63 is a dual-SIM phone (it takes two SIMs).
I do not have an E63, and I have not used any dual-SIM device.
haven't
found any "AT Command Reference" which talks about Nokia dual-SIM
capability, so I don't think I can be of much help.
John
I do not have an E63 a dual-SIM phone, you do not understand me. I wan
to ask the phone number you are using you can see the date o
registration of the telephone number you are every day through the A
command


--
dongtrien
John Henderson
2015-11-24 13:58:19 UTC
Permalink
I do not have an E63 a dual-SIM phone, you do not understand me. I want
to ask the phone number you are using you can see the date of
registration of the telephone number you are every day through the AT
command ?
The phone number might not be stored on the SIM at all. It isn't used by
the phone for any purpose. Instead, the phone uses the IMSI to identify
the
SIM.

If the phone number for a SIM is stored on the SIM., it will be stored as
the first number in the "Own Numbers" phone book.

Read the IMSI with the command:

AT+CIMI

Read the first entry in the "Own Numbers" phonebook (if it's there) with:

AT+CNUM

If you need to write the SIM's phone number to the SIM, first select the
"Own Numbers" phonebook with:

AT+CPBS="ON"

Then write the number as the first entry. If that number is "+61412345678"
(international format), the command is:

AT+CPBW=1,"+61412345678",145,"Own Nbr"

If the number is "0412345678" (national or "local" format), the command is:

AT+CPBW=1,"0412345678",129,"Own Nbr"

Usually, you would store the SIM's own number in international format, so
145 for type-of-number.

John
John Henderson
2015-11-24 22:02:22 UTC
Permalink
I want to ask the phone number you are using you can see the date of
registration of the telephone number you are every day through the AT
command ?
Dates of events is not information which is normally stored on the phone or
SIM. Exceptions would include SMS and call date/times.

So I wonder if the information you want might be available through USSD
(Unstructures Supplementary Service Data). If it is, we should be able to
read it using AT commands.

Have you seen the information you want on your phone's screen? If so, what
did you enter on the phone's keypad to get the information.

Otherwise, please tell me the first five digits of your SIM's IMSI, and I'll
see what USSD codes I can find for your provider.

That's the five digits on the left in the result from:

AT+CIMI

John
dongtrien
2015-12-02 08:53:31 UTC
Permalink
Thank you for helping m


--
dongtrien
John Henderson
2015-12-02 19:36:33 UTC
Permalink
Thank you for helping me
You are welcome. I hope all your questions have been answered and all of
your problems solved.

John
dongtrien
2015-12-04 08:11:06 UTC
Permalink
Thank you for helping me
You are welcome. I hope all your questions have been answered and al
of
your problems solved
Joh
I was one more question after I sent a message successfully. I us
command at: at+cmgr=2 to get (or check) the message successfully statu
but it's error. you know why not ? follow you no way to get the statu
message sent with success

Code
-------------------

A
O

AT+CMGF=
O

AT+CMGS="0196704xxxx
you sent something... + char(26) (or <CTRL-Z>
O

at+cmgr=2
ERROR // warning error her

-------------------


--
dongtrien
John Henderson
2015-12-04 20:21:47 UTC
Permalink
I was one more question after I sent a message successfully. I use
command at: at+cmgr=2 to get (or check) the message successfully status
but it's error. you know why not ? follow you no way to get the status
message sent with success ?
--------------------
AT
OK
AT+CMGF=1
OK
AT+CMGS="0196704xxxx"
you sent something... + char(26) (or <CTRL-Z>)
OK
at+cmgr=2
ERROR // warning error here
--------------------
The command AT+CMGR=2 reads the message with an <index> of "2" from
whatever message storage you've presently got set. In your case, it seems
that there's no message stored there with an <index> of "2".

When you sent the message with your AT+CMGF command, you will have got a
message reference number <mr> in a result:

+CMGS: <mr>

The fact that you've received an <mr> number means that your SMS was sent
successfully. It was accepted by the SMSC and delivery attempts will start
in due course.

Note that <index> and <mr> are entirely different things, and bear
absolutely no relationship to each other.

What exactly are you trying to do when you issue the AT+CMGR=2 command?

Are you trying to find out whether your message reference <mr> has been
delivered yet?

John
dongtrien
2015-12-06 10:14:45 UTC
Permalink
I did it. when I send many messages, the first good run but the 2n
repeated with a different phone number will be error: "No data receive
from phone", I have increased 10-fold time but still getting this error
if I send each message is good but sent many will fail. What advice d
you have for me ? I do not understand why this error occurre


--
dongtrien
John Henderson
2015-12-08 22:05:28 UTC
Permalink
I did it. when I send many messages, the first good run but the 2nd
repeated with a different phone number will be error: "No data received
from phone", I have increased 10-fold time but still getting this error,
if I send each message is good but sent many will fail. What advice do
you have for me ? I do not understand why this error occurred
I don't really know where to begin.

You did give some code earlier, but it is incomplete. And the programming
language is not one I use myself, so I'm unsure about the finer points of
syntax.

As I understand it, the phone interface has become silent, and you are
getting no characters back from it at all. Is this correct? And if so,
what have you got to do to get it running again? Restart your software, or
restart your phone?

Are you opening the AT command port more than once? If so, are you closing
it before you open it again?

Did you write this software yourself? Or are you trying to adapt something
from another source? If you wrote it all yourself, you should know enough
to insert some debugging print statements to help narrow down the area of
code that's close to where the problem becomes apparent.

John
dongtrien
2015-12-09 01:41:58 UTC
Permalink
I have not experienced in script at, I read the document and then writ
code with C#. I've found the cause the export notification code belo
via HyperTerminal, but I do not know why this command output: "+CMTI
"SM", 1" ? Can you help me understand the script at ? do you know th
script at any command can be output: "+CMTI: "SM", 1" ?

Code
-------------------

...
+STGI: ""
OK

at
OK

+STIN: 1

+STIN: 98

+STIN: 99


-------------------


--
dongtrien
John Henderson
2015-12-09 07:17:44 UTC
Permalink
I have not experienced in script at, I read the document and then write
code with C#. I've found the cause the export notification code below
"SM", 1" ? Can you help me understand the script at ? do you know the
script at any command can be output: "+CMTI: "SM", 1" ?
That's an unsolicited result which results from your AT+CNMI settings.

It's telling you that an SMS has arrived, that it is stored on the SIM, and
that its <index> value is 1.

What does

AT+CNMI?

return?

John
dongtrien
2015-12-10 07:01:11 UTC
Permalink
;511627'
That's an unsolicited result which results from your AT+CNMI settings
It's telling you that an SMS has arrived, that it is stored on the SIM
and
that its index value is 1
What doe
AT+CNMI?
return
Joh
I tried to order at which you just help me, resulting in lowe

Code
-------------------

a

O


at+cnm

ERRO


at+cnmi
+CNMI: 0,1,0,0,
O


at+cnmi=
+CNMI: (0-3),(0-3),(0-3),(0-2),(0,1
O

-------------------

compare with document my reading is not the same: "+CMTI: "SM", 1
I typed syntax: at+cnmi are correct okay with the error message


--
dongtrien
John Henderson
2015-12-10 20:20:31 UTC
Permalink
   at+cnmi?
   +CNMI: 0,1,0,0,0
   OK
compare with document my reading is not the same: "+CMTI: "SM", 1"
I typed syntax: at+cnmi are correct okay with the error message ?
Do you want these unsolicited SMS notifications?  If you want to turn them 
off completely, try:

        AT+CNMI=0,0,0,0,0

John
dongtrien
2015-12-11 08:17:06 UTC
Permalink
-
***at+cnmi?
***+CNMI: 0,1,0,0,0
***OK-
-
compare with document my reading is not the same: "+CMTI: "SM", 1"
I typed syntax: at+cnmi are correct okay with the error message ?-
Do you want these unsolicited SMS notifications?**If you want to tur
them*
********AT+CNMI=0,0,0,0,0
John
I want to know what my type at commands that output results: "+CMTI
"SM", 1


--
dongtrien
John Henderson
2015-12-11 19:56:32 UTC
Permalink
Post by dongtrien
"SM", 1"
It is your current settings that are giving you this unsolicited result.
You do not give another AT command to receive it.

Your phone is configured as if you had given it the command:

AT+CNMI=0,1,0,0,0

That command does not generate a "+CMTI:" result immediately - you have to
wait until an SMS arrives and gets stored in SIM storage index slot number
1.

If SIM storage <index> 1 is still in use when the next incoming SMS arrives,
it will get stored in slot 2 and generate the unsolicited result:

+CMTI: > "SM", 2

and so on.

These "+CMTI:" results are unsolicited. Once you've activated them using:

AT+CNMI=0,1,0,0,0

they will be given every time an SMS arrives. This is what "unsolicited"
means.

You can turn off these "+CMTI:" results with the command:

AT+CNMI=0,0,0,0,0

and you won't get any more of them. Then new SMSs will arrive silently.

John
John Henderson
2015-12-12 22:13:34 UTC
Permalink
Post by John Henderson
If SIM storage <index> 1 is still in use when the next incoming SMS
+CMTI: > "SM", 2
Of course, that should read:

+CMTI: "SM", 2

And this isn't the only unsolicited result type which can be generated by
the AT+CNMI... command. Others are:

+CMT:

+CBMI:

+CBM:

+CDSI:

+CDS:

John
dongtrien
2015-12-15 04:28:39 UTC
Permalink
follow me understand. I do for example with HyperTerminal the followin
lines but "+CMTI: "SM",x" does not work. Do you look my at comman
correct

Code
-------------------

A
AT+CMGF=
AT+CMGS="0196704xxxx
you sent something... + char(26) (hoac <CTRL-Z>
A
O
+STIN: 9
+STIN: 9

AT+CMGF=
O

AT+CPMS="SM
O

AT+CMGL="ALL"
O

+CMTI: "SM",x // why "+CMTI: "SM",x" does not appear in here Or "+CMTI: "SM",x" not working

AT+CMGR=
AT+CMGD=

-------------------


--
dongtrien
John Henderson
2015-12-15 07:09:51 UTC
Permalink
follow me understand. I do for example with HyperTerminal the following
lines but "+CMTI: "SM",x" does not work. Do you look my at command
correct ?
--------------------
AT
AT+CMGF=1
AT+CMGS="0196704xxxx"
you sent something... + char(26) (hoac <CTRL-Z>)
AT
OK
+STIN: 98
+STIN: 99
Are you expecting these +STIN: unsolicited responses? They seem to be
coming from an active SIM Application Toolkit session.

I don't think they are related to your +CMTI: responses, but I'm not 100%
sure.

What does:

AT+STSF?

return?
AT+CMGF=1
OK
AT+CPMS="SM"
OK
AT+CMGL="ALL"
OK
"SM",x" not working
Are you expecting a +CMTI: result here?

Did you just receive an SMS? If you did, and you previously issued a

AT+CNMI=0,1,0,0,0

command, then receiving an SMS should have triggered an +CMTI: result.

AT+CMGL="ALL" does not trigger an +CMTI: result.

If we are misunderstanding each other, it might be best if you tell me
exactly what you are trying to do.

John
dongtrien
2015-12-16 04:50:49 UTC
Permalink
Post by John Henderson
What does
AT+STSF
return
Are you expecting a +CMTI: result here
Did you just receive an SMS? If you did, and you previously issued
AT+CNMI=0,1,0,0,
command, then receiving an SMS should have triggered an +CMTI: result
AT+CMGL="ALL" does not trigger an +CMTI: result
If we are misunderstanding each other, it might be best if you tell me
exactly what you are trying to do
Joh
I am doing active SIM and send SMS into one common program, if no
forced me to split them into two separate programs, one is active SI
the rest is sent SMS message. I am expecting the results +CMTI: afte
active SIM but I do not get results "+CMTI:"; I have tried many ways t
get the results of "+CMTI:" as

Code
-------------------

AT+CNMI
+CNMI: 0,1,0,0,
O

O

AT+CNMI=0,1,0,0,
O

-------------------

they only result "OK", they do not have "+ CMTI:

you ask me the results returned b
AT+STSF
+STSF: 1,"5FFFFFFF7F",3,
O

Have you got for example activate SIM with at command


--
dongtrien
John Henderson
2015-12-18 08:45:26 UTC
Permalink
I am doing active SIM and send SMS into one common program, if not
forced me to split them into two separate programs, one is active SIM
the rest is sent SMS message. I am expecting the results +CMTI: after
active SIM but I do not get results "+CMTI:"; I have tried many ways to
 
--------------------
     
   AT+CNMI?
   +CNMI: 0,1,0,0,0
   OK
   
   Or
   
   AT+CNMI=0,1,0,0,0
   OK
   
--------------------
 
they only result "OK", they do not have "+ CMTI:"
What are you expecting the "+CMTI:" result to tell you?

What information are you trying to get from it?

Why do you think you should be getting a "+CMTI:" result at that point in 
time?
you ask me the results returned by
AT+STSF?
+STSF: 1,"5FFFFFFF7F",3,0
OK
I have been intending to decode this, but haven't managed to do that yet - 
sorry for the delay.
Have you got for example activate SIM with at command ?
What exactly do you mean by "activate SIM"?  Are you trying to change active 
SIMs on a dual-SIM device?

John
John Henderson
2015-12-19 09:31:24 UTC
Permalink
you ask me the results returned by
AT+STSF?
+STSF: 1,"5FFFFFFF7F",3,0
OK
Working through these returned arguments:

1 - SIM Application Toolkit is active

"5FFFFFFF7F" - Your Terminal Profile.  Nothing special here.

3 - Timeout for user responses is 30 seconds (3 * 10).

0 - Automatic response is not activated.

John
John Henderson
2015-12-20 19:33:03 UTC
Permalink
active SIM but I do not get results "+CMTI:"; I have tried many ways to
--------------------
AT+CNMI?
+CNMI: 0,1,0,0,0
OK
Or
AT+CNMI=0,1,0,0,0
OK
Let me put what I've been saying another way.

Are you trying to solicit a response by giving versions of the AT+CNMI
command?

If so, those attempts will always fail, because the command does not
give solicited SMS results. It gives only unsolicited results.

If you want to solicit a response which gives you info about stored
SMSs, you need to use some form of the AT+CMGL command instead.

John
dongtrien
2015-12-21 02:06:22 UTC
Permalink
do you know software can replace HyperTerminal because each I run hav
to enter the commands at many times, I want to put these commands a
into one file and use equivalent software HyperTerminal to run, you kno
what that software name and the link can download


--
dongtrien
John Henderson
2015-12-21 12:49:14 UTC
Permalink
do you know software can replace HyperTerminal because each I run have
to enter the commands at many times, I want to put these commands at
into one file and use equivalent software HyperTerminal to run, you know
what that software name and the link can download ?
Have you looked at PuTTY?

http://www.putty.org/

I use Linux, so I'm not very up-to-date on what's available for Windows. I
sometimes use the Linux program picocom.

If you are a good programmer, you can adapt that program of yours to make
your own HyperTerminal replacement - especially if you just need a command-
line replacement.

John
dongtrien
2015-12-22 07:03:44 UTC
Permalink
You introduce software is hard to use, I need software lik
HyperTerminal but be run one script file containing at me typpin

if I use the command AT+CMGR = x, Can you know what's command at tha
index x


--
dongtrien
John Henderson
2015-12-22 20:41:54 UTC
Permalink
You introduce software is hard to use, I need software like
HyperTerminal but be run one script file containing at me typping
I'm not sure what you want. Something which will accept input from a file,
but allow you some interaction too?

You might need to write your own to achieve that.
if I use the command AT+CMGR = x, Can you know what's command at that
index x ?
In text-mode (when AT+CMGF=1), you can get the index value from the
appropriate one of these commands:

AT+CMGL="REC UNREAD"
AT+CMGL="REC READ"
AT+CMGL="STO UNSENT"
AT+CMGL="STO SENT"
AT+CMGL="ALL"

You need to have the correct storage selected for these commands to work.
For the current storage setting, use:

AT+CPMS?

Be aware that either the "REC UNREAD" or "ALL" arguments will change the
status of any received UNREAD message to READ.

If a new SMS arrives and you have unsolicited results turned on correctly,
then you will be given the index value immediately via an unsolicited
"+CTMI: <mem>,<index>" result. This is the only circumstance where you will
get such a result.

John
dongtrien
2015-12-25 09:15:29 UTC
Permalink
thank you for pointing help !

I would like to ask more. you try to connect your smartphone wit
HyperTerminal, smartphones do not support connecting with HyperTermina
of winxp


--
dongtrien
John Henderson
2015-12-25 19:52:46 UTC
Permalink
I would like to ask more. you try to connect your smartphone with
HyperTerminal, smartphones do not support connecting with HyperTerminal
of winxp ?
As I understand it, that is correct.

Sadly, smartphones do not have a command interface where you can enter AT 
commands.

You need to install specific "apps" if you want to have the functionality 
which AT commands give you on older phones.

John
dongtrien
2015-12-30 07:09:29 UTC
Permalink
This post might be inappropriate. Click to display it.
John Henderson
2015-12-30 20:46:52 UTC
Permalink
I ask you to send a message, I have successfully sent a message less
--------------------
0 <Message less than or equal 160 // the string less than or equal 160
characters
AT
OK
AT + CMGF = 1
OK
AT + CSCS = "PCCP437"
OK
AT + CMGS = "0196704xxxx"
*> Message (control + z)
OK
--------------------
--------------------
Message2 bigger 160 characters
AT
OK
AT + CMGF = 1
OK
AT + CSCS = "PCCP437"
OK
i = 0; // Calculate the chain length
Substring2 = ""; // String, less than or equal 160 characters
while (i less than Message2.Length)
{
*****AT + CMGS = "0196704xxxx"
*****if (i + 159 <Message2.Length)
*****{
*********> Substring2 = Message2.Substring (i, i + 159) + (control + z)
*********OK
*****}
*****else
****{
**********> Substring2 = Message2.Substring (i, Message2.Length) +
(control + z) *********OK
****}
}
--------------------
*
I did not send the message unicode characters when after receiving a
--------------------
0 < Message3 less than or equal 70 // the string less than or equal 70
characters
AT
OK
AT + CMGF = 1
OK
AT + CSCS = "Hex"
OK
AT + CMGS = "0196704xxxx"
*> MessageUnicode = (Hex)Message3 + (control + z)
--------------------
you help me see cases 2 and 3, I did not send the message, my algorithm
wrong ? If i'm sending a message > 160 characters I must assign
at+CSCS="GSM" right ?
In your case 2, are you incrementing the value of variable i each time
through the "while" loop?

Or are you leaving it set to zero? (That won't work.)

In your case 3, have you set the DCS value correctly for 16-bit characters?
What does

AT+CSMP?

return (immediately before the AT+CMGS command)?

When using the default 7-bit alphabet, messages of more than 160 characters
are usually split into parts before sending. Each part is then sent as an
individual SMS. The receiving device should then use the message and part
numbers you assign to reconstruct the original long message.

These split messages are known as "concatenated" messages. You must set the
UDHI bit in the PDU-type octet, and begin the User Data with the encoded
message and part numbering information as a User Data Header. This uses up
some of the message payload space, and the text itself must be correctly
aligned to a septet boundary to accommodate the User Data Header.

Message concatenation is a complex topic. It's usually handled using PDU-
mode rather than text-mode. I've not tried to implement it in text-mode,
but it may be possible (with some very sophisticated programming).

John
dongtrien
2015-12-31 02:10:13 UTC
Permalink
I do not know why when I type the left arrow "<" and the right arrow ">
This page is not displayed
send multiple messages to multiple phone numbers for cases 2 and

case 2: messages of more than 160 character
when I send a message more than 160 characters, I've split the messag
into multiple messages children, each message children smaller than o
equal to 160 characters before sending, the receiving device know ho
that "message is concatenated" ?, in HyperTerminal you can perform a
command syntax to send messages longer than 160 characters like

case 3
AT+CSMP
+CSMP: 17,167,0,
O

AT+CMGS
ERRO

I do not know DCS and DCS values I set correctly for 16-bit character
like ? How i must set the PDU-type UDHI bit octet ? you can perfor
syntax at via HyperTerminal

This site does not support the strange (wild) characters and othe
features should I attach files this conten
http://www.mediafire.com/view/0e3mco74b48ot8s/case2and3.tx


--
dongtrien
John Henderson
2015-12-31 09:27:32 UTC
Permalink
I do not know why when I type the left arrow "<" and the right arrow ">"
This page is not displayed.
I do not follow your meaning. I do not understand.
case 2: messages of more than 160 characters
when I send a message more than 160 characters, I've split the message
into multiple messages children, each message children smaller than or
equal to 160 characters before sending, the receiving device know how
that "message is concatenated" ?, in HyperTerminal you can perform at
command syntax to send messages longer than 160 characters like ?
What is the problem here? If the total message text length is 100
characters, and you are splitting it into two messages, does the receiving
device receive both messages OK?

Is the problem just that you want the receiving device to automatically join
the two messages back into a single message?
AT+CSMP?
+CSMP: 17,167,0,0
OK
I'll work through those four values.

Your PDU-type octet is set to 17 decimal. That's 11 hex, and 00010001
binary. This is normal for an ordinary SMS with no User Data Header.

Your Validity Period is set to 167 decimal That's A7 hex and means 24
hours.

If the message centre which accepts your messages for delivery is unable to
deliver those messages within 24 hours, they will be deleted and no further
delivery attempts will be made.

You might want to increase that value. Or even reduce it.

Your PID (Protocol ID) is zero. This is a normal value for an SMS to be
sent.

Finally, your DCS (Data Coding Scheme) value is also zero. This means that
you'll be using the SMS 7-bit default alphabet. So if you use

AT+CSCS="HEX"

your hex data will be converted by the sending device into SMS 7-bit
characters before sending.

This is clearly not what you want. You want to send 16-bit unicode
characters.

So before you send the message, set your DCS to 8 (eight). Issue the
command:

AT+CSMP=17,167,0,8

If you want to increase the Validity Period from 24 hours to 7 days, use:

AT+CSMP=17,173,0,8

instead.

Don't forget to change the DCS back to zero before you try to send a 7-bit
message again.

John
I do not know DCS and DCS values I set correctly for 16-bit characters
like ? How i must set the PDU-type UDHI bit octet ? you can perform
syntax at via HyperTerminal ?
This site does not support the strange (wild) characters and other
features should I attach files this content
http://www.mediafire.com/view/0e3mco74b48ot8s/case2and3.txt
John Henderson
2015-12-31 10:57:58 UTC
Permalink
I did not send the message unicode characters when after receiving a
--------------------
0 < Message3 less than or equal 70 // the string less than or equal 70
characters
AT
OK
AT + CMGF = 1
OK
AT + CSCS = "Hex"
OK
AT + CMGS = "0196704xxxx"
*> MessageUnicode = (Hex)Message3 + (control + z)
--------------------
On further reading,

AT+CSCS="HEX"

might not work for 16-bit. If your device supports it,

AT+CSCS="UCS2"

might be required instead.

The DCS value should still be 8.

You can list your supported values with:

AT+CSCS=?

John
dongtrien
2016-01-04 02:30:08 UTC
Permalink
What is the problem here? If the total message text length is 100
characters, and you are splitting it into two messages, does th
receiving
device receive both messages OK

Is the problem just that you want the receiving device to automaticall
join
the two messages back into a single message

--------------------

I divide the message into several messages while the total lengt
greater than 160 characters, suppose I have a message 195 characters
spent a 2 message, the first message 160 characters 2nd message with 3
characters remaining, sending just first message is received no
received 2nd message I do not know why

According to your instructions above, I sent a message unicode Okay, th
reason is I do not know the declaration, now I've got i

Now I figure one another questions you can answer to help me? as I kno
there are two ways to send messages unicode, 1 you have guided me then
and a 2 code at the bottom, I do not see the recipient's phone and d
not understand AT + CMGS = 34 it to do what? if I send this form AT
CSCS declaration = "HEX" or AT + CSCS = "UCS2"

Code
-------------------

AT+CMGF=0
OK
AT+CMGS=34
0011000B912309157821xxx0008AA1400680065006C006C006F00680065006C006C006F

-------------------


--
dongtrien
John Henderson
2016-01-04 07:05:09 UTC
Permalink
I divide the message into several messages while the total length
greater than 160 characters, suppose I have a message 195 characters I
spent a 2 message, the first message 160 characters 2nd message with 35
characters remaining, sending just first message is received not
received 2nd message I do not know why ?
When you send a message using AT commands, you are given a message reference
number for each message sent. Like:

+CMGS: 23

Did you get two message reference numbers? One for each message?

These numbers tell you that the message has been sent successfully.
According to your instructions above, I sent a message unicode Okay, the
reason is I do not know the declaration, now I've got it
Now I figure one another questions you can answer to help me? as I know
there are two ways to send messages unicode, 1 you have guided me then,
and a 2 code at the bottom, I do not see the recipient's phone and do
not understand AT + CMGS = 34 it to do what? if I send this form AT +
CSCS declaration = "HEX" or AT + CSCS = "UCS2" ?
--------------------
AT+CMGF=0
OK
AT+CMGS=34
0011000B912309157821xxx0008AA1400680065006C006C006F00680065006C006C006F
The AT+CMGF=0 command puts the device into PDU-mode, not text-mode.

In PDU-mode the "34" argument for the send command is the number of octets
in the PDU. This is the number of octets without the SMSC (message centre)
information. In the case of your message, the first byte "00" is the SMSC
information. So the count doesn't include this.

Your PDU has a PDU-type of 11 hex. It's addressed to +3290518712xxx (but a
fill digit "F" is also missing).

PID is 00. DCS is 08. Validity period AA means 4 days.

There are 14 hex (20 decimal) octets of user data:

00680065006C006C006F00680065006C006C006F

It's 16-bit data, so the octets are decoded in pairs:

0068 h
0065 e
006C l
006C i
006F o
0068 h
0065 e
006C l
006C l
006F o

Is this what you wanted to know?

John

John Henderson
2015-12-10 20:33:37 UTC
Permalink
   at+cnmi?
   +CNMI: 0,1,0,0,0
   OK
compare with document my reading is not the same: "+CMTI: "SM", 1"
I typed syntax: at+cnmi are correct okay with the error message ?
See 3GPP 27.005, section 3.4.1, which says (for an <mt> value of "1" like 
you have):

"If SMS-DELIVER is stored into ME/TA, indication of the memory location
is routed to the TE using unsolicited result code:

+CMTI: <mem>,<index>"

John
Loading...