Send SMS from terminal

I have tryed to send followring command from terminal:
ec2x.query “AT+CMGS=+xxxxxxxxxx
SMS Message sent from AutoPI.”

and get this response:
SMS’ is not available.

How can i make this working?

Hi @MeKodak,

Did you get it working?

Make sure that SMS is enabled on your subscription and then remember to setup the SMS format prior to sending the SMS:

//Set SMS message format as text mode

//Set character set as GSM

Let me know if it works.


I’m also trying to send SMS using AT command from RPi.
My SIM card is both SMS and voice capable.
I’ve tried the following command from Terminal, as well as testing via python Custom Code, both returns the same error result. {’‘reason’’: None, ‘‘type’’: None}

Any other ideas to try?

ec2x.query 'AT+CMGF=1’
_stamp: '2020-08-15T10:28:44.028651’

ec2x.query 'AT+CSCS=“GSM”'
_stamp: '2020-08-15T10:31:42.119119’

ec2x.query 'AT+CMGS=+84902020271\rhello’
‘{’‘reason’’: None, ‘‘type’’: None}’

def test_send_sms():
    # select text mode

    # Set character set as GSM

    # send SMS
    res = __salt__['ec2x.query']('AT+CMGS=+84902020271\rhello')
    return {"msg": "Send SMS finished", "res": res}