Read and Send SMS

I really love my new MiFi, it works just great! To make the world perfect, there is one feature (that commercial MiFi’s often have) I’d still need: the ability to read and send SMS and USSD codes through the WebGUI. For registration purposes and also activating an internet day package I often need to send or receive an SMS. This would of course also be true for any other gl-inet router with OpenWRT and a 3G-USB-dongle.

Does anybody have a solution or experience with this?

Thanks, Daniel

Not sure when we have this in the UI. But you can use AT command to send and receive SMS. These things are very strange.

Which module do you have?

Thanks for your reply! I have an EC20-E. Using the AT commands will have to be my fallback for now. But of course it would be a lot more convenient and usable to have it in the GUI. I’ve seen some mention of smstools3 (<span class=“st”> for openwrt, but getting that to work doesn’t look trivial to me.

@daniel, I’m putting some guide here, just in case if you want to try.

First, you can refer to the AT command guide of EC20 here:

send message:

echo -e -n "AT+CPMS=\"ME\",\"ME\",\"ME\"\015\012" >/dev/ttyUSB2
echo -e -n "AT+CPMS?\015\012" >/dev/ttyUSB2
echo -e -n "AT+CMGF=1\015\012" >/dev/ttyUSB2 
echo -e -n "AT+CMGF?\015\012" >/dev/ttyUSB2 
echo -e -n "AT+CSCS=\"GSM\"\015\012" >/dev/ttyUSB2
echo -e -n "AT+CSCS?\015\012" >/dev/ttyUSB2
echo -e -n "AT+CMGS=\"this is my message\"\015\012" >/dev/ttyUSB2

read message:

echo -e -n "AT+CMGL=\"ALL\"\015\012" >/dev/ttyUSB2
cat /dev/ttyUSB2

delete message:

echo -e -n "AT+CMGD=0\015\012" >/dev/ttyUSB2

@alzhao: thx for putting these command together for me!


I’ve managed to send and receive my first SMS from the shell. For anybody else trying this, I needed to do some slight adjustments:


*** first connect to the network:



*** send message:

echo -e "AT+CPMS=\"ME\",\"ME\",\"ME\"\r" >/dev/ttyUSB2
sleep 1
echo -e "AT+CMGF=1\r" >/dev/ttyUSB2 
sleep 1 
echo -e "AT+CSCS=\"GSM\"\r" >/dev/ttyUSB2
sleep 1
echo -e "AT+CMGS=\"destination-number\"\r" >/dev/ttyUSB2
sleep 1
echo -e "this is my message\x1A" >/dev/ttyUSB2


*** read message:

echo -e "AT+CMGL=\"ALL\"\r" >/dev/ttyUSB2
cat /dev/ttyUSB2


*** delete message:

echo -e "AT+CMGD=0\r" >/dev/ttyUSB2


*** send USSD:

echo -e "AT+CUSD=1,\"*121#\"\r" >/dev/ttyUSB2
cat /dev/ttyUSB2



I am very glad that this works at your side!

If you can share your carrier information that will be helpful.

I’m happy to provide additional info. comgt returns:

Registered on Home network: “Sunrise Sunrise”,7
Signal Quality: 20,99

Is that the info you’re interested in?

So this is Swiss carrier? This is useful enough. We just confirm it works in your country with this carrier.
Thanks very much!

You’re welcome!

This is very useful information!!


+1 To having an SMS option built into the WebUI, would be an awesome addition!

Hi, I create small LuCI app.

Luci-app-sms-tool is a mini gui for handling messages via sms_tool application/project Works with mPCI-E and USB 3G/LTE modems. Don’t work with HiLink/RNDIS modems.

I’m making it available and maybe it’ll come in handy.


1 Like