Topic: send sms using AT command

Hi,

I am having a project on Ruby and Rails and I need to send sms. I have decided to use AT command in it. What I need to do is just to create a simple application. In the application, the code using ruby will need to extract a .text from a specific folder and send the data as sms. So is there any kind sole can provide me with a skeleton code so at least i know where to start.

Thanks a million, your help is much appreciated.
Pls pls reply asap.

Last edited by notsure103 (2008-01-22 10:02:05)

Re: send sms using AT command

SMS using hyperterminal?? I don't understand why you'd have to use hyperterminal to send an sms.

There are lots of examples, plugins, and libraries to help you out:
http://www.google.com/search?q=rails+SM … =firefox-a

Re: send sms using AT command

HI,

Thanks for your reply, but those links which u have listed above i have search them through but its not what i want. What i have here will be an example of codes but its in C#, which is not i want. What i needed will be codes somehow like this, but in ruby and rails.

* Full sample code in c#

       // Create Serial port instance
        private SerialPort srpModemPort = new SerialPort();

        // Form load event
        private void ManagementScreen_Load(object sender, EventArgs e)
        {           
            srpModemPort = new SerialPort();
            srpModemPort.PortName = "COM3";
            srpModemPort.BaudRate = 115200;
            srpModemPort.Parity = Parity.None;
            srpModemPort.DataBits = 8;
            srpModemPort.StopBits = StopBits.One;
            srpModemPort.Handshake = Handshake.RequestToSend;
            srpModemPort.DtrEnable = true;
            srpModemPort.RtsEnable = true;
            srpModemPort.NewLine = System.Environment.NewLine;

            srpModemPort.DataReceived += new SerialDataReceivedEventHandler(OnCom4Receive);
        }

        // Receive the answers from the modem
        private void OnCom4Receive(object sender, SerialDataReceivedEventArgs e)
        {
            try
            {
                MessageBox.Show(srpModemPort.ReadExisting());
            }
            catch (Exception exc)
            {
                MessageBox.Show("Error receiving the answer. Reason:" + exc.Message);
            }
        }

        // The method that sends the at command
        private void sendSMS()
        {
            if (!srpModemPort.IsOpen)
                srpModemPort.Open();
            srpModemPort.WriteLine("AT+CMGS=" + txtPhone.Text + "\r" + " This is the message content followed by Ascii code for end-of-file marker or Ctrl+Z." + (char)(26));
        }

        // ********************************
        // Send SMS button clicked
        private void button1_Click(object sender, EventArgs e)
        {
            sendSMS();
        }

Re: send sms using AT command

You could give SMS Fu a try.  It allows you to deliver a text message to a cell phone through ActionMailer.

http://code.google.com/p/sms-fu/

Re: send sms using AT command

Have a look at Peter Cooper's snippet for sending SMS's with Ruby and a GSM/GPRS Modem