Using GPRS module to send SMS and call under Linux

Source: Internet
Author: User

first, the development environmentkernel version: linux-3.0
Development Board: FL2440 (nandflash:k9f1g08 128M)
GPRS module: SIM900 

Second, with texting and dialing related to the AT command

AT+CMGC Send an SMS command (issue a short message order)

AT+CMGD Delete SMS message (deletion of the SIM card memory for short messages)

AT+CMGF Select SMS message formate (select Short Message message send and receive format: 0-pdu;1-text)

AT+CMGL list SMS message from preferred Store (list short messages in SIM card

At+cmgr read SMS message (reading short messages)

At+cmgs Send SMS message (send short messages)

AT+CMGW write SMS message to memory (writes a short message to the SIM memory for outgoing messages)

AT+CMSS Send SMS Message from storage (SIN | M send short message in memory)

At+cnmi New SMS message indications (show newly received short message)

At+cpms Preferred SMS Message storage (select Short Message memory)

At+csca SMS Service Center address (Short Message center addresses)

AT+CSCB Select cell Broadcast messages (select cellular Broadcast message)

AT+CSMP set SMS text mode parameters (set short message textual pattern parameters)

AT+CSMS Select Message Service (choose SMS)

at+cnmi=2,1,0,0,0//Set to receive new SMS messages stored in SIM card concurrent CMTI notification

+CMTI: "SM", 1//Received SMS, Auto popup, where 1 indicates the presence of the serial number in the SIM

At+cmgr=1//Read SMS, where 1 to correspond to the above serial number

at+cmgd=1//delete SMS, where 1 is SMS serial number

Ok

ATD dialing Commands. This command is used to set up calls, data, or fax calls.

example ATD13844019770;
ATH Hang command.
ATA answer phone.

There are two ways to send short messages: PDU and text mode, text mode only supports transmitting English and digital information, but it is much simpler than PDU mode, so it is recommended to use Txet mode to send and accept short messages. (The following is demonstrated in text mode)

Iii. preparatory work

GPRS module is a GSM module with GPRS data transmission function. GPRS module is a compact version of the mobile phone, integrated GSM communication is the main function of a circuit board, with the sending of short messages, calls, data transmission and other functions. GPRS module is equivalent to the core of the mobile phone, if the addition of keyboard and screen is a complete mobile phone. Ordinary computer or SCM can be connected with GPRS module via RS232 serial port, and the GPRS module based on command is implemented to realize various GSM communication functions. The production line will be GPRS module serial port and Development Board serial port connection (I am connected to the development of the second serial port, because the first perforation connected to the PC), and then the available mobile SIM card into the GPRS module card slot; then start the Development Board, connect the GPRS module power supply, Then press the GPRS module SW1, let Sim start to work, search network This is the light emitting diode D3 will blink.

Four, the process example:

If the kernel adds a serial port driver execute the following command, you will see the serial device:

[[email protected]/]# ls dev/

TD2 null tty3 ttyS0
mtd2ro pcmc0d0c tty30 ttyS1
mtd3 pcmc0d0p tty31 ttyS2
[[email protected]/]# microcom-s 115200/dev/ttys1 (microcom command production and file system BusyBox will be added, here the/dev/ttys1 need to be based on your GPRS connection Pick up the serial port of the board)

At (returning OK indicates that your module is working properly, otherwise there is a failure.) )
Ok

At+cops? (operator, I use Unicom)
+cops:0,0, "chn-unicom"

AT+CSQ (view SIM signal quality)
+csq:23,0

Ok

At+cpin? (Query status, module ready to print as follows)
+cpin:ready

Ok

At+cmgf=1//First SMS format to text mode, if 0 is PDU format
Ok

at+cscs= "GSM"//Set character format to GSM mode
Ok

Some say before texting to set the SMS Center number example: At+csca= "+86138xxxxxxxx", but I do not have settings can be sent text messages, such as the following

at+cmgs= "13007110996"//Enter phone number

> zhouyou,hello! After the > input text message content, not enter key input, remember to press CTRL + Z, if wrong, you can press ESC to return

+cmgs:36

OK//Flag to send success

ATD13007110996; Call, note that the semicolon can not be dropped, dial successfully returned OK, plug in the headset with the microphone can talk
Ok

ATH//Hang Phone command, return OK after success
Ok

Ring//When you call, the ring will continue to print

RING
ATA//Answer command, return OK after success
Ok
ATH
Ok

If the serial port does not output, check to see if the serial line is good, the baud rate is correct, generally our baud rate is set to 115200.

Using GPRS module to send SMS and call under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.