A mobile phone forum. Mobile-Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Mobile-Forum forum » General mobile phone forums » GSM
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

How to send and receive SMS via AT-Command with nokia E63 ?



 
 
Thread Tools Display Modes
  #1  
Old November 12th 15, 03:56 AM
dongtrien dongtrien is offline
Member
 
First recorded activity by MobileForum: Jun 2015
Posts: 34
Default How to send and receive SMS via AT-Command with nokia E63 ?

How have you know to send and receive messages via batch scripts for nokia E63 AT-Command ?
  #2  
Old November 12th 15, 08:16 PM posted to alt.cellular.gsm
John Henderson[_2_]
external usenet poster
 
Posts: 57
Default How to send and receive SMS via AT-Command with nokia E63 ?

dongtrien wrote:

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?
  #3  
Old November 13th 15, 07:38 AM
dongtrien dongtrien is offline
Member
 
First recorded activity by MobileForum: Jun 2015
Posts: 34
Default

Quote:
Originally Posted by John Henderson[_2_] View Post
dongtrien wrote:

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?

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 ?

Last edited by dongtrien : November 13th 15 at 08:03 AM.
  #4  
Old November 13th 15, 08:03 PM posted to alt.cellular.gsm
John Henderson[_2_]
external usenet poster
 
Posts: 57
Default How to send and receive SMS via AT-Command with nokia E63 ?

dongtrien wrote:

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.
  #5  
Old November 14th 15, 10:49 AM
dongtrien dongtrien is offline
Member
 
First recorded activity by MobileForum: Jun 2015
Posts: 34
Default

Quote:
Originally Posted by John Henderson[_2_] View Post
dongtrien wrote:

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.

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

Code:
public bool sendMsg(SerialPort port, string PhoneNo, string Message)
        {
            bool isSend = false;

            try
            {                
                string recievedData = ExecCommand(port,"AT", 300, "No phone connected"); // Error he 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 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");
           
                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;
        }

Last edited by dongtrien : November 14th 15 at 10:53 AM.
  #6  
Old November 14th 15, 08:36 PM posted to alt.cellular.gsm
John Henderson[_2_]
external usenet poster
 
Posts: 57
Default How to send and receive SMS via AT-Command with nokia E63 ?

dongtrien wrote:


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


Code:
--------------------

public bool sendMsg(SerialPort port, string PhoneNo, string Message)
{
bool isSend = false;

try
{
string recievedData = ExecCommand(port,"AT", 300, "No phone connected"); // Error he 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
  #7  
Old November 14th 15, 08:49 PM posted to alt.cellular.gsm
John Henderson[_2_]
external usenet poster
 
Posts: 57
Default How to send and receive SMS via AT-Command with nokia E63 ?

dongtrien wrote:

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 he 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
  #8  
Old November 15th 15, 12:13 AM posted to alt.cellular.gsm
John Henderson[_2_]
external usenet poster
 
Posts: 57
Default How to send and receive SMS via AT-Command with nokia E63 ?

dongtrien wrote:

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

  #9  
Old November 16th 15, 06:01 AM
dongtrien dongtrien is offline
Member
 
First recorded activity by MobileForum: Jun 2015
Posts: 34
Default

Thank you for answering, I was okay. Now I have a problem when using the AT+STGR=6,1,1
I can not get + STIN: 9 in language C#. I run scripts AT in the HyperTerminal no error.

Code:
AT
OK

AT+STGR=6,1,1
OK

+STIN: 9
...
Code C#
Code:
try
{
string recievedData = ExecCommand(port, "at", 300, "No phone connected at .");
Debug.Print(recievedData.ToString());
recievedData = ExecCommand(port, "at+stgi=0", 300, "Failed to SIM Toolkit Get Information.");
Debug.Print(recievedData.ToString());
recievedData = ExecCommand(port, "at+stgr=6,1,1", 300, "Failed to SIM Toolkit Give Response.");
Debug.Print(recievedData.ToString()); //Error he No success message was received.
...
}
...


when I debug C# output:
at
OK

at+stgi=0
+STGI: "APP SIM TOOLKIT"
+STGI: 6,4,"xxx...",0
+STGI: 7,4,"yyy...",0
+STGI: 8,4,"zzz...",0
+STGI: 9,4,"Languge",0
OK

at+stgr=0,6,1
OK

the variable recievedData is not get +STIN:9 and output: No success message was received.
  #10  
Old November 16th 15, 09:09 AM posted to alt.cellular.gsm
John Henderson[_2_]
external usenet poster
 
Posts: 57
Default How to send and receive SMS via AT-Command with nokia E63 ?

dongtrien wrote:

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
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
(old) Nokia 22 (gsm gateway, adapter) - how to send/receive sms from PC [email protected] Nokia 0 March 27th 10 06:59 PM
Nokia 3650 Acting up badly. Cant send/receive SMS, Reboots, memory full errors [email protected] Nokia 0 January 24th 05 05:02 PM
Send/Receive MMS w/Nokia 7250i Kingy75 Nokia 1 April 24th 04 07:42 PM
Help receive/send mms with nokia 3595 steve Voicestream GSM 4 October 19th 03 11:35 PM
How to send/receive a gif/midi with a nokia 3595 steve Nokia 0 October 19th 03 02:59 AM


All times are GMT +1. The time now is 11:00 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004-2017 Mobile-Forum.
The comments are property of their posters.