Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

receiving and sending sms through gsm modem

Tags:

java

sms

How can I receive SMS through a GSM modem so that I can use this SMS for further processing and send back a reply SMS. I do not have particular idea on how to achieve this....... I prefer using java language for this project and I am using Linux OS.

like image 911
haedes Avatar asked Feb 22 '12 10:02

haedes


People also ask

Can GSM module receive messages?

The mobile phones have built in GSM modules which then be used by the processor inside the phone to make a call, send or receive message or even connect with the GPRS network.

Is GSM used for SMS?

SMS was originally designed as part of GSM, but is now available on a wide range of networks, including 3G networks.

What is GSM modem and how it works?

A GSM modem or GSM module is a device that uses GSM mobile telephone technology to provide a wireless data link to a network. GSM modems are used in mobile telephones and other equipment that communicates with mobile telephone networks. They use SIMs to identify their device to the network.

How can I send SMS from router?

Send SMS MessageGo to LTE >> Send SMS, enter Recipient Number and Message. Then click Send Message to send. Check the SMS inbox of the recipient. It should get a message from the router.


2 Answers

You might want to give a look at SMSLib:

SMSLib is a programmer's library for sending and receiving SMS messages via a GSM modem or mobile phone. SMSLib also supports a few bulk SMS operators.

like image 60
npinti Avatar answered Sep 22 '22 19:09

npinti


To send an SMS using a 3G modem, you need to use the appropriate AT commands. First you need to set the modem to text mode:

AT+CMGF=1

Then you send your message:

AT+CMGS=<number><CR>
<message><CTRL-Z>

Where <CR> is a carriage return (ASCII 13), and <message> is the message you want to send, <CTRL-Z> is ASCII 26, and <number> is the number you want to send your message to.

To read received messages, you do this:

AT+CMGL=<stat><CR>

Where <stat> is one of: "ALL", "REC UNREAD", "REC READ" (with the quotes), meaning all messages, unread messages, and read messages respectively.

To do this in Java you'll need to use the Java communications API. Here's a short example: http://java.sun.com/products/javacomm/reference/docs/API_users_guide_3.html

like image 45
cha0site Avatar answered Sep 20 '22 19:09

cha0site