Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Read sms message

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive
View previous topic :: View next topic  
Author Message
gunnebo

Bascom Member



Joined: 13 Oct 2007
Posts: 4
Location: Gothenburg

sweden.gif
PostPosted: Sat Oct 13, 2007 1:38 am    Post subject: Read sms message Reply with quote

Hi
Iīm trying to read sms message from Sony Ericsson K700 with AT commands using attiny2313 and Bascom.
I have connected the phone and a LCD-display to attiny2313 and the communication works and is plotted on the display.
But somehow I can not read message. If I print ATCMGR=? I get OK but then what? How do I find the latest message? If I type something else then ?, I get ERROR.
Back to top
View user's profile
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Sat Oct 13, 2007 2:16 am    Post subject: Reply with quote

Hi,
to read the sms try Print "AT+CMGR=1" = read sms 1

or use the +CMTI: command to get new sms and sms index number

Do you use TEXT or PDU format ?

AT+CNMI=x New message indications to TE , x = see your phone AT Commands for right setup for the +CMTI: command
AT+CMGF=0 = PDU
AT+CMGF=1 = TEXT

more info about your phone here Developers' Guidelines - AT Commands
Read the dg_at_2004_r6b PDF then you know more about your phone AT commands

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
gunnebo

Bascom Member



Joined: 13 Oct 2007
Posts: 4
Location: Gothenburg

sweden.gif
PostPosted: Sat Oct 13, 2007 12:10 pm    Post subject: Reply with quote

Hi Kimmi

History:
I have a small VB6 program (send sms works, not tried receiving yet) that I wanīt to use to send sms to an application somewhere, and that app. receives the message and returns an answer depending on the message.
My old SE-mobiles support only PDU-format.
I have all the PDF's from SE.
I have done some programming in VB6 and VB.net but Iīm a newbie with AVR and Bascom.

Print "AT+CMGR=1" returns ERROR

Print "AT+CNMI?" returns +CNMI: 2,0,0,0,0 and I havenīt been able to change this. I probably write it in the wrong way.

Print "AT+CNMI=2,1,0,0,0" doesnīt change anything.
Back to top
View user's profile
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Sat Oct 13, 2007 12:57 pm    Post subject: Reply with quote

Hej Gunnebo,

You need to setup you Message Storage to
(AT+CPMS Preferred Message Storage) ME = phone
here is my setup for Siemens

Print "ATE0" ' Echo off
Print "AT+CSCS=GSM" 'Select The Character Set
Print "AT+CPMS=ME" Preferred Message Storage
Print "AT+CNMI=2,1,0,0,0" 'New Messages Indication to TE

To read PDU you need to convert the PDU string to Text
or use simple commands in your program and use the PDU as command

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
gunnebo

Bascom Member



Joined: 13 Oct 2007
Posts: 4
Location: Gothenburg

sweden.gif
PostPosted: Sat Oct 13, 2007 2:44 pm    Post subject: Reply with quote

Hi Kimmi

Print "AT+CPMS=ME" returns ERROR

From SE pdf:
Set command: AT+CPMS=<mem1>[,<mem2>[,<mem3>]]

Hmmm? Donīt understand this. Do I need to select a specific memory cell?

Print AT+CPMS? returns +CPMS: "SM",0,25,"SM",0,25,"ME",16,118
Back to top
View user's profile
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Sat Oct 13, 2007 2:50 pm    Post subject: Reply with quote

Hi,
Sorry
The SE use "ME"
so try this way

Print "AT+CPMS=" ; Chr(34) ; "ME" ; Chr(34) 'Select Phone Memory

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
pratik

Bascom Member



Joined: 13 Oct 2005
Posts: 55

india.gif
PostPosted: Sat Oct 13, 2007 9:23 pm    Post subject: Reply with quote

Hi ,

Sorry to disturb u but which Sony Ericsson mobile phone support
AT+CMGF=1 = TEXT command
& pin out of mobile phone to connect to serial port of micro controller
Back to top
View user's profile
gunnebo

Bascom Member



Joined: 13 Oct 2007
Posts: 4
Location: Gothenburg

sweden.gif
PostPosted: Sat Oct 13, 2007 9:35 pm    Post subject: Reply with quote

Hi

>pratik: Donīt know if any SE mobile phones support text command, maybe some new models.

>kimmi: That did the trick. I thought that I was writing the command in the wrong way and I tried it in anyway I could think of, but not that one.

Now I just have to convert PDU to text. Rolling Eyes

(Sorry about Spain Sad )
Back to top
View user's profile
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Sat Oct 13, 2007 9:57 pm    Post subject: Reply with quote

Hi,
Thats nice you got it to work..
Pdu is no big deal the problem is the 2313 it dont have alot of sram

but if you can make it simple then use the PDU format of the text only
like use sms commands 8 chars long (for all) then you just read the last 14 chars of the PDU and use them as commands

12345678 is in PDU 31D98C56B3DD70
SEE more ...HERE
About Spain ! well the best did win so cool
Add : bas test file for the SMS TEXT<>PDU part not full PDU date time smsc ect try run it in bascom simulator .

_________________
/ Kim
Back to top
View user's profile Visit poster's website MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    www.mcselec.com Forum Index -> BASCOM-AVR Archive All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum