I am using SIM808 to send SMS to a perticuar number. But when trying to set the number using AT+CMGS=XXXXXXX returns +CMS ERROR:325. I have set the AT+CSCS to GSM but still no luck.The following is the code:
import serial
import os, time
# Enable Serial Communication
port = serial.Serial("/dev/ttyUSB0", baudrate=9600, timeout=1)
# Transmitting AT Commands to the Modem
# 'rn' indicates the Enter key
port.write('AT'+'rn')
rcv = port.read(10)
print rcv
port.write('AT+CMGF=1rn')
time.sleep(10)
rcv = port.read(10)
print rcv
port.write('AT+CMGS='9912345678'rn')
time.sleep(2)
port.write('test msg')
time.sleep(2)
port.write(chr(26))
rcv = port.read(10)
print rcv
port.flush()
asked Dec 14, 2018 at 8:19
2
SIM808 expects that AT+CMGS command should enclose the mobile/cell number in double quotes. You have provided escape sequence for single quote.
Your code should be :
port.write(«AT+CMGS=»9912345678″rn»)
instead of
port.write(‘AT+CMGS=’9912345678’rn’)
Because you are providing single quotes escape sequence you get +CMS ERROR:325
error.
While providing mobile/cell number it is an good practice to include country code (in your case +91).
answered Dec 26, 2018 at 10:07
Dark SorrowDark Sorrow
1,56910 silver badges29 bronze badges
When sending a SMS, with a length of anywhere in-between 142-148 (inclusive) characters, the modem (im using sim800L) sends back «+CMS ERROR: 325», from which i understand is an input-error.
According to the internet, the SMS limit is 160 characters, and I believe this might be a serialport-gsm error, I am not sure though, and I might have setup the communication wrong.
The module is using firmware version 1418B04SIM800L24 and my serialport-gsm options are:
let options = { baudRate: 115200, dataBits: 8, stopBits: 1, parity: 'none', rtscts: false, xon: false, xoff: false, xany: false, autoDeleteOnReceive: true, enableConcatenation: true, incomingCallIndication: false, incomingSMSIndication: false, pin: '', customInitCommand: '', //logger: console }
On top of that, when sending 141 characters exactly, no error is thrown, but the SMS never gets sent, but anything below that seems to work. I am also able to send longer messages of around 440 characters no problem. Is anyone else experiencing this problem? I apologize if it is a mistake on my part.
Коды ошибок запуска программы и отправки СМС:
0 Сообщение отправлено, и модем/телефон подтвердил успешную отправку сообщения. 2 На компьютере нет указанного последовательного порта или не найден указанный конф. файл. 5 Не удалось открыть указанный порт COM ("нет доступа", скорее всего, порт был занят другой программой). 87 Ошибка в параметрах запуска программы или параметрах смс. 121 Нет ответа от модема. 1460 Нет ответа от модема (тайм-аут) 7012 Модем не найден 536870912 Ошибка отправки СМС. 536870929 Модем отклонил попытку отправки сообщения 536870931 Модем сообщил об ошибке отправки 536870932 Модем не сообщил результат отправки 536870933 Получен неправильный ответ модема 536870934 Ошибка ответа модема 536870935 Одна или несколько частей длинного сообщения не были отправлены из-за ошибок (этот код ошибки только для длинных сообщений) 536870936 Все части длинного сообщения не были отправлены из-за ошибок (этот код ошибки только для длинных сообщений)
Коды ошибок CME ERROR – GSM Equipment related codes
CME ERROR: 0 Phone failure CME ERROR: 1 No connection to phone CME ERROR: 2 Phone adapter link reserved CME ERROR: 3 Operation not allowed CME ERROR: 4 Operation not supported CME ERROR: 5 PH_SIM PIN required CME ERROR: 6 PH_FSIM PIN required CME ERROR: 7 PH_FSIM PUK required CME ERROR: 10 SIM not inserted CME ERROR: 11 SIM PIN required CME ERROR: 12 SIM PUK required CME ERROR: 13 SIM failure CME ERROR: 14 SIM busy CME ERROR: 15 SIM wrong CME ERROR: 16 Incorrect password CME ERROR: 17 SIM PIN2 required CME ERROR: 18 SIM PUK2 required CME ERROR: 20 Memory full CME ERROR: 21 Invalid index CME ERROR: 22 Not found CME ERROR: 23 Memory failure CME ERROR: 24 Text string too long CME ERROR: 25 Invalid characters in text string CME ERROR: 26 Dial string too long CME ERROR: 27 Invalid characters in dial string CME ERROR: 30 No network service CME ERROR: 31 Network timeout CME ERROR: 32 Network not allowed, emergency calls only CME ERROR: 40 Network personalization PIN required CME ERROR: 41 Network personalization PUK required CME ERROR: 42 Network subset personalization PIN required CME ERROR: 43 Network subset personalization PUK required CME ERROR: 44 Service provider personalization PIN required CME ERROR: 45 Service provider personalization PUK required CME ERROR: 46 Corporate personalization PIN required CME ERROR: 47 Corporate personalization PUK required CME ERROR: 48 PH-SIM PUK required CME ERROR: 100 Unknown error CME ERROR: 103 Illegal MS CME ERROR: 106 Illegal ME CME ERROR: 107 GPRS services not allowed CME ERROR: 111 PLMN not allowed CME ERROR: 112 Location area not allowed CME ERROR: 113 Roaming not allowed in this location area CME ERROR: 126 Operation temporary not allowed CME ERROR: 132 Service operation not supported CME ERROR: 133 Requested service option not subscribed CME ERROR: 134 Service option temporary out of order CME ERROR: 148 Unspecified GPRS error CME ERROR: 149 PDP authentication failure CME ERROR: 150 Invalid mobile class CME ERROR: 256 Operation temporarily not allowed CME ERROR: 257 Call barred CME ERROR: 258 Phone is busy CME ERROR: 259 User abort CME ERROR: 260 Invalid dial string CME ERROR: 261 SS not executed CME ERROR: 262 SIM Blocked CME ERROR: 263 Invalid block CME ERROR: 772 SIM powered down
Коды ошибок CMS Error – GSM Network related codes
CMS ERROR: 1 Unassigned number CMS ERROR: 8 Operator determined barring CMS ERROR: 10 Call bared CMS ERROR: 21 Short message transfer rejected CMS ERROR: 27 Destination out of service CMS ERROR: 28 Unindentified subscriber CMS ERROR: 29 Facility rejected CMS ERROR: 30 Unknown subscriber CMS ERROR: 38 Network out of order CMS ERROR: 41 Temporary failure CMS ERROR: 42 Congestion CMS ERROR: 47 Recources unavailable CMS ERROR: 50 Requested facility not subscribed CMS ERROR: 69 Requested facility not implemented CMS ERROR: 81 Invalid short message transfer reference value CMS ERROR: 95 Invalid message unspecified CMS ERROR: 96 Invalid mandatory information CMS ERROR: 97 Message type non existent or not implemented CMS ERROR: 98 Message not compatible with short message protocol CMS ERROR: 99 Information element non-existent or not implemente CMS ERROR: 111 Protocol error, unspecified CMS ERROR: 127 Internetworking , unspecified CMS ERROR: 128 Telematic internetworking not supported CMS ERROR: 129 Short message type 0 not supported CMS ERROR: 130 Cannot replace short message CMS ERROR: 143 Unspecified TP-PID error CMS ERROR: 144 Data code scheme not supported CMS ERROR: 145 Message class not supported CMS ERROR: 159 Unspecified TP-DCS error CMS ERROR: 160 Command cannot be actioned CMS ERROR: 161 Command unsupported CMS ERROR: 175 Unspecified TP-Command error CMS ERROR: 176 TPDU not supported CMS ERROR: 192 SC busy CMS ERROR: 193 No SC subscription CMS ERROR: 194 SC System failure CMS ERROR: 195 Invalid SME address CMS ERROR: 196 Destination SME barred CMS ERROR: 197 SM Rejected-Duplicate SM CMS ERROR: 198 TP-VPF not supported CMS ERROR: 199 TP-VP not supported CMS ERROR: 208 D0 SIM SMS Storage full CMS ERROR: 209 No SMS Storage capability in SIM CMS ERROR: 210 Error in MS CMS ERROR: 211 Memory capacity exceeded CMS ERROR: 212 Sim application toolkit busy CMS ERROR: 213 SIM data download error CMS ERROR: 255 Unspecified error cause CMS ERROR: 300 ME Failure CMS ERROR: 301 SMS service of ME reserved CMS ERROR: 302 Operation not allowed CMS ERROR: 303 Operation not supported CMS ERROR: 304 Invalid PDU mode parameter CMS ERROR: 305 Invalid Text mode parameter CMS ERROR: 310 SIM not inserted CMS ERROR: 311 SIM PIN required CMS ERROR: 312 PH-SIM PIN required CMS ERROR: 313 SIM failure CMS ERROR: 314 SIM busy CMS ERROR: 315 SIM wrong CMS ERROR: 316 SIM PUK required CMS ERROR: 317 SIM PIN2 required CMS ERROR: 318 SIM PUK2 required CMS ERROR: 320 Memory failure CMS ERROR: 321 Invalid memory index CMS ERROR: 322 Memory full CMS ERROR: 330 SMSC address unknown CMS ERROR: 331 No network service CMS ERROR: 332 Network timeout CMS ERROR: 340 No +CNMA expected CMS ERROR: 500 Unknown error CMS ERROR: 512 User abort CMS ERROR: 513 Unable to store CMS ERROR: 514 Invalid Status CMS ERROR: 515 Device busy or Invalid Character in string CMS ERROR: 516 Invalid length CMS ERROR: 517 Invalid character in PDU CMS ERROR: 518 Invalid parameter CMS ERROR: 519 Invalid length or character CMS ERROR: 520 Invalid character in text CMS ERROR: 521 Timer expired CMS ERROR: 522 Operation temporary not allowed CMS ERROR: 532 SIM not ready CMS ERROR: 534 Cell Broadcast error unknown CMS ERROR: 535 Protocol stack busy CMS ERROR: 538 Invalid parameter
Status of a previously submitted SMS-SUBMIT (статус отправленного сообщения SMS-SUBMIT)
Short message transaction completed 0000000 Short message received by the SME 0000001 Short message forwarded by the SC to the SME but the SC is unable to confirm delivery 0000010 Short message replaced by the SC Reserved values 0000011..0001111 Reserved 0010000..0011111 Values specific to each SC Temporary error, SC still trying to transfer SM 0100000 Congestion 0100001 SME busy 0100010 No response from SME 0100011 Service rejected 0100100 Quality of service not available 0100101 Error in SME 0100110..0101111 Reserved 0110000..0111111 Values specific to each SC Permanent error, SC is not making any more transfer attempts 1000000 Remote procedure error 1000001 Incompatible destination 1000010 Connection rejected by SME 1000011 Not obtainable 1000100 Quality of service not available 1000101 No interworking available 1000110 SM Validity Period Expired 1000111 SM Deleted by originating SME 1001000 SM Deleted by SC Administration 1001001 SM does not exist (The SM may have previously existed in the SC but the SC no longer has knowledge of it or the SM may never have previously existed in the SC) 1001010..1001111 Reserved 1010000..1011111 Values specific to each SC Temporary error, SC is not making any more transfer attempts 1100000 Congestion 1100001 SME busy 1100010 No response from SME 1100011 Service rejected 1100100 Quality of service not available 1100101 Error in SME 1100110..1101001 Reserved 1101010..1101111 Reserved 1110000..1111111 Values specific to each SC
There are two types of GSM error codes: CMS Error codes and CME Error codes that your GSM may return when sending an SMS.
The CMS error codes start with ‘+CMS Error:‘ and are always network related errors. The CME error codes start with ‘+CME Error:‘ and are always device (equipment) related errors.
CME Errors (GSM equipment errors)
CME Error | Description |
0 | Phone failure |
1 | No connection to phone |
2 | Phone adapter link reserved |
3 | Operation not allowed |
4 | Operation not supported |
5 | PH_SIM PIN required |
6 | PH_FSIM PIN required |
7 | PH_FSIM PUK required |
10 | SIM not inserted |
11 | SIM PIN required |
12 | SIM PUK required |
13 | SIM failure |
14 | SIM busy |
15 | SIM wrong |
16 | Incorrect password |
17 | SIM PIN2 required |
18 | SIM PUK2 required |
20 | Memory full |
21 | Invalid index |
22 | Not found |
23 | Memory failure |
24 | Text string too long |
25 | Invalid characters in text string |
26 | Dial string too long |
27 | Invalid characters in dial string |
30 | No network service |
31 | Network timeout |
32 | Network not allowed, emergency calls only |
40 | Network personalization PIN required |
41 | Network personalization PUK required |
42 | Network subset personalization PIN required |
43 | Network subset personalization PUK required |
44 | Service provider personalization PIN required |
45 | Service provider personalization PUK required |
46 | Corporate personalization PIN required |
47 | Corporate personalization PUK required |
48 | PH-SIM PUK required |
100 | Unknown error |
103 | Illegal MS |
106 | Illegal ME |
107 | GPRS services not allowed |
111 | PLMN not allowed |
112 | Location area not allowed |
113 | Roaming not allowed in this location area |
126 | Operation temporary not allowed |
132 | Service operation not supported |
133 | Requested service option not subscribed |
134 | Service option temporary out of order |
148 | Unspecified GPRS error |
149 | PDP authentication failure |
150 | Invalid mobile class |
256 | Operation temporarily not allowed |
257 | Call barred |
258 | Phone is busy |
259 | User abort |
260 | Invalid dial string |
261 | SS not executed |
262 | SIM Blocked |
263 | Invalid block |
772 | SIM powered down |
CMS Errors (GSM Network errors)
CMS Error | Description |
1 | Unassigned number |
8 | Operator determined barring |
10 | Call bared |
21 | Short message transfer rejected |
27 | Destination out of service |
28 | Unindentified subscriber |
29 | Facility rejected |
30 | Unknown subscriber |
38 | Network out of order |
41 | Temporary failure |
42 | Congestion |
47 | Recources unavailable |
50 | Requested facility not subscribed |
69 | Requested facility not implemented |
81 | Invalid short message transfer reference value |
95 | Invalid message unspecified |
96 | Invalid mandatory information |
97 | Message type non existent or not implemented |
98 | Message not compatible with short message protocol |
99 | Information element non-existent or not implemente |
111 | Protocol error, unspecified |
127 | Internetworking , unspecified |
128 | Telematic internetworking not supported |
129 | Short message type 0 not supported |
130 | Cannot replace short message |
143 | Unspecified TP-PID error |
144 | Data code scheme not supported |
145 | Message class not supported |
159 | Unspecified TP-DCS error |
160 | Command cannot be actioned |
161 | Command unsupported |
175 | Unspecified TP-Command error |
176 | TPDU not supported |
192 | SC busy |
193 | No SC subscription |
194 | SC System failure |
195 | Invalid SME address |
196 | Destination SME barred |
197 | SM Rejected-Duplicate SM |
198 | TP-VPF not supported |
199 | TP-VP not supported |
208 | D0 SIM SMS Storage full |
209 | No SMS Storage capability in SIM |
210 | Error in MS |
211 | Memory capacity exceeded |
212 | Sim application toolkit busy |
213 | SIM data download error |
255 | Unspecified error cause |
300 | ME Failure |
301 | SMS service of ME reserved |
302 | Operation not allowed |
303 | Operation not supported |
304 | Invalid PDU mode parameter |
305 | Invalid Text mode parameter |
310 | SIM not inserted |
311 | SIM PIN required |
312 | PH-SIM PIN required |
313 | SIM failure |
314 | SIM busy |
315 | SIM wrong |
316 | SIM PUK required |
317 | SIM PIN2 required |
318 | SIM PUK2 required |
320 | Memory failure |
321 | Invalid memory index |
322 | Memory full |
330 | SMSC address unknown |
331 | No network service |
332 | Network timeout |
340 | No +CNMA expected |
500 | Unknown error |
512 | User abort |
513 | Unable to store |
514 | Invalid Status |
515 | Device busy or Invalid Character in string |
516 | Invalid length |
517 | Invalid character in PDU |
518 | Invalid parameter |
519 | Invalid length or character |
520 | Invalid character in text |
521 | Timer expired |
522 | Operation temporary not allowed |
532 | SIM not ready |
534 | Cell Broadcast error unknown |
535 | Protocol stack busy |
538 | Invalid parameter |
MC55_ATC_V04.00
Page 45 of 475
3/17/06
Confidential / Released
2.11.1
CME/CMS Error Code Overview
Table 2.4: General «CME ERROR» Codes (GSM 07.07)
<err> Code
Text (if
AT+CMEE
=2)
0
phone failure
1
no connection to phone
2
phone-adapter link reserved
3
Operation not allowed
4
Operation not supported
5
PH-SIM PIN required
6
PH-FSIM PIN required
7
PH-FSIM PUK required
10
SIM not inserted
11
SIM PIN required
12
SIM PUK required
13
SIM failure
14
SIM busy
15
SIM wrong
16
Incorrect password
17
SIM PIN2 required
18
SIM PUK2 required
20
Memory full
21
invalid index
22
not found
23
Memory failure
24
text string too long
25
invalid characters in text string
26
dial string too long
27
invalid characters in dial string
30
no network service
31
Network timeout
32
Network not allowed emergency calls only
40
Network personalization PIN required
41
Network personalization PUK required
42
Network subset personalization PIN required
43
Network subset personalization PUK required
44
service provider personalization PIN required
45
service provider personalization PUK required
46
Corporate pe sonalization PIN required
47
Corporate personalization PUK required
48
Master Phone Code required
100
unknown
132
service option not supported
TC63 AT Command Set
2.12 AT+CMEE
2.12.1
Table 2.4:
General «CME ERROR» Codes (GSM 07.07)
<err> Code
0
1
2
3
4
5
6
7
10
11
12
13
14
15
16
17
18
20
21
22
23
24
25
26
27
30
31
32
40
41
42
43
44
45
46
47
48
100
132
TC63_ATC_V00.490
Confidential / Draft — Do not copy
Text (if AT+CMEE=2)
phone failure
no connection to phone
phone-adapter link reserved
Operation not allowed
Operation not supported
PH-SIM PIN required
PH-FSIM PIN required
PH-FSIM PUK required
SIM not inserted
SIM PIN required
SIM PUK required
SIM failure
SIM busy
SIM wrong
Incorrect password
SIM PIN2 required
SIM PUK2 required
Memory full
invalid index
not found
Memory failure
text string too long
invalid characters in text string
dial string too long
invalid characters in dial string
no network service
Network timeout
Network not allowed emergency calls only
Network personalization PIN required
Network personalization PUK required
Network subset personalization PIN required
Network subset personalization PUK required
service provider personalization PIN required
service provider personalization PUK required
Corporate pe sonalization PIN required
Corporate personalization PUK required
Master Phone Code required
unknown
service option not supported
Page 47 of 501
s
5/24/05