SMS on PI

2356 0

SMS on your Raspberry Pi…

Adapted from :  http://www.smssolutions.net/tutorials/gsm/receivesmsat/

This assumes you have set up your sim card, wired your modem correctly to your Pi, and are using a terminal program such as minicom.

You may need to read above and activate your SMS or storage method before the following commands will work.

For FONA, Sim800, Sim808, sim900, and sim908 based modems, the commands below should work out of the box.

Listing the messages

Once you have successfully set the messages storage, you can list the messages available using the list command:

AT+CMGL=”ALL” <ENTER>

Please not that “ALL” has to be send in uppercase on some modems. The modem will respond with a list of decoded SMS messages:

The response messages are formatted like this:

+CMGL: <index>,<status>,<from_address>,<mr>,<scts><CRLF><data>

index The memory index number, use this index to read or delete this message.
status The status of this message. For received messages this can be “REC READ” or “REC UNREAD” depending on whether the messages has been read or listed before.
from_address The subscriber number of the person who sent the message.
mr The reference number of this message. Most modems keep this field empty.
scts The time the message was forwarded to this phone or modem.
data The actual message data in plain text

Reading a message

To list a single message, you have to use the read command. You must use the list command first, so you know the indexes of the messages in the storage. For instance, to read the message on memory location ‘2’ use:

AT+CMGR=2 <ENTER>

The modem will list the single message:

Please note that the status of the message is now “REC_READ” instead of “REC_UNREAD” because we read the message.

Deleting a message

Once you have read a message, you can free the memory by deleting the message from the storage. For instance, to delete the message on memory location ‘2’ use:

AT+CMGD=2 <ENTER>

The modem will delete the single message.

Facebooktwitterredditpinterestlinkedinmail

Related Post

Add Clock Via i2c

Posted by - October 24, 2015 0
Prepare i2c added real time clock driver to raspian Add time variable to picture display Solder pins to clock module…

LED Blinking

Posted by - August 15, 2015 0
You will need the following things: Raspberry pi configured (see previos lessons) 5 Volt LED bulb(s) 2 jumper wires m/f…

Identify USB device and discover its name and port

Posted by - October 17, 2015 0
Download latest PyUSB from : http://sourceforge.net/projects/pyusb/files/PyUSB%201.0/1.0.0-beta-2/pyusb-1.0.0b2.tar.gz/download Place file “pyusb-1.0.0b2.tar.gz” on your desktop gunzip <pyusb-1.0.0b2.tar.gz |tar xvfp - cd pyusb-1.0.0b2 sudo ./setup.py…

google map link

Posted by - October 18, 2015 0
http://www.google.com/maps/place/40.625027,-73.957774/@40.625027,-73.957774,17z Change RED part to current GPS in Python   http://maps.google.com/maps?q=40.37494164,-73.57485968   Keep Reading : GPS AT Commands GPS RESPONSE…

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.