Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

Send sms via AT commands doesn't work

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR
View previous topic :: View next topic  
Author Message
jakub.jnm

Bascom Member



Joined: 26 Mar 2013
Posts: 20

PostPosted: Fri Apr 08, 2016 10:39 pm    Post subject: Send sms via AT commands doesn't work Reply with quote

Hi all,

i am not able to figure out why i am not able to send sms via AT commands. I have atmega32 directly connected to SIM800L and using following sub routine



Code:
Sub Sendsms()
            Print "ATZ"
            Wait 3
           Print "AT+CMGF=1"
           Wait 3

Print "AT+CMGS="00000000"
      Wait 3
Print "
test2 "
      Wait 3
Print Chr(26)
       Wait 2


When i am connected via serial to sim800l module those commands are working. Can some please help?

(BASCOM-AVR version : 2.0.7.1 , Latest : 2.0.7.8 )
Back to top
View user's profile
i.dobson

Bascom Expert



Joined: 05 Jan 2006
Posts: 1570
Location: Basel, Switzerland

switzerland.gif
PostPosted: Sat Apr 09, 2016 3:45 pm    Post subject: Reply with quote

Hello,

Wiring OK? Baudrate OK? Crystal Setup correctly?

Maybe try just writing a small script that blinks an LED every second (just to check the AVR is running at the correct speed). This is important as AVR's use the CPU clock to generate the clock for the UART.

Regards
Ian Dobson

_________________
Walking on water and writing software to specification is easy if they're frozen.
Back to top
View user's profile
Evert :-)

Bascom Expert



Joined: 18 Feb 2005
Posts: 2156

netherlands.gif
PostPosted: Sat Apr 09, 2016 7:18 pm    Post subject: Reply with quote

You need to give us some more info....
Show some more code and preferably a schematic.
What does the gsm module sends back to you after the ATZ?

_________________
www.evertdekker.com Bascom code vault
Back to top
View user's profile Visit poster's website
kimmi

Moderator



Joined: 24 Feb 2006
Posts: 1922
Location: Denmark

denmark.gif
PostPosted: Sun Apr 10, 2016 3:09 pm    Post subject: Reply with quote

dont know if SIM800L use quotes (") in CMGS number but you can try it
Code:
Print "AT+CMGF=1"
Waitms 500
Print "AT+CMGS={034}+xxxxxxxxxx{034}"
Wait 1
Print " test2 "
Waitms 500
Print Chr(26)
Wait 5

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

Bascom Member



Joined: 26 Mar 2013
Posts: 20

PostPosted: Tue Apr 12, 2016 11:48 pm    Post subject: Reply with quote

kimmi wrote:
dont know if SIM800L use quotes (") in CMGS number but you can try it
Code:
Print "AT+CMGF=1"
Waitms 500
Print "AT+CMGS={034}+xxxxxxxxxx{034}"
Wait 1
Print " test2 "
Waitms 500
Print Chr(26)
Wait 5



Yes, correct!! It's working now. Thx a lot
Back to top
View user's profile
slavcio2012

Bascom Member



Joined: 14 Feb 2013
Posts: 1

PostPosted: Mon May 01, 2017 4:06 pm    Post subject: Reply with quote

Code:
Print "AT + CMGF = 1" ;Chr(13)
Back to top
View user's profile
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Tue May 02, 2017 1:57 am    Post subject: Cr/Lf Reply with quote

Do a search on M590 in this forum. You will find a SMS sender / receiver. Check the Bascom code. I am missing carriage return/line feed.

Most terminal programs sends a Cr/Lf at the end of te line.

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> BASCOM-AVR 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