LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   Sending AT commands to a SMS modem (http://www.linuxquestions.org/questions/linux-hardware-18/sending-at-commands-to-a-sms-modem-372445/)

narmida 10-12-2005 08:28 PM

Sending AT commands to a SMS modem
 
Hello,

Im trying hard to configure a SMS MODEM the GM862
This is a simpel modem with a mobile card connected to my ttyS0

i can put the command manualy in with minicom and this works.
Now i want to automate this function to send is out in a script

The commands that needed to be send to the modem are :


ATZ0
AT+CSCA?
AT+CMGF=1
AT+CNMI=2,1
AT+CMGS=+31612345678
text message that can contain almost anything
ctrl-z


The 1st 4 AT commands are to set the sms etc and set the sms to plain txt
the 5th is the mobile #
the 6th line is the SMS itself
the 7th is the end of that txt and must close with a CTRL-Z

now i have tried it with runscript (ofcourse with the send cmd) but this doesnt work then i tried it with minicom -S
but then it wont exit ofcourse no idea how i do this.

the most important thing is after the txt mesage i have to close with a CTRL-Z also know as /z or ^z

im lost anyone ideas how to solve this issue.
Note the txt message must be at the end variable

thnx for the help

hmm maybe the programming section was more wise ....

narmida 10-13-2005 08:06 AM

kick....sry

myrmidon 09-24-2009 02:05 PM

Hi,

try the following :

Code:


echo "ATZ0" > /dev/ttyACM0      # or echo -e "ATZ0\r" > > /dev/ttyACM0
echo "AT+CSCA?" > /dev/ttyACM0  # or echo -e "AT+CSCA?\r" > /dev/ttyACM0
echo "AT+CMGF=1" > /dev/ttyACM0  # or echo -e ... You got the picture
echo "AT+CNMI=2,1" > /dev/ttyACM0      # or echo -e ....You got the picture
echo "AT+CMGS=+31612345678" > /dev/ttyACM0 # or echo -e ...You got the picture
echo -e "text\32" > /dev/ttyACM0


cheers ...


All times are GMT -5. The time now is 09:45 AM.