Quectel m66 send sms
Sending and receiving SMS with a GSM shield is quite straightforward but without starting to write your code you should understand how they work. We will actually see and program what your cell phone does when you try to send an SMS.
SMS Configuration for receiving and sending SMS via GSM Shields
First of all, you need to read the datasheet of your GSM module carefully. All information that you are going to need is there but still there are few things might be tricky. In my example I am going to use Sixfab’s GSM shield which use Quectel M66 Module and Raspberry Pi 3. You can buy only the module as well but you need to make circuit for power and serial communication.
Datasheet and commands manual can be found on the manufacturer website. Alike to other modules, this module is also well documented. It should not be forgotten that this module can be programmed via serial communication. So before going ahead module should be powered up (in my case it is 5V) and RX (Module) – TX (Raspberry), TX (Module) – RX (Raspberry) connection should be wired.
After connection has been done, first command would be AT. Datasheet says the response of the AT command should be OK when module properly powered up.
Configuration
serialPrintf(fd,"AT+CPIN="); //Send PIN
serialPrintf(fd,simPin.c_str());
serialPrintf(fd,"\n");
serialPrintf(fd,"AT+IFC=1,1\n"); // Set TE-TA Control Character Framing
delay(300);
serialPrintf(fd,"AT+CMGF=1\n"); //Select sms format
delay(300);
serialPrintf(fd, "AT+CSMP=\"SM\",\"SM\",\"SM\"\n"); //Set SMS Text Mode Parameters
delay(300);
serialPrintf(fd,"AT+CLIP=1\n"); //Calling Line Identification Presantation
delay(300);
serialPrintf(fd,"AT+COLP=1\n"); //Connected Line Identification Presentation
delay(300);
serialPrintf(fd,"AT+CSCS=\"IRA\"\n"); //Select TE Character Set
delay(300);
serialPrintf(fd,"AT+QCCID\n"); //Show ICCID
delay(300);
serialPrintf(fd,"AT+CIMI\n"); // Request IMSI
These lines would be enough to configure shield. Delay times are set to maximum response times according to information in command manual.
Sending Sms
Sending SMS command requires certain sms message format and character set to the certain character set. We did it in the configuration above. Also to send sms, module should support Send Sms or Send Sms From Storage.
Sytanx of sending SMS is AT+CMGS=”+905361234567″<CR>Example message body<Ctrl+z>
(<CTRL+Z> is ASCII 26 and <CR> is ASCII 13).
The response should be OK and it can be read from any serial monitor. If it is error, with the correspond error code, reason can be found in the command manual again.
Quectel m66 send sms
- Comments(1)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Muharrem Arslan
-
-
-
-
-
-
3D printed Enclosure Backplate for Riden RD60xx power supplies
159 1 1 -
-