Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Why i m not receiving correctly the SMS over length of more the a page Using AT Commands???

  1. #1
    Junior Member
    Join Date
    May 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Why i m not receiving correctly the SMS over length of more the a page Using AT Commands???

    i m working on the SMS receiving using AT Commands using JAVA. i m getting the message of one page correctly using AT commands, but as i increase the size of SMS as 2, 3 or bigger pages the alphabets are converted to some thing like this
    +CMGL: 0,"REC UNREAD","+923028910082",,"14/05/10,19:32:40+20"
    4469616C202A3334352A393333232061757220536972662052 732E3230206D65696E20332064696E206B6120696E7465726E 65742028333030204D422920686173696C206B6172656E2120 7777772E776170747269636B2E636F6D2070657220736F6E67 73206175722067616D657320656E6A6F79206B6172656E2120 42616C616E636520636865636B206B206C7965202A39393923 206D69

    whats the problem i m not getting the right text which i have sent through my mobile phone.
    please help me out it very urgent

    my function of receiving SMS is as follows
    public void send(String cmd) {
        try {
          outputStream.write(cmd.getBytes());
        } catch (IOException e) {
          e.printStackTrace();
        }
      }
    public void recieveMessage() throws InterruptedException, IOException{
     
           send("AT+CMGF=1\r");    //send ok if suport txt msg
            Thread.sleep(100);
     
     
     
            send("AT+CMGL=\"REC UNREAD\"\r");  //return list mesgs received on gsm modem
     
     
             byte[] readBuffer = new byte[2048];
                    try {
     
                        InputStream inputStrea = null;
                        inputStrea=serialPort.getInputStream();
                        int numBytes = inputStrea.read(readBuffer);
     
                        //print response message
                        String st=new String(readBuffer);
                        st=st.trim();
     
     
                        System.out.println(st);
     
                        setRecieveMsg(st);
                    } catch (IOException e) {
                    }
                    send("AT+CMGD=1,4\r");
    }
    Last edited by Sanaullah; May 14th, 2014 at 01:44 PM.


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Why i m not receiving correctly the SMS over length of more the a page Using AT Commands???

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    Please post your code correctly.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Why i m not receiving correctly the SMS over length of more the a page Using AT Commands???

    Also posted at: Why i m not receiving correctly the SMS over length of more the a page Using AT Cmand
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Replies: 1
    Last Post: March 18th, 2014, 02:56 AM
  2. Help with a class (only receiving the last value instead of all)
    By tonynsx in forum What's Wrong With My Code?
    Replies: 2
    Last Post: November 15th, 2013, 11:53 AM
  3. Sending and Receiving File
    By beer-in-box in forum Java Networking
    Replies: 8
    Last Post: March 31st, 2013, 07:57 PM
  4. receiving emails through spring
    By the light in forum Web Frameworks
    Replies: 0
    Last Post: October 18th, 2011, 01:55 AM
  5. servlet not receiving any data
    By vishal21 in forum Java Servlet
    Replies: 0
    Last Post: March 14th, 2011, 01:01 PM

Tags for this Thread