-2

I'm using gsm modem to send sms, via a terminal there's no problem but i want to write a shell script (called by php) and i want to know how insert AT command in.

Example :

  • call the script.sh
  • the script open minicom (sudo..)
  • type : AT+CMGS="num" + ENTER + "Message" + ctrl+Z and send the sms to the num.

Thank you Victor

Mayank Patel
  • 3,868
  • 10
  • 36
  • 59
  • The reason this question gets downvotes is that without any code it appears at first glance as a "please do the work for me" question, and Stackoverflow is not the place for such. With a little effort I able to read a valid question, but it is easy to overlook for someone just spending a couple of seconds reading it and then downvote. – hlovdal Jan 19 '16 at 21:58

1 Answers1

0

For the time being1 I think your best option here is to use the programming language . It is written to monitor growing text output and support scenarios like

  1. Wait for the string "Username:" to appear in the output.
  2. Send the string "my_name".
  3. Wait for the string "Password:" to appear in the output.
  4. Send the string "my_secret_password".

Sending AT command and waiting for the response is very similar, so this is absolutely doable. When I worked at Ericsson we had a test suite written in expect that sent AT commands and parsed log files to run tests.


1 As a companion to my atinout program, I have started to write a program to send the command AT+CMGS and its payload correctly. But unless you are very, very patient you should not wait for this to be finished.

hlovdal
  • 26,565
  • 10
  • 94
  • 165