I want to send and receive SMS from the command line.
April 15, 2016 9:50 AM   Subscribe

I have a Linux machine. I have a spare activated cheap-o SIM card. I have a spare old phone and an old hotspot. Can I connect these things together to build an SMS gateway that will allow me to send and receive text messages from the command line on the Linux box?

I know I can do this with a USB dongle, but I'm wondering if I can do it with my existing gear.

The old phone is an early-model Moto X, rooted with an unlocked bootloader and cyanogenmod. The hotspot is a ZTE-MF61. Either one could/would be dedicated to the task.
posted by toxic to Computers & Internet (12 answers total) 3 users marked this as a favorite
I don't know if it supports your specific hardware, but check out Frontline SMS: http://www.frontlinesms.com/
posted by scolbath at 10:08 AM on April 15, 2016

Is your hardware compatible with gnokii? I remember back in the day I built an sms gateway with that and a nokia phone connected via usb. I don't recall, but despite starting out specifically for nokia phones I thought some others were supported. If you have bluetooth already on your computer that may simplify things.
posted by nobeagle at 10:11 AM on April 15, 2016 [1 favorite]

You could just install an ssh client like sshdroid on the phone and then ssh into it. There are android command line hooks into SMS from there, it looks like from Google.
posted by rockindata at 10:17 AM on April 15, 2016 [2 favorites]

If you want a quick service to do this for you, TextBelt is as simple and free as it gets. (Honestly I don't understand how it exists.) But that's you sending HTTP requests to a service that then forwards the message to a carrier gateway, it's not an authentic SMS sent over the cell network.
posted by Nelson at 10:21 AM on April 15, 2016 [1 favorite]

I send and receive SMS through pushbullett in my browser. Not sure if it has a command line solution.
posted by AugustWest at 10:32 AM on April 15, 2016

I don't know squat about Linux, but you can send an email to a SMS number.
You do need to know the provider of the SMS number.

For example sending an email to mobile-number@txt.att.net will send a text to the specificed AT&T number.

Look here for a list of the emails to send texts to.

I'd be shocked if you couldn't send an email from the command line in Linux but I have no idea how.
posted by Confess, Fletch at 10:51 AM on April 15, 2016

I don't know of a way of 'discovering' the provider, you simply have to know.

I don't think it's possible to receive emails from a text message with this method. It's strictly one way.
posted by Confess, Fletch at 10:55 AM on April 15, 2016

Quick followup:
I want to send and receive text messages, and I'd prefer to do so with the number associated with this SIM card.

Textbelt and email->SMS are non-starters for me, because they are one-way, and probably can't be convinced to spoof my existing number.
posted by toxic at 11:00 AM on April 15, 2016 [1 favorite]

Would Google Voice forward incoming texts to your actual number?
posted by wenestvedt at 11:49 AM on April 15, 2016

Sending is pretty easy. Anything you could do with an android terminal command, you can do with an "adb shell" command on a USB-connected host computer. Here's a set of commands to do exactly that.

Getting received SMS's passed to a connected computer seems like it'd be much harder. You'd need some sort of process on the host machine constantly polling the phone or somehow responsive to an event triggered by the phone.
posted by jackbishop at 1:33 PM on April 15, 2016 [1 favorite]

Maybe give gnokii a try? http://www.gnokii.org/
posted by linear_arborescent_thought at 2:55 PM on April 15, 2016

Well, if you're trying to do this in order to accomplish tasks, you don't want to do it by hacking together some hardware solution, you want to use one of the APIs that allow you to send and receive SMS messages. I think Twilio is the most widely-known. You can certainly interact with an API from the command line on your Linux box; I don't know about porting your number over to the service, but it may be possible.
posted by mister pointy at 7:10 PM on April 15, 2016

« Older Appropriate thank you presents for people who...   |   How do we break out of a years long separation... Newer »
This thread is closed to new comments.