How to sort or list received "UNREAD" SMS messages


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938

    Default Read "UNREAD" SMS messages one-by-one

    Hi pedja089,

    Read one by one UNREAD MSG
    I think, that's where I'm currently stuck - I have no idea how to achieve this (appart from using command AT+CMGR=n but this implies I have listed/sored the message's index before), reading messages one-by-one. All AT commands I know will list the SMS messages and (unfortunately) change their status from "REC UNREAD" to "REC READ" despite I didn't really read them.

    I just noticed that, whenever an SMS message is received by the SIM7600E module I use, I get this through the UART interface:
    +CMTI: "SM",n where "n" is the number (or index) of this SMS message.

    I could store the message's index into an array an treat them on-by-one. But what if I miss one of these +CMTI information? What if my PIC is doing something else than "listening" to incoming messages?

    I'm confused since I can't make sure that I wont miss any incoming message.

    Since I don't see how to list unread messages one-by-one (can't find any info about this way of doing), should I go for listing all "REC UNREAD" messages and store their index in a list and parse them from now on "one-by-one"? Is this the way?
    Last edited by flotulopex; - 30th January 2021 at 18:17.
    Roger

  2. #2
    Join Date
    Sep 2009
    Posts
    755

    Default Re: How to sort or list received "UNREAD" SMS messages

    Oh, I see now...

    Use AT+CMGR=, and just list all indexes.
    And delete that index as soon as PIC receive whole MSG.
    Also you can use AT+CMGL="ALL",1 to not change status...
    EDIT:

    https://simcom.ee/documents/SIM900/S...nual_V1.11.pdf

    Look at 4.2.3 AT+CMGL and 4.2.4 AT+CMGR
    Last edited by pedja089; - 30th January 2021 at 18:22.

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938

    Default Re: How to sort or list received "UNREAD" SMS messages

    Quote Originally Posted by pedja089 View Post
    Also you can use AT+CMGL="ALL",1 to not change status...
    Okay, this is new to me.

    I'll give it a try right now - thanks a lot
    Roger

  4. #4
    Join Date
    Sep 2009
    Posts
    755

    Default Re: How to sort or list received "UNREAD" SMS messages

    Look at EDIT in prev. post.
    But I prefer described way, to list index one by one, and when pic receive MSG delete.
    Do this one per second, and I cant have more than 1 or 2 unread msg. And then it is easy to get correct order, and everything else.
    I have done that in past, if I can remember...

  5. #5
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938

    Default Re: How to sort or list received "UNREAD" SMS messages

    Thanks pedja089, I'll give it a try the way you suggest
    Roger

  6. #6
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938

    Default Re: How to sort or list received "UNREAD" SMS messages

    Well, the AT+CMGL="ALL",1 doesn't exist (at least not for the SIM7600E module).

    What it's datsheet says:
    Name:  K640_000606.JPG
Views: 806
Size:  20.1 KB
    Roger

Similar Threads

  1. How to do the "SerIN" and "SerOut " for the usb ?
    By vicce67 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 13th March 2015, 02:01
  2. Replies: 0
    Last Post: - 14th November 2013, 03:32
  3. Replies: 3
    Last Post: - 15th October 2012, 08:06
  4. Replies: 11
    Last Post: - 19th August 2009, 15:23
  5. Replies: 1
    Last Post: - 16th February 2005, 20:05

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts