-1

I'm trying to send and receive SMS via a Huawei e153s USB HSPA Dongle connected to an Ubuntu Laptop. I use a minicom emulator to make the SSH connection. After doing the configurations (setting serial ports, etc.) I tried AT commands one by one.

First I set the modem mode to text mode by AT+CMGF=1. When I entered AT in terminal then it gives OK. After that I successfully sent a message to my mobile using AT+CMGS="xxxxxxxxxxx" command but the problem occurs when I tried to read a SMS in the SIM card which I inserted into the dongle. I used AT+CMGL but it only shows a OK in terminal 1 (where i opened minicom) and terminal 2 shows

T+CMGL
OK

and when I use AT+CMGR=1 it shows OK in terminal 1 and terminal 2 shows

T+CMGR1
OK

I tried above commands in Ubuntu terminal by using PPP such as

chat TIMEOUT 1 "" "AT+CMGF=1" "OK" > /dev/ttyUSB0
chat TIMEOUT 1 "" "AT+CMGR=1" "OK" > /dev/ttyUSB0

and watched the output thruogh another terminal (terminal 2) window which shows the file /dev/ttyUSB0 using cat /dev/ttyUSB0. (ttyUSB0 is the serial port belongs to the dongle. I returned it through the wvdialconf)

but they give the same results as same as previous ones.

Why doesn't that show the content of the message?

ThilankaD
  • 1,021
  • 1
  • 13
  • 24
  • Tip: you can use the [atinout](http://atinout.sourceforge.net/) program to run AT command from the command line: `(echo AT+CMGF=1; echo AT+CMGR=1) | atinout - /dev/ttyUSB0 -`. – hlovdal Sep 28 '16 at 23:29

1 Answers1

1

I guess you first need to select the message storage (AT+CPMS=XX), then list messages in that storage (AT+CMGL="ALL"), and then when you have a valid index of a message read it (AT+CMGR=X).

Have a look at this article: http://www.smssolutions.net/tutorials/gsm/receivesmsat/

dekkard
  • 6,121
  • 1
  • 16
  • 26
  • 1
    I figured out that the reason to happen above problem is the SMS inbox of the sim is empty. Then I sent a sms to sim card and selected the message storage.then it works fine, thanks... – ThilankaD Apr 26 '15 at 06:56