Send SMS using AT command in LabWindows?

I managed to call..using the ATD command but now I am having problems in sending a SMS message..
In hyperterminal the commands are the following:
AT+CMGF=1 \r
AT+CMGW="0040766562692" \r
The GSM / GPRS modem will then return a prompt "> " and you can start typing the SMS text message.
>Have a nice day.
When finished, press Ctrl+z of the keyboard.
Here is what I tried to do...but nothing happens:
int commandSendSMS()
      char bW1[100];
      Fmt(bW1,"%s","AT+CMGF=1\r");
   ComWrt(4, bW1, 10);
   Fmt(bW1,"%s","AT+CMGW=\"0040766562692\"\r");
   ComWrt(4, bW1, 25);
   Fmt(bW1,"%s","Have a nice day.\032" );  
   ComWrt(4, bW1, 18);
      return 0;
I use \032 to replace <ctrl+z> is that correct?
What am I doing wrong...please help!

Ok, the situation seems to be a bit more clear now. Here what I would do, using GetInQLen and ComRd to test answers from the modem:
   char   bW1[64], msg[512];
   // Send first part of the commands
   strcpy (bW1, "AT+CMGF=1\r");
   ComWrt (4, bW1, strlen (bW1));
   Delay (0.1);
   strcpy (bW1, "AT+CMGW=\"0040766562692\"\r");
   ComWrt (4, bW1, strlen (bW1));
   Delay (0.1);
   // Test for answer from the modem
   ComRd (4, msg, GetInQLen (4));
   if (!strlen (msg) || strcmp (msg, "> ")) {
      MessagePopup ("Error", "No answer from the modem or incorrect answer!");
      goto Error;
   // Send SMS text to the modem
   strcpy (bW1, "Have a nice day.\032" );  
   ComWrt (4, bW1, strlen (bW1));
   Delay (0.1);
   // Test for answer from the modem
   ComRd (4, msg, GetInQLen (4));
   if (!strlen (msg) || strncmp (msg, "+CMGW", 5)) {
      MessagePopup ("Error", "No answer from the modem or incorrrect answer!");
      goto Error;
   // Find ref number and issue the command to actually send the message
   Scan (msg, "%s[dtzz]%d", &x);   // substitute 'zz' with ASCII code for ':'
   sprintf (bW1, "AT+CMSS=%d\r", x);
   ComWrt (4, bW1, strlen (bW1));
I wrote this code from memory: please double check and complete it before running it.
Proud to use LW/CVI from 3.1 on.
My contributions to the Developer Zone Community
If I have helped you, why not giving me a kudos?

Similar Messages

  • Sending SMS using PL/SQL

    hello friends..
    i want to send sms using pl/sql.. so i tried send_email procedure..
    but how to find Mobile Address:- to send email(sms) ?
    [email protected] - how to find domain name
    can any one help me..
    Thanks
    PROCEDURE SEND_EMAIL(pFmUser IN VARCHAR2,
    pToUser IN VARCHAR2,
    pSubject IN VARCHAR2 DEFAULT NULL,
    pBody IN VARCHAR2 DEFAULT NULL) IS
    SenderName VARCHAR2(50);
    SenderAddress Varchar2(200); -- := '<[email protected]>';
    vToReceivers varchar2(200);
    EmailServer varchar2(200); --:= 'smtp_server';
    ServerPort NUMBER:=25;
    UserName VARCHAR2(200);
    UserPass VARCHAR2(200);
    conn UTL_SMTP.CONNECTION;
    crlf VARCHAR2( 2 ):= CHR( 13 ) || CHR( 10 );
    mesg VARCHAR2( 4000 );
    mesg_body varchar2(4000);
    vCount NUMBER:=0;
    vNextPos NUMBER:=0;
    vStr NUMBER:=0;
    vPos NUMBER;
    vChk NUMBER;
    pToList VARCHAR2(4000);
    BEGIN
    conn:= utl_smtp.open_connection( EmailServer, ServerPort);
    utl_smtp.ehlo(conn,EmailServer);
    --utl_smtp.helo( conn, EmailServer );
    utl_smtp.command( conn, 'AUTH LOGIN');
    utl_smtp.command( conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( UserName ))) );
    utl_smtp.command( conn, utl_raw.cast_to_varchar2( utl_encode.base64_encode( utl_raw.cast_to_raw( UserPass ))) );
    utl_smtp.mail( conn, SenderAddress);
    utl_smtp.rcpt( conn, pToList);
    mesg:=
    'Date: '||TO_CHAR( SYSDATE, 'dd Mon yy hh24:mi:ss' )|| crlf ||
    'From: "'||SenderName||'" '||SenderAddress|| crlf ||
    'Subject: '||pSubject|| crlf ||
    'To: '||pToList|| crlf||
    pBody||crlf||crlf;
    utl_smtp.data( conn, mesg );
    utl_smtp.quit( conn );
    EXCEPTION
    WHEN OTHERS THEN RAISE_APPLICATION_ERROR(-20001,SQLERRM);
    END;

    user10502250 wrote:
    i want to send sms using pl/sql.. so i tried send_email procedure..
    but how to find Mobile Address:- to send email(sms) ?
    [email protected] - how to find domain name
    Exactly. You cannot simply send a SMS as an e-mail. The mail (SMTP) server needs to have a plug-in of sorts that enables it to forward a specially formatted e-mail it receives as an SMS.
    More then a decade ago, some cellular providers provided such mail servers - allowing you to specify the cellular number as either the recipient address or as the e-mail subject, with the body containing the actual SMS message.
    Due to this feature being abused and the cost of SMS transport being unrecoverable, this (as a public feature) has long since been discontinued by most, if not all, cellular network providers.
    So no, there is no magic domain(s) you can use to (spam) mobile numbers with SMS.
    If you want a SMS solution, you need to talk to a cellular provider about the products they have for 3rd party SMS integration.
    Alternatively, you need to use a dedicated cellphone, hooked up via USB/Bluetooth to a server, and use that as your SMS transport mechanism.

  • I cannot send sms using TC65 modem

    I wrote test program to send sms. When program tryig to open conection(MessageConnection), he catches ConnectionNotFoundException (null):
    String url = "sms://+37256844491";
    MessageConnection mc = (MessageConnection)Connector.open(url);
    Does anybody can help me?

    I need to make communication via sms between phone and modem. It is not good if these sms messages will be stored in memory of a mobile phone or modem. For this i need to recieve and transmit these messages using current sms port, then i'll be able to intercept them and they will not be stored in memory of a mobile phone or modem.
    If modem supports this kind of sms sending - via GPRS connection. Why i cannot use wma classes, which give me the opportunity to send sms using their methods? It is something unreal.
    Maybe problem in configuration of GPRS connection. I know that this configuration is made by "AT^SJNET" command. Example: AT^SJNET="gprs","*99***1#","internet","","",30. These settings are used by "(MessageConnection)connector"
    I configured many others settings at the modem using AT commands, which are need to connect to the Internet via GPRS.
    Maybe i don't know some nuances.
    I tried to connect to the Internet via GPRS connection from my PC and i got this connection. I tried to connect using AT commands and i did not get it.
    If i told something wrong, please correct me.
    Edited by: _denisjuk on Nov 17, 2007 4:18 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Want to send sms using java

    I am developing a stand alone application in java that contains sending sms to certain numbers.
    I want to send sms using java and my phone connected to my pc by usb cable(Not through Bluetooth).
    I am using Linux operating system (Arch linux).
    I tried a few libraries that uses the the online sms portals,but for some reasons i dont want to pay those sites.(just want it to be done using my simcard cause its economical).
    Help appreciated

    880667 wrote:
    I am developing a stand alone application in java that contains sending sms to certain numbers.
    I want to send sms using java and my phone connected to my pc by usb cable(Not through Bluetooth).
    I am using Linux operating system (Arch linux).
    I tried a few libraries that uses the the online sms portals,but for some reasons i dont want to pay those sites.(just want it to be done using my simcard cause its economical).
    Help appreciatede First thing you need to check: are you able to access other services my connecting you mobile by USB to machine (Line GPRS, calling). Because it requires the calling or SMS port access. And you said it is economical by sending SMS using mobile it depends. But most of the times, it is better to use the SMS service provider getway. They provide the details either http or FTP, we just need to put or message in the accepitng form, rest of the things are done by the service provide.

  • How to send SMS using java

    Dear All
    How we can send SMS(Short Message Service) to mobile phones using java.
    By Registering in some sites and using that user name and password we can send SMS.
    But after some limited SMS we have to pay for further use.
    I need some thing which we can use as free.
    Can any one help me
    Thanks in Advance

    The easiest way would be to send a regular email to a Email to SMS gateway.
    Check out the list of Email to SMS gateways at http://en.wikipedia.org/wiki/SMS_gateways

  • Sending SMS using mobile phone connection.

    Hi all,
    I want to develop a feature to send SMS from my java application by using mobile phone.
    I am new to java.
    tell me how to connect the mobile phone from my applicatio and how do i send the SMS.
    Hoping your help sooner....
    Thanks and regards,
    Suresh Dhandauthapani.

    Hi junaid,
    Thanx for the response...One more doubt....Is it possible to send sms from pc to mobile directly using the sms server without the intervention of a service provider?If yes plzzz suggest me the steps to establish such a setup.
    Once Again..Thanx in Advance...
    R.PRASATH KRISH...
    Message was edited by:
    RPRASATHKRISH

  • Send SMS using CL_BCS fail

    Hi
    I have created a HTTP node in SCOT called SMS for sending SMS's to customers. In my program I use class CL_BCS to send the message. But the message is never sent. In SOST I see the error: Cannot process message, no route from <user> to <phone number>. I think the reason is that in SCOT (System Status) the messages are under PAG but not in my node 'SMS' as I expected but in W/o nodes. Any ideas why the message is not correct node?
    CODE:
      CALL METHOD CL_BCS=>CREATE_PERSISTENT
        RECEIVING
          RESULT = lr_sms.
      CALL METHOD CL_DOCUMENT_BCS=>CREATE_DOCUMENT
        EXPORTING
          I_TYPE        = 'RAW'
          I_SUBJECT     = 'TEST'
          I_TEXT        = lt_text
        RECEIVING
          RESULT        = lr_document.
      l_sms_num = i_mobile.
      CALL METHOD CL_CAM_ADDRESS_BCS=>CREATE_SMS_ADDRESS
        EXPORTING
          I_SERVICE = 'SMS'
          I_NUMBER  = l_sms_num
        RECEIVING
          RESULT    = lr_rec
      CALL METHOD lr_sms->ADD_RECIPIENT
        EXPORTING
          I_RECIPIENT = lr_rec
          I_EXPRESS   = 'X'.
      CALL METHOD lr_sms->SET_DOCUMENT
        EXPORTING
          I_DOCUMENT = lr_document.
      CALL METHOD lr_SMS->SEND
        RECEIVING
          RESULT = l_bool.
    I've made sure that settings in SA14 are maintained: Pager Service = SMS, USE = SMS Service

    thank you for looking into this thread,
    i have configured the in scot.
    currently sending all RAW type as TXT. this has resolved my issues.

  • Send SMS Using Oracle Database Automatically

    Hi ALL:
    I want to send SMS from Oracle Database 9i automatically. Which reg. software can I use?

    Hello,
    Here is the Oracle Forms forum.
    You would have more chances to get answers by posting in the Database forum ;D
    Francois

  • Is it possible to send sms using java ?

    dear all ,
    I am doing one project . In which i want to send sms to mobile phone using java
    Any one knows please help me immediately ......
    I want this one to be immediately ...
    Thank you

    The answer's right here...
    http://www.java-answers.com/index.php?topic=12.0

  • Is it possible to send sms using N-GAGE -qd?

    Hello Friends,
    If we want to send sms, we have to register our sms connection using "PushRegistery", so that AMS can take care of this connection. but there is no PushRegistery api in MIDP1.0 that n-gage needs.
    so what is the way for N-GAGE-QD/MIDP1.0.
    Is there any alternative for PushRegistery?

    Hello Friends,
    If we want to send sms,
    we have to register our sms connection using
    "PushRegistery", so that AMS can take care of this
    connection. but there is no PushRegistery api in
    MIDP1.0 that n-gage needs.why do you need to register connection? is it specific to N-Gage?
    so what is the way for
    N-GAGE-QD/MIDP1.0.
    Is there any alternative
    for PushRegistery?use RMS...

  • Cannot send sms using pc suite Ver 7

    Hi - i have updated to pc suite version 7 - every time i send an sms it says message failed. Everything else is working fine - it seems pc suite will not pick up any of my message folders. Can anyone help please??? I am using the sirocco 8800

    Hi malakhi75,
    I can send sms from phone, but not thruogh Nokia Communication Centre. It seems to be an issue
    also find similar issue in
    /discussions/board/message?board.id=pcsuite&thread.id=27461

  • Code to send sms using j2ee application

    Hi all,
    this is shashi kant,
    plz send me the code to sent a sms using j2ee applications.
    or tell me the api these are used to  develop this kind of application.
    thanks
    my email id is---- [email protected]

    I'm working on a project to send SMS from a MIDlet
    to a servlet and back to the MIDlet through a
    SMSC.can anybody send a sample code for me to get
    help ?you should have a sms server .
    your MIDlet send the parameters to the servlet (mobile phone, message, ..) and, after, the servlet send a request to the sms center and he send to the mobile number the message !
    good luck

  • [Newbie] Can I send sms using J2ME WT ?

    Hi,
    i need to write a midlet (midp 1.0) able to send sms.
    (for Nokia midp1.0 phone)
    Using Wireless Toolkit can I do it?
    Or, as i think, i need anyway a midp 2.0 phone?
    Thanks for answer
    and sorry if this is an old answer
    Matteo

    thanks for answer.
    if i well understand, i cant add WMA package in my project to build an application that will work on phone not supporting wma ...i need that phone support s WMA in own hardware..
    and Nokia SMS API ?
    Can i use it on all j2me phone? Or i need that SMS Api are inside phone?
    is truth ?

  • How to send SMS using GSM modem?

    Hi everyone.
    I'm trying to send SMS through GSM Model connected to my PC using java Program.
    I've downloaded the javax.comm jar file.
    But they've specified that there is no such jar file for Windows OS. Also they've told to use the RXTX.org site to get the windows specific jar file.
    But i dont know how to do it.
    Can anyone help me with this issue?
    Thanks in advance..

    Also they've told to use the RXTX.org site to get the windows specific jar file.
    But i dont know how to do it.You don't know how to use the rxtx.org site?
    Is that a networking question? A Java networking question?

  • Help! Send sms using j2me

    Hi, i try to send a sms from my midlet to a smsc. It worked in wireless toolkit emulator (as seen from network monitor and WMA console). However, trying in real phone (Nokia 7610) it doesn't seems to send the sms out. Do anyone have experience in sending sms successfully via j2me installed in N7610? Please help me how to send sms or any special settings are needed in my Nokia 7610.
    A portion of my code is like that:
    MessageConnection outConn = (MessageConnection) Connector.open("sms://+106423");
    outMsg = (TextMessage) outConn.newMessage("text");
    outMsg.setPayloadText("testing");     
    outConn.send(outMsg);
    Please help.

    http://www.google.com/search?hl=en&q=J2ME+tutorial

Maybe you are looking for

  • Import photos to FCP Images stretch out

    While I import photos to FCP, it stretch the images, I have been change the images size to 720x480, and adjust setting to 16:9 or 4:3, the problem still there, look like wide screen images fitting into the full screen. any help will be appreciate. Tk

  • Unable to Copy to Purchase Order from a Quotation

    Hi All, Can anyone help with this problem: When I try to copy to a PO fro a PQ I get an error msg ' No matching records ODBC-2028'. This message appears after the PO form has opened with no lines copied. Thanks  Martin

  • Blendmodes or other ideas

    Let's say I have an imported png in the shape of a state. Of course the png is a rectangle, but the state (most of them anyways) isn't a rectangle. Then I want to cloak the whole state to make it greyish. But not have the grey cloak go outside the ir

  • Install Oracle Application Server 10.1.3 on OpenSuse 10 SP2

    Hi, I am trying to install Oracle Application Server 10.1.3 on OPENSUSE 10 SP2 and the install is failing when trying to start HTTP Server. OAS 10.1.3 has been installed on another OPENSUSE 10 SP2 however this was done by a previous colleague that ha

  • Latest developments in SD

    I have an interview qustion to prepare a presentation on related to SD. Its for an ABAP role as well.  Any pointers will be rewarded..thanks u2019What are the latest developments within the SAP Sales and Distribution module that you feel are relevant