How to send and SMS from Android phone?


My connectivity is a bit flaky so I would love to be able to send SMS from the android phone when it goes down.
There is an sms-tool package but it does not work with RNDIS modems aka phone.
I can install adb and send SMS text that way.

Have you seen a way to send SMS while offline using a Smartphone?

how will you send an sms if the network's down ?


I've seen occasions when data connectivity is lost, but voice/SMS is still available. I'd tend to agree with you though, it doesn't sound a reliable reporting mechanism!

1 Like

Two different providers. I have two different SIMs. So if one responsible for 4g goes down other can text but it has no data.

What's the OpenWrt angle here?

So this is a single Android phone with two SIMs? If so I'd be strongly tempted to keep all this logic on the Android device; it knows whether it has an internet connection or not, and is capable of sending SMS messages accordingly. You just need the right software on the Android phone to make it happen.
I'd start by looking at something like Tasker, possibly with one of the (many) plugins that people have created to extend it. Its been a while since I last used it, but back then the community used to be very responsive; hopefully they'll have a simple solution.

It is hard to understand how OpenWrt factors in here… can you clarify this? It seems to be entirely an Android issue.

1 Like

I have experienced that things running on Android are less reliable. First there is the battery optimisation that has to be overcome then you have other problems like limited control. Mobile devices are just not designed to run like servers.

OpenWrt has SMS sending capability over other protocols I was wondering maybe there is way to do it using the protocol phones are using.

Not that I know of. A tethered phone is (I believe) using RNDIS, which is basically a virtual Ethernet connection, in this case run over USB. It's not related to the phones SMS capabilities.

Create wifi network, connect phone to it - enable Wi-Fi debugging on the phone , install adb tools on openwrt ( if they exist, idk.. ) , open openwrt terminal , pair the devices : adb pair <phoneIPaddress> and that's it as far as preparations on openwrt end go...

Write your own script so whenever internet goes down, your router connects to the phone with this code , or something similar ( wireless debugging will always start on the random port , that's where nmap comes into play )

adb connect ${PHONE}:$( nmap -sT ${PHONE} -p30000-49999 | awk -F/ '/tcp open/{print $1}' )

and then you can issue whatever adb command you need in order to send out SMS

I still don't know what you're trying to do though...

1 Like

Thanks for suggestion. I have the phone on wired connection, so no need for Wifi I just need to sit down write a simple script that keeps pinging google to check if I am online :stuck_out_tongue:

You can find such scripts here on the forum, if you search, even if the alert isn't made by sms, that part you'll have to add yourself.

1 Like