You definitely need to check the AT commands user manual of your device and check their syntax.
AT+CMGS
has two different modes:
- in PDU mode its syntax is
AT+CMGS=<PDU>
- in text mode it is
AT+CMGS=< dest phone number>
In both cases AT+CMGS
is wrong, and operation not supported
is the error you get for a wrong syntax (after setting verbose error mode with AT+CMEE=2
).
There are plenty of questions showing the correct AT commands sequence required to send an SMS, for example this one.
I summarize that sequence here briefly:
Some things ti check before starting:
- Make sure that the SIM is inserted
- Make sure that the PIN code has been correctly inserted (by issuing
AT+CPIN?
you have to receive the READY
response)
- Make sure that the device is correctly registered to the network (by issuing
AT+CREG?
you have to receive the +CREG: 0,1
response)
Then:
- Switch to text mode by issuing
AT+CMGF=1
- Tell to the device the phone number you want send the SMS to, by issuing
AT+CMGS=<PHONE NUMBER>
. The device will output the >
prompt character
- Write your text
- Close the SMS by providing the Ctrl-Z character (
0x1A
ASCII code)
- On success, the response
+CMGS: <N>
will be displayed, with N
in the range 0-255 meaning the progressive ID of sent messages